Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r9a96522e0a94724a13c2c9c8f60cf8d18ebde218 -re190a7eb5fb36d4a0c42e9db709571db3037d39d --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 9a96522e0a94724a13c2c9c8f60cf8d18ebde218) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision e190a7eb5fb36d4a0c42e9db709571db3037d39d) @@ -63,9 +63,38 @@ #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. -#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_TIMEOUT, ///< Confirmation type close due to timeout + CONFIRMATION_REQUEST_TYPE_REJECT, ///< Confirmation type reject + CONFIRMATION_REQUEST_TYPE_CLOSE_ACCEPT, ///< Confirmation type close due to accepted confirm + NUM_OF_CONFIRMATION_TYPE ///< Number of confirmation types +} CONFIRMATION_REQUEST_TYPE_T; + +/// Structure for confirmation request. +typedef struct +{ + U32 requestID; ///< Request ID + CONFIRMATION_REQUEST_TYPE_T requestType; ///< Request Type + U32 timeStamp; ///< Timestamp for request + CONFIRMATION_REQUEST_STATUS_T status; ///< Request status (pending, accepted, rejected) +} CONFIRMATION_REQUEST_T; + // ********** public function prototypes ********** // Serialize message @@ -837,6 +866,11 @@ // MSG_ID_HD_DIAL_OUT_SET_PWM void handleTestDialOutSetPWM( 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