Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r9cbb00a9eba347697bdf5cee63962061ffa36c92 -r052b4a3feca797601f3d794195d8189cdc91aac6 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 9cbb00a9eba347697bdf5cee63962061ffa36c92) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 052b4a3feca797601f3d794195d8189cdc91aac6) @@ -114,8 +114,9 @@ { MSG_ID_FP_SAFETY_SHUTDOWN_OVERRIDE_REQUEST, &testSetResetSafetyShutdownOverride }, { MSG_ID_FP_ALARM_STATE_OVERRIDE_REQUEST, &testAlarmStateOverride }, { MSG_ID_FP_ALARM_CLEAR_ALL_ALARMS_REQUEST, &testClearAllAlarms }, - - +{ MSG_ID_FP_SET_TEST_CONFIGURATION, &testSetTestConfiguration }, +{ MSG_ID_FP_GET_TEST_CONFIGURATION, &testGetTestConfiguration }, +{ MSG_ID_FP_RESET_ALL_TEST_CONFIGURATIONS, &testResetAllTestConfigurations }, }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLER_LOOKUP) / sizeof(MSG_HANDLER_LOOKUP_T)) @@ -702,4 +703,87 @@ return result; } +/*********************************************************************//** + * @brief + * The testSetTestConfiguration function handles a request to set a + * test configuration. + * @details \b Inputs: none + * @details \b Outputs: message handled + * @param message a pointer to the message to handle + * @return TRUE if command accepted, FALSE if rejected + *************************************************************************/ +BOOL testSetTestConfiguration( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // Verify payload length + if ( sizeof( TEST_CONFIG_PAYLOAD_T ) == message->hdr.payloadLen ) + { + TEST_CONFIG_PAYLOAD_T payload; + + // copy message payload to local variable + memcpy( (U08*)&payload, &message->payload[0], sizeof( TEST_CONFIG_PAYLOAD_T ) ); + + // Verify given test configuration is valid + if ( payload.config < NUM_OF_TEST_CONFIGS ) + { + result = TRUE; + if ( FALSE == payload.reset ) + { + setTestConfig( (TEST_CONFIG_T)payload.config ); + } + else + { + resetTestConfig( (TEST_CONFIG_T)payload.config ); + } + } + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testGetTestConfiguration function handles a request to get a + * test configuration. + * @details \b Inputs: none + * @details \b Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +BOOL testGetTestConfiguration( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = sendTestConfigStatusToDialin(); + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testResetTestConfiguration function handles a request to reset all + * test configurations. + * @details \b Inputs: none + * @details \b Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +BOOL testResetAllTestConfigurations( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + result = resetAllTestConfigs(); + } + + return result; +} + /**@}*/ Index: firmware/App/Services/Messaging.h =================================================================== diff -u -r8940f67c485a23e20e14e4dc24e79339f80cc584 -r052b4a3feca797601f3d794195d8189cdc91aac6 --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision 8940f67c485a23e20e14e4dc24e79339f80cc584) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision 052b4a3feca797601f3d794195d8189cdc91aac6) @@ -56,6 +56,10 @@ BOOL handleROSoftwareResetRequest( MESSAGE_T *message ); BOOL handleROTestConfiguration( MESSAGE_T *message ); +BOOL testSetTestConfiguration( MESSAGE_T *message ); +BOOL testGetTestConfiguration( MESSAGE_T *message ); +BOOL testResetAllTestConfigurations( MESSAGE_T *message ); + /**@}*/ #endif