Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r51f6fc48648cb77a1d82c001890c2795a801d386 -r68b7f509295fb25aead139a4391913ca05989fdc --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 51f6fc48648cb77a1d82c001890c2795a801d386) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 68b7f509295fb25aead139a4391913ca05989fdc) @@ -8,7 +8,7 @@ * @file SystemCommMessages.c * * @author (last) Dara Navaei -* @date (last) 15-Feb-2023 +* @date (last) 21-Mar-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -1659,30 +1659,29 @@ /*********************************************************************//** * @brief - * The handleCpldStatusRequest function handles a CPLD Status request message. + * The handleReceiveChemFlushSampleResultsFromHD function handles receiving + * the chemical disinfect sample flush results from HD. * @details Inputs: none * @details Outputs: message handled * @param message a pointer to the message to handle * @return none *************************************************************************/ -void handleCpldStatusRequest( MESSAGE_T *message ) +void handleReceiveChemFlushSampleResultsFromHD( MESSAGE_T *message ) { - MESSAGE_T msg; - CPLD_STATUS_T payload; - U08 *payloadPtr = msg.payload; + BOOL status = FALSE; - // populate payload - getCPLDStatus( &payload ); - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_CPLD_STATUS_DATA; - msg.hdr.payloadLen = sizeof( CPLD_STATUS_T ); + if ( message->hdr.payloadLen == sizeof(U32) ) + { + U32 result; - // fill message payload - memcpy( payloadPtr, &payload, sizeof( CPLD_STATUS_T ) ); + memcpy( &result, message->payload, sizeof(U32) ); - // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer - serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_BROADCAST, ACK_NOT_REQUIRED ); + setChemicalDisinfectFlushSampleResult( result ); + + status = TRUE; + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, status ); }