Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r61fc45d7a43557312d6abd00a6b01e6823b44f04 -r2b6abbe347b2da260a4d46aca233bbfb6a59bf04 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 61fc45d7a43557312d6abd00a6b01e6823b44f04) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2b6abbe347b2da260a4d46aca233bbfb6a59bf04) @@ -3759,4 +3759,218 @@ return result; } +/*********************************************************************//** + * @brief + * The handleResendAllAlarmsCommand function handles a request to re-send + * all active DG alarms. + * The sendUIServiceModeResponse function sends out the DG response to a + * UI request to go to service mode. + * @details Inputs: none + * @details Outputs: Service mode request response msg constructed and queued + * @param accepted TRUE if request was accepted, FALSE if not + * @param rejCode Reject reason code explaining why request was rejected + * @return none + *************************************************************************/ +void handleResendAllAlarmsCommand( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + handleResendActiveAlarmsRequest(); + result = TRUE; + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleCpldStatusRequest function handles a CPLD Status request message. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleCpldStatusRequest( MESSAGE_T *message ) +{ + MESSAGE_T msg; + CPLD_STATUS_T payload; + U08 *payloadPtr = msg.payload; + + // populate payload + getCPLDStatus( &payload ); + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_CPLD_STATUS; + msg.hdr.payloadLen = sizeof( CPLD_STATUS_T ); + + // fill message payload + memcpy( payloadPtr, &payload, sizeof( CPLD_STATUS_T ) ); + + // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_BROADCAST, ACK_NOT_REQUIRED ); +} + +/*********************************************************************//** + * @brief + * The handleTestDrainPumpMeasuredCurrentOverride function handles a request + * to override the drain pump measured current + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestDrainPumpMeasuredCurrentOverride( 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 = testSetDrainPumpMeasuredCurrentOverride( payload.state.f32 ); + } + else + { + result = testResetDrainPumpMeasuredCurrentOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestGenIdlePublishIntervalOverride function handles a request + * to override the gen idle state publish interval + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestGenIdlePublishIntervalOverride( 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 = testSetGenIdleSubstatesPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetGenIdleSubstatesPublishIntervalOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestDGROPumpFeedbackVoltageOverrideRequest function handles a request + * to override the gen idle state publish interval + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestDGROPumpFeedbackVoltageOverrideRequest( 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 = testSetROPumpMeasuredFeedbackVoltageOverride( payload.state.f32 ); + } + else + { + result = testResetROPumpMeasuredFeedbackVoltageOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestDGFillModeBroadcastOverrideRequest function handles a request + * to override the gen idle state publish interval + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestDGFillModeBroadcastOverrideRequest( 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 = testSetFillModeDataPublishIntervalOverride( payload.state.u32 ); + } + else + { + result = testResetFillModeDataPublishIntervalOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} +/*********************************************************************//** + * @brief + * The handleTestDGFillIntegratedVolumeOverrideRequest function handles a request + * to override the gen idle state publish interval + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestDGFillIntegratedVolumeOverrideRequest( 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 = testSetIntegratedVolumeOverride( payload.state.u32 ); + } + else + { + result = testResetIntegratedVolumeOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + /**@}*/