Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -re0fc678329b0cb25dd76fa5e23cc1f487851f0ec -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision e0fc678329b0cb25dd76fa5e23cc1f487851f0ec) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -1319,7 +1319,7 @@ { BOOL result = FALSE; - // Verify tester has logged in with TD + // Verify tester has logged in with DD if ( TRUE == isTestingActivated() ) { // Verify payload length is valid Index: firmware/App/Controllers/DialysatePumps.c =================================================================== diff -u -re0fc678329b0cb25dd76fa5e23cc1f487851f0ec -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Controllers/DialysatePumps.c (.../DialysatePumps.c) (revision e0fc678329b0cb25dd76fa5e23cc1f487851f0ec) +++ firmware/App/Controllers/DialysatePumps.c (.../DialysatePumps.c) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -1145,7 +1145,7 @@ { BOOL result = FALSE; - // Verify tester has logged in with TD + // Verify tester has logged in with DD if ( TRUE == isTestingActivated() ) { // Verify payload length is valid Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r322747d530c1b8205be257557e53dcfe9caad50a -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 322747d530c1b8205be257557e53dcfe9caad50a) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -737,7 +737,7 @@ { BOOL result = FALSE; - // Verify tester has logged in with TD + // Verify tester has logged in with DD if ( TRUE == isTestingActivated() ) { // Verify payload length is valid Index: firmware/App/Controllers/PistonPumpControl.c =================================================================== diff -u -r6bbe6e35f9c378ad8dd5be2edebb1cc1acd23d37 -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Controllers/PistonPumpControl.c (.../PistonPumpControl.c) (revision 6bbe6e35f9c378ad8dd5be2edebb1cc1acd23d37) +++ firmware/App/Controllers/PistonPumpControl.c (.../PistonPumpControl.c) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -553,7 +553,7 @@ { BOOL result = FALSE; - // Verify tester has logged in with TD + // Verify tester has logged in with DD if ( TRUE == isTestingActivated() ) { // Verify payload length is valid Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -re0fc678329b0cb25dd76fa5e23cc1f487851f0ec -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision e0fc678329b0cb25dd76fa5e23cc1f487851f0ec) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -575,7 +575,7 @@ { BOOL result = FALSE; - // Verify tester has logged in with TD + // Verify tester has logged in with DD if ( TRUE == isTestingActivated() ) { // Verify payload length is valid Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -r75ecd5ee8a56b8d9faef07cdeb0a8dc7975ff476 -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 75ecd5ee8a56b8d9faef07cdeb0a8dc7975ff476) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -22,6 +22,7 @@ #include "FpgaDD.h" #include "Heaters.h" #include "Level.h" +#include "Messaging.h" #include "ModeGenDialysate.h" #include "ModeStandby.h" #include "OperationModes.h" @@ -51,6 +52,12 @@ #define HYD_CHAMBER_TARGET_NEG_PRESS_MAX_PSI (-12.075F) ///< Hydraulics chamber maximum negative pressure(D9/PHo) in psi. #define GEN_DIALYSATE_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the gen dialysate mode data published. +/// Payload record structure for Gen dialysate execution state set request +typedef struct +{ + U32 execStateSet; ///< Gen dialysate execution state machine set request +} GEND_EXEC_STATE_SET_CMD_PAYLOAD_T; + // ********** private data ********** static DD_GEND_MODE_STATE_T genDialysateState = DD_GEND_STATE_START; ///< Currently active gen dialysate state. @@ -618,6 +625,19 @@ /*********************************************************************//** * @brief + * The setCurrentGenDialysateState function sets the current state of the + * gen dialysate mode. + * @details \b Inputs: genDialysateState + * @details \b Outputs: genDialysateState + * @return the current state of gen dialysate mode + *************************************************************************/ +void setCurrentGenDialysateState( DD_GEND_MODE_STATE_T state ) +{ + genDialysateState = state; +} + +/*********************************************************************//** + * @brief * The setTreatmentParamUpdate function sets the flag to indicate one or more * treatement parameters updated. * gen dialysate mode. @@ -819,4 +839,42 @@ return result; } +/*********************************************************************//** + * @brief + * The testGenDExecStateOverride function sets the Gen dialysate execution state + * machine to given state. + * @details \b Inputs: tester logged in, execStateSet + * @details \b Outputs: genDialysateState + * @param message set message from Dialin which includes the generate dialysate + * execution state to be set. + * @return TRUE if set request is successful, FALSE if not + *************************************************************************/ +BOOL testGenDExecStateOverride( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // Verify tester has logged in with DD + if ( TRUE == isTestingActivated() ) + { + // Verify payload length is valid + if ( sizeof( GEND_EXEC_STATE_SET_CMD_PAYLOAD_T ) == message->hdr.payloadLen ) + { + GEND_EXEC_STATE_SET_CMD_PAYLOAD_T payload; + + memcpy( &payload, message->payload, sizeof(GEND_EXEC_STATE_SET_CMD_PAYLOAD_T) ); + + // Validate the state to be set + if ( payload.execStateSet < NUM_OF_DD_GEND_MODE_STATES ) + { + //set the GenD exec state machine + setCurrentGenDialysateState( (DD_GEND_MODE_STATE_T)payload.execStateSet); + + result = TRUE; + } + } + } + + return result; +} + /**@}*/ Index: firmware/App/Modes/ModeGenDialysate.h =================================================================== diff -u -r322747d530c1b8205be257557e53dcfe9caad50a -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Modes/ModeGenDialysate.h (.../ModeGenDialysate.h) (revision 322747d530c1b8205be257557e53dcfe9caad50a) +++ firmware/App/Modes/ModeGenDialysate.h (.../ModeGenDialysate.h) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -61,6 +61,7 @@ BOOL testDialDeliveryInProgressOverride( MESSAGE_T *message ); // To override the dialysate delivery in progress flag BOOL testDialGoodToDeliverStatusOverride( MESSAGE_T *message ); // To override the dialysate good to deliver status flag BOOL testGenDHydChamberFluidTempOverride( MESSAGE_T *message ); // Override the hydraulics chamber fluid temperature +BOOL testGenDExecStateOverride( MESSAGE_T *message ); // Override the Gen dialysate execution state /**@}*/ Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r6bbe6e35f9c378ad8dd5be2edebb1cc1acd23d37 -r5e92cbb2c29854fb60a91dc4abafeb9b08d3272c --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 6bbe6e35f9c378ad8dd5be2edebb1cc1acd23d37) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 5e92cbb2c29854fb60a91dc4abafeb9b08d3272c) @@ -145,6 +145,7 @@ MSG_ID_DD_HYD_CHAMBER_TARGET_TEMP_OVERRIDE_REQUEST, MSG_ID_DD_ACID_DOSING_VOLUME_OVERRIDE_REQUEST, MSG_ID_DD_BICARB_DOSING_VOLUME_OVERRIDE_REQUEST, //60 + MSG_ID_DD_GEND_EXEC_STATE_OVERRIDE_REQUEST, #ifdef __PUMPTEST__ MSG_ID_DD_PISTON_PUMP_DATA_PUBLISH_OVERRIDE_REQUEST, MSG_ID_DD_PISTON_PUMP_START_STOP_OVERRIDE_REQUEST, @@ -214,6 +215,7 @@ &testGenDHydChamberFluidTempOverride, &testAcidDoseVolumeOverride, &testBicarbDoseVolumeOverride, //60 + &testGenDExecStateOverride, #ifdef __PUMPTEST__ &testDDPistonPumpControlDataPublishIntervalOverride, &testDDPistonPumpStartStopOverride,