#include "SystemCommMessages.h" #include "Utilities.h" /** * @addtogroup MessageSupport * @{ */ // ********** private function prototypes ********** /*********************************************************************//** * @brief * The broadcastData function broadcasts data. * @details Inputs: none * @details Outputs: load cell data msg constructed and queued * @param msgID message ID of the data is broadcast * @param buffer comm buffer ID * @param dataPtr pointer to the start of the buffer * @param length length of the data buffer * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL broadcastData( MSG_ID_T msgID, COMM_BUFFER_T buffer, U08* dataPtr, U32 length ) { BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; // create a message record blankMessage( &msg ); msg.hdr.msgID = msgID; msg.hdr.payloadLen = length; memcpy( payloadPtr, dataPtr, length ); // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, buffer, ACK_NOT_REQUIRED ); return result; } /**@}*/