Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rb8f8a3fdf24e26c0268b3f566061d8c6d7cd44e7 -r17b1e8df35d294dfa84a6ee9c23c1b4de956c4e9 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision b8f8a3fdf24e26c0268b3f566061d8c6d7cd44e7) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 17b1e8df35d294dfa84a6ee9c23c1b4de956c4e9) @@ -514,6 +514,30 @@ 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. + * @details Inputs: none + * @details Outputs: Treatment log data msg constructed and queued. + * @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 ) +{ + MESSAGE_T msg; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_TREATMENT_LOG_DATA; + msg.hdr.payloadLen = sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ); + + memcpy( msg.payload, 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 ); +} /*********************************************************************//** * @brief