Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r46b163d19c65e8c21db7b0247bbb1af0dba1ece5 -ra16225ab0fc1c575ad857ccf1dcccdb7a3aa8eef --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 46b163d19c65e8c21db7b0247bbb1af0dba1ece5) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision a16225ab0fc1c575ad857ccf1dcccdb7a3aa8eef) @@ -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" @@ -52,6 +53,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. @@ -67,6 +69,11 @@ static volatile U16 nextSeqNo = 1; ///< Value of sequence number to use for next transmitted message. /// 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, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, + 0, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, + 0, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, + 0, 0, CONFIRMATION_REQUEST_STATUS_UNUSED, }; // ********** private function prototypes ********** @@ -76,6 +83,93 @@ /*********************************************************************//** * @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; ihdr.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 ); +} + /**@}*/