Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r624189b5decdbbc57f7d76b76c9d37ecba8ad93f -rcaa15db89a49c98671f0a87dc2242d0fc7f683b7 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 624189b5decdbbc57f7d76b76c9d37ecba8ad93f) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision caa15db89a49c98671f0a87dc2242d0fc7f683b7) @@ -34,15 +34,15 @@ #include "ModeStandby.h" #include "OperationModes.h" #include "PAL.h" -#ifdef __PUMPTEST__ -#include "PistonPumpControl.h" -#endif #include "Pressure.h" #include "SafetyShutdown.h" +#include "SpentChamberFill.h" #include "SystemCommDD.h" #include "Temperature.h" +#include "TestSupport.h" #include "TDInterface.h" #include "Utilities.h" +#include "Ultrafiltration.h" #include "Valves.h" @@ -143,7 +143,7 @@ { MSG_ID_DD_HEATERS_START_STOP_OVERRIDE_REQUEST, &testHeaterStartStopOverride }, { MSG_ID_DD_VALVES_OPEN_CLOSE_STATE_OVERRIDE_REQUEST, &testValveOpenCloseStateOverride }, { MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, &handleDialysateDeliveryRequestMsg }, - { MSD_ID_DD_FP_COMMUNICATION_STATUS_OVERRIDE_REQUEST, &testROCommunicationStatusOverride }, + { MSD_ID_DD_FP_COMMUNICATION_STATUS_OVERRIDE_REQUEST, &testFPCommunicationStatusOverride }, { MSG_ID_DD_BAL_CHAMBER_DATA_PUBLISH_OVERRIDE_REQUEST, &testDDBalChamberDataPublishIntervalOverride }, { MSG_ID_DD_BAL_CHAMBER_SWITCH_FREQ_OVERRIDE_REQUEST, &testBalChamberSwFreqOverride }, { MSG_ID_DD_DIAL_DELIVERY_IN_PROGRESS_OVERRIDE_REQUEST, &testDialDeliveryInProgressOverride }, @@ -161,11 +161,16 @@ { MSG_ID_DD_PRE_GEN_DIALYSATE_REQUEST_DATA, &handlePreGenDialysateRequestMsg }, { MSG_ID_FW_VERSIONS_REQUEST, &handleVersionRequestMessage }, { MSG_ID_DD_SAFETY_SHUTDOWN_OVERRIDE_REQUEST, &testSetResetSafetyShutdownOverride }, + { MSG_ID_DD_UF_DATA_PUBLISH_OVERRIDE_REQUEST, &testDDUFDataPublishIntervalOverride }, + { MSG_ID_DD_SPENT_CHAMB_FILL_DATA_PUBLISH_OVERRIDE_REQUEST, &testDDSpentChamberFillDataPublishIntervalOverride }, #ifdef __PUMPTEST__ { MSG_ID_DD_PISTON_PUMP_DATA_PUBLISH_OVERRIDE_REQUEST, &testDDPistonPumpControlDataPublishIntervalOverride }, { MSG_ID_DD_PISTON_PUMP_START_STOP_OVERRIDE_REQUEST, &testDDPistonPumpStartStopOverride }, { MSG_ID_DD_PISTON_PUMP_FILL_AFTER_DISPENSE_OVERRIDE_REQUEST, &testDDPistonPumpFillAfterDispenseOverride }, #endif + { MSG_ID_DD_SET_TEST_CONFIGURATION, &testSetTestConfiguration }, + { MSG_ID_DD_GET_TEST_CONFIGURATION, &testGetTestConfiguration }, + { MSG_ID_DD_RESET_ALL_TEST_CONFIGURATIONS, &testResetAllTestConfigurations }, }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLER_LOOKUP) / sizeof(MSG_HANDLER_LOOKUP_T)) @@ -714,9 +719,90 @@ setSystemREG1_SYSECR( (0x2) << 14 ); // Reset processor } - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); + 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; +} + /**@}*/