Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r16b178ff7528cb09c66413d19980a4eb0d13b48e -r368e2fde80a5cc108f61c021830c684e05fb62d5 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 16b178ff7528cb09c66413d19980a4eb0d13b48e) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 368e2fde80a5cc108f61c021830c684e05fb62d5) @@ -596,10 +596,28 @@ *************************************************************************/ BOOL sendDisposableRemovalConfirmResponse( BOOL accepted, U32 reason ) { - return sendUIResponseMsg( MSG_ID_UI_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE, accepted, reason ); + return sendUIResponseMsg( MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE, accepted, reason ); } /*********************************************************************//** + * @brief + * The handleUITreatmentLogDataRequest function handles UI treatment log data request. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none. + *************************************************************************/ +void handleUITreatmentLogDataRequest( MESSAGE_T *message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + handleTreatmentLogDataRequest(); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); +} + +/*********************************************************************//** * @brief * The sendTreatmentLogData function constructs a treatment log data message * for UI and queues the msg for transmit on the appropriate CAN channel. @@ -608,16 +626,21 @@ * @param logDataPtr treatment log data record pointer * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL sendTreatmentLogData( TREATMENT_LOG_DATA_PAYLOAD_T *logDataPtr ) +BOOL sendTreatmentLogData( BOOL accepted, U32 reason, TREATMENT_LOG_DATA_PAYLOAD_T *logDataPtr ) { MESSAGE_T msg; + U08 *payloadPtr = msg.payload; // Create a message record blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_HD_TREATMENT_LOG_DATA; - msg.hdr.payloadLen = sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ); + msg.hdr.msgID = MSG_ID_HD_TREATMENT_LOG_DATA_RESPONSE; + msg.hdr.payloadLen = sizeof( BOOL ) + sizeof( U32 ) + sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ); - memcpy( msg.payload, logDataPtr, sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ) ); + memcpy( payloadPtr, &accepted, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &reason, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, logDataPtr, sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ) ); // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer return serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED );