Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r6cd114c4deffb81e85c6cd3ebaf550fe4661efda -r84bb8663dae71170e1743a2bed37b0aa47465b47 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 6cd114c4deffb81e85c6cd3ebaf550fe4661efda) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 84bb8663dae71170e1743a2bed37b0aa47465b47) @@ -538,8 +538,33 @@ result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); return result; -} +} + +/*********************************************************************//** + * @brief + * The sendTreatmentPeriodDataToUI function constructs a treatment period + * data message to the UI and queues the msg for transmit on the appropriate CAN channel. + * @details Inputs: none + * @details Outputs: Treatment parameter ranges msg constructed and queued. + * @param periodDataPtr treatment log period data record pointer + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendTreatmentPeriodDataToUI( TREATMENT_LOG_DATA_PERIODIC_T * periodDataPtr ) +{ + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_TREATMENT_LOG_PERIOD_DATA; + msg.hdr.payloadLen = sizeof( TREATMENT_LOG_DATA_PERIODIC_T ); + + memcpy( payloadPtr, periodDataPtr, sizeof( TREATMENT_LOG_DATA_PERIODIC_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  * The handlePatientDisconnectionConfirmCmd function handles user confirms