Index: MessageSupport.c =================================================================== diff -u -r17fdefc3752a193c0d2d495f1497cc8c1e35c406 -ra89fd55052e2e467f9ae2fdc828e84272c142022 --- MessageSupport.c (.../MessageSupport.c) (revision 17fdefc3752a193c0d2d495f1497cc8c1e35c406) +++ MessageSupport.c (.../MessageSupport.c) (revision a89fd55052e2e467f9ae2fdc828e84272c142022) @@ -15,6 +15,7 @@ * ***************************************************************************/ +#include "MessageSupport.h" #include "SystemCommMessages.h" #include "Utilities.h" @@ -28,9 +29,9 @@ /*********************************************************************//** * @brief - * The broadcastData function broadcasts data. + * The broadcastData function queues a broadcast message for transmission. * @details Inputs: none - * @details Outputs: load cell data msg constructed and queued + * @details Outputs: broadcast 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 @@ -48,7 +49,10 @@ msg.hdr.msgID = msgID; msg.hdr.payloadLen = length; - memcpy( payloadPtr, dataPtr, length ); + if ( ( length > 0 ) && ( dataPtr != 0 ) ) + { + 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 );