Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r46b163d19c65e8c21db7b0247bbb1af0dba1ece5 -ra16225ab0fc1c575ad857ccf1dcccdb7a3aa8eef --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 46b163d19c65e8c21db7b0247bbb1af0dba1ece5) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision a16225ab0fc1c575ad857ccf1dcccdb7a3aa8eef) @@ -66,6 +66,36 @@ #define ACK_REQUIRED TRUE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. #define ACK_NOT_REQUIRED FALSE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. +/// TODO - should this be in HDDefs? MsgDefs or other common?. +#define CONFIRMATION_REQUEST_TIMEOUT_MS ( SEC_PER_MIN * MS_PER_SECOND ) +/// List of confirmation status. +typedef enum Confirmation_Status +{ + CONFIRMATION_REQUEST_STATUS_REJECTED = 0, ///< Confirmation status rejected + CONFIRMATION_REQUEST_STATUS_ACCEPTED, ///< Confirmation status accepted + CONFIRMATION_REQUEST_STATUS_TIMEOUT, ///< Confirmation status timeout + CONFIRMATION_REQUEST_STATUS_PENDING, ///< Confirmation status pending response + CONFIRMATION_REQUEST_STATUS_UNUSED, ///< Confirmation status Unused + NUM_OF_CONFIRMATION_REQUEST_STATUS ///< Number of confirmation status +} CONFIRMATION_REQUEST_STATUS_T; + +/// List of confirmation status. +typedef enum Confirmation_Request_Type +{ + CONFIRMATION_REQUEST_TYPE_OPEN = 0, ///< Confirmation type open + CONFIRMATION_REQUEST_TYPE_CLOSE, ///< Confirmation type close + CONFIRMATION_REQUEST_TYPE_REJECT, ///< Confirmation type cancel + NUM_OF_CONFIRMATION_TYPE ///< Number of confirmation types +} CONFIRMATION_REQUEST_TYPE_T; + +/// Structure for confirmation request. +typedef struct +{ + U32 requestID; ///< Request ID + U32 timeStamp; ///< Timestamp for request + CONFIRMATION_REQUEST_STATUS_T status; ///< Request status (pending, accepted, rejected) +} CONFIRMATION_REQUEST_T; + // ********** public function prototypes ********** // Serialize message @@ -813,6 +843,11 @@ // MSG_ID_HD_SEND_ALARMS_COMMAND void handleResendAllAlarmsCommand( MESSAGE_T* message ); +// MSG_ID_UI_CONFIRMATION_RESULT +void handleUIConfirmationResponse( MESSAGE_T *message ); +CONFIRMATION_REQUEST_STATUS_T checkConfirmationRequestStatus( U32 request_id ); +U32 sendConfirmationRequest( CONFIRMATION_REQUEST_TYPE_T request_type, U32 reject_reason ); + /**@}*/ #endif