Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rf9faa852e6768e386171a1ca3b8337f88cdc3e82 -r136fcc50a87793eeb55b20031f3d12b24fa16d81 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision f9faa852e6768e386171a1ca3b8337f88cdc3e82) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 136fcc50a87793eeb55b20031f3d12b24fa16d81) @@ -34,7 +34,8 @@ #include "SystemComm.h" #include "SystemCommMessages.h" #include "Utilities.h" -#include "Valves.h" +#include "Valves.h" +#include "FluidLeak.h" #include "WatchdogMgmt.h" /** @@ -1262,10 +1263,38 @@ /***********************************************************************//** * @brief - * The broadcastAirTrapData function constructs an HD air trap data msg to \n + * The broadcastFluidLeakState function constructs an HD air trap data msg to \n + * be broadcasted and queues the msg for transmit on the appropriate CAN channel. + * @details Inputs: none + * @details Outputs: fluid leak state msg constructed and queued + * @param state fluid leak state + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL broadcastFluidLeakState( FLUID_LEAK_STATES_T state ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_AIR_TRAP_DATA; + msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ); + + memcpy( payloadPtr, &state, 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; +} + +/***********************************************************************//** + * @brief + * The broadcastPrimeData function constructs a prime data msg to \n * be broadcast and queues the msg for transmit on the appropriate CAN channel. * @details Inputs: none - * @details Outputs: air trap data msg constructed and queued + * @details Outputs: prime data msg constructed and queued * @param primeDataPtr prime data record pointer * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/