Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rbd738c0705e8640d2c532ecece876aaa3496ee32 -rc2b71cdf84febca251700488647c001604ba2e7b --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision bd738c0705e8640d2c532ecece876aaa3496ee32) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision c2b71cdf84febca251700488647c001604ba2e7b) @@ -24,7 +24,6 @@ #include "DGInterface.h" #include "DialInFlow.h" #include "Dialysis.h" -#include "MsgQueues.h" #include "ModeTreatment.h" #include "PresOccl.h" #include "WatchdogMgmt.h" @@ -913,6 +912,35 @@ return result; } +/************************************************************************* + * @brief + * The broadcastHDOperationMode function constructs an HD operation mode \n + * broadcast message and queues the msg for transmit on the appropriate CAN channel. + * @details + * Inputs : none + * Outputs : HD operation mode msg constructed and queued + * @param mode : current HD operation mode. + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastHDOperationMode( U32 mode ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_OP_MODE; + msg.hdr.payloadLen = sizeof( U32 ); + + memcpy( payloadPtr, &mode, sizeof( U32 ) ); + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_BROADCAST, ACK_NOT_REQUIRED ); + + return result; +} + // *********************************************************************** // **************** Message Handling Helper Functions ******************** // ***********************************************************************