Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r9a96522e0a94724a13c2c9c8f60cf8d18ebde218 -re190a7eb5fb36d4a0c42e9db709571db3037d39d --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9a96522e0a94724a13c2c9c8f60cf8d18ebde218) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision e190a7eb5fb36d4a0c42e9db709571db3037d39d) @@ -36,6 +36,7 @@ #include "SystemComm.h" #include "SystemCommMessages.h" #include "Temperatures.h" +#include "Timers.h" #include "TreatmentEnd.h" #include "TreatmentRecirc.h" #include "TreatmentStop.h" @@ -53,6 +54,7 @@ // ********** private definitions ********** #define MAX_MSGS_BLOCKED_FOR_XMIT 8 ///< Maximum number of messages to block transmission for. +#define NUM_CONFIRM_REQUESTS 4 ///< Number of available confirmation requests. #pragma pack(push,1) /// Payload record structure for block message transmission request. @@ -68,6 +70,11 @@ /// List of message IDs that are requested not to be transmitted. static BLOCKED_MSGS_DATA_T blockedMessagesForXmit = { 0, 0, 0, 0, 0, 0, 0, 0 }; +static CONFIRMATION_REQUEST_T confirmRequests[NUM_CONFIRM_REQUESTS] = + { 0, CONFIRMATION_REQUEST_TYPE_OPEN, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, + 0, CONFIRMATION_REQUEST_TYPE_OPEN, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, + 0, CONFIRMATION_REQUEST_TYPE_OPEN, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, + 0, CONFIRMATION_REQUEST_TYPE_OPEN, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, }; // ********** private function prototypes ********** @@ -7518,4 +7525,137 @@ } +/*********************************************************************//** + * @brief + * The handleUIConfirmationResponse function handles a UI response for + * confirmation request. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleUIConfirmationResponse( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + if ( message->hdr.payloadLen == 2 * sizeof(U32) ) + { + U32 request_id; + CONFIRMATION_REQUEST_STATUS_T status; + U08 i; + + memcpy( &request_id, message->payload, sizeof(U32) ); + memcpy( &status, ( message->payload + sizeof(U32) ), sizeof(U32) ); + + for ( i=0; ihdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, result ); +} + +/*********************************************************************//** + * @brief + * The checkConfrimRequestStatus function checks the status of a confirmation request + * @details Inputs: confirmRequests[] + * @details Outputs: confirmRequests[] cleared if read. + * @param request ID + * @return CONFIRMATION_REQUEST_STATUS_T + *************************************************************************/ +CONFIRMATION_REQUEST_STATUS_T checkConfirmationRequestStatus( U32 request_id ) +{ + U08 i; + CONFIRMATION_REQUEST_STATUS_T status = CONFIRMATION_REQUEST_STATUS_PENDING; + + for ( i=0; i