Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r44a100f8e5210a02c23b8fcc4527d8e96d577381 -r6820043b5dc623a84e7323168dd1d4bd9815e859 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 44a100f8e5210a02c23b8fcc4527d8e96d577381) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 6820043b5dc623a84e7323168dd1d4bd9815e859) @@ -757,9 +757,42 @@ // 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 sendTreatmentLogEventData function constructs a treatment log parameter + * change event data message for UI and queues the msg for transmit on the + * appropriate CAN channel. + * @details Inputs: none + * @details Outputs: Treatment log alarm event data msg constructed and queued. + * @param event ID of parameter change event + * @param oldValue parameter change event old data value + * @param newValue parameter change event new data value + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendTreatmentLogEventData( EVENT_ID_T event, F32 oldValue, F32 newValue ) +{ + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + U32 eventID = (U32)event; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_TREATMENT_LOG_EVENT; + msg.hdr.payloadLen = sizeof( EVENT_ID_T ) + 3 * sizeof( F32 ); + + memcpy( payloadPtr, &eventID, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &oldValue, sizeof( F32 ) ); + payloadPtr += sizeof( F32 ); + memcpy( payloadPtr, &newValue, sizeof( F32 ) ); + + // 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 handleSampleWaterCmd function handles a sample water user action command * message from the UI. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r5e650bc96230e209560abfe290f1ec93e1667d82 -r6820043b5dc623a84e7323168dd1d4bd9815e859 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 5e650bc96230e209560abfe290f1ec93e1667d82) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 6820043b5dc623a84e7323168dd1d4bd9815e859) @@ -274,6 +274,9 @@ // MSG_ID_HD_ACTIVE_ALARMS_LIST_REQUEST_RESPONSE BOOL sendActiveAlarmsList( BOOL accepted, U32 reason, U32 *alarmList, U32 size ); +// MSG_ID_HD_TREATMENT_LOG_EVENT +BOOL sendTreatmentLogEventData( EVENT_ID_T event, F32 oldValue, F32 newValue ); + // *********** public DG command functions ********** // MSG_ID_SET_DG_DIALYSATE_TEMP_TARGETS