Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r3d8b84b8ce7ee9526fbabccb9e51d691a3df6305 -rac55f23681cd3a29ec235265f73c67895e36ada9 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3d8b84b8ce7ee9526fbabccb9e51d691a3df6305) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision ac55f23681cd3a29ec235265f73c67895e36ada9) @@ -227,7 +227,7 @@ * @param almData2 2nd data associated with alarm * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL broadcastAlarmTriggered( U16 alarm, ALARM_DATA_T almData1, ALARM_DATA_T almData2 ) +BOOL broadcastAlarmTriggered( U32 alarm, ALARM_DATA_T almData1, ALARM_DATA_T almData2 ) { BOOL result; MESSAGE_T msg; @@ -236,10 +236,10 @@ // create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_ALARM_TRIGGERED; - msg.hdr.payloadLen = sizeof( U16 ) + sizeof( ALARM_DATA_T ) + sizeof( ALARM_DATA_T ); + msg.hdr.payloadLen = sizeof( U32 ) + sizeof( ALARM_DATA_T ) + sizeof( ALARM_DATA_T ); - memcpy( payloadPtr, &alarm, sizeof( U16 ) ); - payloadPtr += sizeof( U16 ); + memcpy( payloadPtr, &alarm, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); memcpy( payloadPtr, &almData1, sizeof( ALARM_DATA_T ) ); payloadPtr += sizeof( ALARM_DATA_T ); memcpy( payloadPtr, &almData2, sizeof( ALARM_DATA_T ) ); @@ -259,7 +259,7 @@ * @param alarm ID of alarm cleared * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL broadcastAlarmCleared( U16 alarm ) +BOOL broadcastAlarmCleared( U32 alarm ) { BOOL result; MESSAGE_T msg; @@ -268,9 +268,9 @@ // create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_ALARM_CLEARED; - msg.hdr.payloadLen = sizeof( U16 ); + msg.hdr.payloadLen = sizeof( U32 ); - memcpy( payloadPtr, &alarm, sizeof( U16 ) ); + memcpy( payloadPtr, &alarm, 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_DG_ALARM, ACK_REQUIRED ); @@ -280,6 +280,35 @@ /*********************************************************************//** * @brief + * The broadcastAlarmConditionCleared function constructs an alarm condition + * cleared msg to be broadcast and queues the msg for transmit on the + * appropriate CAN channel. + * @details Inputs: none + * @details Outputs: alarm condition cleared msg constructed and queued. + * @param alarm ID of alarm which alarm condition is cleared + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastAlarmConditionCleared( U32 alarm ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_ALARM_CONDITION_CLEARED; + msg.hdr.payloadLen = sizeof( U32 ); + + memcpy( payloadPtr, &alarm, 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_DG_ALARM, ACK_REQUIRED ); + + return result; +} + +/*********************************************************************//** + * @brief * The broadcastAccelData function constructs an accelerometer data msg to * be broadcast and queues the msg for transmit on the appropriate CAN channel. * @details Inputs: none