Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -rae4a44c74291d5891ef2a7f45320158e73fecbbc -rc06a32218bad65414ccda5d41293e5349e46d241 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision ae4a44c74291d5891ef2a7f45320158e73fecbbc) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision c06a32218bad65414ccda5d41293e5349e46d241) @@ -468,7 +468,7 @@ { bloodPumpRotorCounter.data = 0; - if ( TRUE == getTestConfigStatus( TEST_CONFIG_USE_WORN_CARTRIDGE ) ) +// if ( TRUE == getTestConfigStatus( TEST_CONFIG_USE_WORN_CARTRIDGE ) ) { bloodPumpRotorCounter.data = BP_MAX_ROTOR_COUNT_FOR_WEAR; } Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r4a65377085c075e15056b4157e17e7ed0ec15301 -rc06a32218bad65414ccda5d41293e5349e46d241 --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 4a65377085c075e15056b4157e17e7ed0ec15301) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision c06a32218bad65414ccda5d41293e5349e46d241) @@ -967,7 +967,7 @@ { U32 treatmentTime = MIN_TREATMENT_TIME_MINUTES; - if ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_ONE_MINUTE_TREATMENT ) ) +// if ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_ONE_MINUTE_TREATMENT ) ) { treatmentTime = 1; } Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -ra5560a2917aa62bcafd8e6a81041ace723237109 -rc06a32218bad65414ccda5d41293e5349e46d241 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision a5560a2917aa62bcafd8e6a81041ace723237109) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision c06a32218bad65414ccda5d41293e5349e46d241) @@ -150,7 +150,7 @@ #ifndef TEST_UI_ONLY // Verify mode transition is legal unless tester working with system TODO - restore check when all modes are implemented - if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) +// if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) { newMode = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; } Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r9a8e1fc597eb4f681527e691fb6cb24e550d8b92 -rc06a32218bad65414ccda5d41293e5349e46d241 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 9a8e1fc597eb4f681527e691fb6cb24e550d8b92) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision c06a32218bad65414ccda5d41293e5349e46d241) @@ -164,7 +164,10 @@ { MSG_ID_TD_HOME_BLOOD_PUMP, &testHomeBloodPump }, { MSG_ID_TD_BLOOD_FLOW_ALPHA_Y_INTERCEPT_OVERRIDE_REQUEST, &testBPFlowAlphaYInterceptOverride }, { MSG_ID_TD_BLOOD_FLOW_WEAR_A_TERM_OVERRIDE_REQUEST, &testBPFlowWearATermOverride }, - { MSG_ID_TD_BLOOD_FLOW_WEAR_B_TERM_OVERRIDE_REQUEST, &testBPFlowWearBTermOverride } + { MSG_ID_TD_BLOOD_FLOW_WEAR_B_TERM_OVERRIDE_REQUEST, &testBPFlowWearBTermOverride }, + { MSG_ID_TD_SET_TEST_CONFIGURATION, &testSetTestConfiguration }, + { MSG_ID_TD_GET_TEST_CONFIGURATION, &testGetTestConfiguration }, + { MSG_ID_TD_RESET_ALL_TEST_CONFIGURATIONS, &testResetAllTestConfigurations } }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLER_LOOKUP) / sizeof(MSG_HANDLER_LOOKUP_T)) @@ -670,4 +673,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 -r0e4a62ba24d906d9e5b33b293f93405b8c0391ce -rc06a32218bad65414ccda5d41293e5349e46d241 --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision 0e4a62ba24d906d9e5b33b293f93405b8c0391ce) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision c06a32218bad65414ccda5d41293e5349e46d241) @@ -165,6 +165,10 @@ BOOL sendEvent( TD_EVENT_ID_T event, EVENT_DATA_T dat1, EVENT_DATA_T dat2 ); BOOL sendOffButtonMsgToUI( U08 prompt ); +BOOL testSetTestConfiguration( MESSAGE_T *message ); +BOOL testGetTestConfiguration( MESSAGE_T *message ); +BOOL testResetAllTestConfigurations( MESSAGE_T *message ); + /**@}*/ #endif