Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r533272e6ef2873fcfe7a41338a6c88c7a601605d -r129a1c2f4343bc85efdb4767c2dec35e4ba8ce98 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 533272e6ef2873fcfe7a41338a6c88c7a601605d) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 129a1c2f4343bc85efdb4767c2dec35e4ba8ce98) @@ -1,8 +1,6 @@ #include // for memcpy() -#include "reg_system.h" - #include "Compatible.h" #include "Messaging.h" #include "OperationModes.h" @@ -47,7 +45,6 @@ COMM_BUFFER_NOT_USED, ///< Buffer for outgoing HD to PC messages so no response buffer }; - typedef BOOL (*MsgFuncPtr)( MESSAGE_T* ); /// Message handling function lookup table @@ -80,7 +77,6 @@ #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLERS) / sizeof(MsgFuncPtr)) - // ********** private data ********** static BOOL testerLoggedIn = FALSE; ///< Flag indicates whether tester logged in or not. @@ -308,43 +304,6 @@ /*********************************************************************//** * @brief - * The sendEvent function constructs an DG event message to the UI and - * queues the msg for transmit on the appropriate CAN channel. - * @details \b Inputs: none - * @details \b Outputs: DG event msg constructed and queued. - * @param event Enumeration of event type that occurred - * @param dat1 First data associated with event - * @param dat2 Second data associated with event - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL sendEvent( RO_EVENT_ID_T event, EVENT_DATA_T dat1, EVENT_DATA_T dat2 ) -{ - BOOL result; - MESSAGE_T msg; - EVENT_PAYLOAD_T eventStruct; - - eventStruct.event = (U32)event; - eventStruct.dataType1 = (U32)dat1.dataType; - eventStruct.data1 = dat1.data; - eventStruct.dataType2 = (U32)dat2.dataType; - eventStruct.data2 = dat2.data; - - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_RO_EVENT; - msg.hdr.payloadLen = sizeof( EVENT_PAYLOAD_T ); - - memcpy( &msg.payload, &eventStruct, sizeof( EVENT_PAYLOAD_T ) ); - - // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer - // TODO : validate the change , DD -> UI channel removed and added DD broadcast instead. - result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_RO_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief * The broadcastAlarmTriggered function constructs an alarm triggered msg to * be broadcast and queues the msg for transmit on the appropriate CAN channel. * @details \b Inputs: none @@ -446,6 +405,43 @@ return result; } +/*********************************************************************//** + * @brief + * The sendEvent function constructs an DG event message to the UI and + * queues the msg for transmit on the appropriate CAN channel. + * @details \b Inputs: none + * @details \b Outputs: DG event msg constructed and queued. + * @param event Enumeration of event type that occurred + * @param dat1 First data associated with event + * @param dat2 Second data associated with event + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendEvent( RO_EVENT_ID_T event, EVENT_DATA_T dat1, EVENT_DATA_T dat2 ) +{ + BOOL result; + MESSAGE_T msg; + EVENT_PAYLOAD_T eventStruct; + + eventStruct.event = (U32)event; + eventStruct.dataType1 = (U32)dat1.dataType; + eventStruct.data1 = dat1.data; + eventStruct.dataType2 = (U32)dat2.dataType; + eventStruct.data2 = dat2.data; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_RO_EVENT; + msg.hdr.payloadLen = sizeof( EVENT_PAYLOAD_T ); + + memcpy( &msg.payload, &eventStruct, sizeof( EVENT_PAYLOAD_T ) ); + + // 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_RO_BROADCAST, ACK_NOT_REQUIRED ); + + return result; +} + + // *********************************************************************** // **************** Message Handling Helper Functions ******************** // ***********************************************************************