Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r9690fa47c23a2d76f62f385b553db7e565e18a1e -rb8d4f0f17b9069862ef77f0a967b0fe6a7ac7d52 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9690fa47c23a2d76f62f385b553db7e565e18a1e) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision b8d4f0f17b9069862ef77f0a967b0fe6a7ac7d52) @@ -1405,26 +1405,26 @@ /***********************************************************************//** * @brief - * The broadcastFluidLeakState function constructs an HD fluid leak state msg to \n + * The broadcastBloodLeakStatus function constructs an HD blood leak status 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 + * @details Outputs: blood leak status msg constructed and queued + * @param status blood leak status * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL broadcastFluidLeakState( FLUID_LEAK_STATES_T state ) +BOOL broadcastBloodLeakStatus( BLOOD_LEAK_STATUS_T status ) { BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; - U32 leakState = (U32)state; + U32 leakStatus = (U32)status; // Create a message record blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_HD_FLUID_LEAK_STATE; + msg.hdr.msgID = MSG_ID_HD_BLOOD_LEAK_STATUS; msg.hdr.payloadLen = sizeof( U32 ); - memcpy( payloadPtr, &leakState, sizeof( U32 ) ); + memcpy( payloadPtr, &leakStatus, 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 ); @@ -1434,26 +1434,26 @@ /***********************************************************************//** * @brief - * The broadcastBloodLeakStatus function constructs an HD blood leak state msg to \n + * The broadcastBloodLeakState function constructs an HD blood leak state msg to \n * be broadcasted and queues the msg for transmit on the appropriate CAN channel. * @details Inputs: none * @details Outputs: blood leak state msg constructed and queued * @param state blood leak state * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL broadcastBloodLeakStatus( BLOOD_LEAK_STATES_T status ) +BOOL broadcastBloodLeakState( BLOOD_LEAK_STATE_T state ) { BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; - U32 leakStatus = (U32)status; + U32 leakState = (U32)state; // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_HD_BLOOD_LEAK_STATE; msg.hdr.payloadLen = sizeof( U32 ); - memcpy( payloadPtr, &leakStatus, sizeof( U32 ) ); + memcpy( payloadPtr, &leakState, 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 ); @@ -4260,14 +4260,14 @@ /*********************************************************************//** * @brief - * The handleSetBloodLeakBroadcastIntervalOverrideRequest function handles a - * request to override the blood leak state broadcast interval. + * The handleSetBloodLeakStatusBroadcastIntervalOverrideRequest function handles a + * request to override the blood leak status broadcast interval. * @details Inputs: none * @details Outputs: message handled * @param message : a pointer to the message to handle * @return none *************************************************************************/ -void handleSetBloodLeakBroadcastIntervalOverrideRequest( MESSAGE_T *message ) +void handleSetBloodLeakStatusBroadcastIntervalOverrideRequest( MESSAGE_T *message ) { TEST_OVERRIDE_PAYLOAD_T payload; BOOL result = FALSE; @@ -4310,7 +4310,7 @@ memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_ARRAY_PAYLOAD_T ) ); if ( FALSE == payload.reset ) { - result = testSetBloodLeakStatusOverride( ( BLOOD_LEAK_STATES_T)( payload.state.u32 ) ); + result = testSetBloodLeakStatusOverride( ( BLOOD_LEAK_STATUS_T)( payload.state.u32 ) ); } else { @@ -4324,6 +4324,70 @@ /*********************************************************************//** * @brief + * The handleSetBloodLeakStateBroadcastIntervalOverrideRequest function handles a + * request to override the blood leak state broadcast interval. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleSetBloodLeakStateBroadcastIntervalOverrideRequest( MESSAGE_T *message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // Verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetBloodLeakStatePublishIntervalOverride( (U32)( payload.state.u32 ) ); + } + else + { + result = testResetBloodLeakStatePublishIntervalOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleSetBloodLeakStateDetectorOverrideRequest function handles a request to + * override the blood leak detector state. + * @details Inputs: none + * @details Outputs: message handled + * @param message : a pointer to the message to handle + * @return none + *************************************************************************/ +void handleSetBloodLeakStateDetectorOverrideRequest( MESSAGE_T *message ) +{ + TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; + BOOL result = FALSE; + + // Verify payload length + if ( sizeof( TEST_OVERRIDE_ARRAY_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_ARRAY_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetBloodLeakStateOverride( ( BLOOD_LEAK_STATE_T)( payload.state.u32 ) ); + } + else + { + result = testResetBloodLeakStateOverride(); + } + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief * The handleHDSoftwareResetRequest function handles a request to reset the * HD firmware processor. * @details Inputs: none