Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r44a100f8e5210a02c23b8fcc4527d8e96d577381 -rab57180655892575252175a4310d97a1c8c46e74 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 44a100f8e5210a02c23b8fcc4527d8e96d577381) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision ab57180655892575252175a4310d97a1c8c46e74) @@ -104,6 +104,7 @@ static U32 dgReservoirDrainVolumeTargetSet = 0; ///< Drain-to volume commanded. static U32 resUseTimer = 0; ///< Used to track time pumping from active reservoir (for volume used calculation). static F32 resUseVolumeMl = 0.0; ///< Accumulated volume used from active reservoir. +static DG_DISINFECT_UI_STATES_T disinfectsStatus; ///< DG disinfects status. // DG command response static DG_CMD_RESPONSE_T dgCmdResp[ NUM_OF_DG_COMMANDS ]; ///< Keep the latest DG command response for each command. @@ -542,6 +543,17 @@ /*********************************************************************//** * @brief + * The getDGDisinfectsStates function returns the DG disinfects readings. + * @details Inputs: none + * @details Outputs: disinfectsStatus + * @return the current DG disinfects readings + *************************************************************************/ +DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) +{ + return disinfectsStatus; +} + +/*********************************************************************//** * The getReservoirWeight function gets the load cell weight of a given * reservoir. * @details Inputs: loadCellWeightInGrams[] @@ -724,6 +736,20 @@ updateReservoirVolumes( res1Primary, res2Primary ); } +/*********************************************************************//** + * @brief + * The setDGDisinfectsStates function sets the latest disinfects states + * from DG. + * @details Inputs: none + * @details Outputs: disinfectsStatus + * @param states latest DG disinfects state readings + * @return none + *************************************************************************/ +void setDGDisinfectsStates( DG_DISINFECT_UI_STATES_T states ) +{ + memcpy( &disinfectsStatus, &states, sizeof(DG_DISINFECT_UI_STATES_T) ); +} + /*********************************************************************//** * @brief * The cmdSetDGDialysateTargetTemps function sends a target dialysate @@ -903,10 +929,100 @@ void cmdDGSampleWater( SAMPLE_WATER_CMD_T cmd ) { sendDGSampleWaterCommand( cmd ); +} + +/*********************************************************************//** + * @brief + * The cmdStartDGFlush function sends a start flush command message to + * the DG. + * @details Inputs: none + * @details Outputs: start flush mode command sent to DG. + * @return none + *************************************************************************/ +void cmdStartDGFlush( void ) +{ + BOOL start = TRUE; + dgCmdResp[ DG_CMD_START_FLUSH ].commandID = DG_CMD_NONE; + sendDGStartFlushModeCommand( start ); +} + +/*********************************************************************//** + * @brief + * The cmdStopDGFlush function sends a stop flush command message to + * the DG. + * @details Inputs: none + * @details Outputs: stop flush mode command sent to DG. + * @return none + *************************************************************************/ +void cmdStopDGFlush( void ) +{ + BOOL start = FALSE; + dgCmdResp[ DG_CMD_STOP_FLUSH ].commandID = DG_CMD_NONE; + sendDGStartFlushModeCommand( start ); +} + +/*********************************************************************//** + * @brief + * The cmdStartDGHeatDisinfect function sends a start heat disinfect + * command message to the DG. + * @details Inputs: none + * @details Outputs: start heat disinfect mode command sent to DG. + * @return none + *************************************************************************/ +void cmdStartDGHeatDisinfect( void ) +{ + BOOL start = TRUE; + dgCmdResp[ DG_CMD_START_HEAT_DISINFECT ].commandID = DG_CMD_NONE; + sendDGStartHeatDisinfectModeCommand( start ); +} + +/*********************************************************************//** + * @brief + * The cmdStopDGHeatDisinfect function sends a stop heat disinfect + * command message to the DG. + * @details Inputs: none + * @details Outputs: stop heat disinfect mode command sent to DG. + * @return none + *************************************************************************/ +void cmdStopDGHeatDisinfect( void ) +{ + BOOL start = FALSE; + dgCmdResp[ DG_CMD_STOP_HEAT_DISINFECT ].commandID = DG_CMD_NONE; + sendDGStartHeatDisinfectModeCommand( start ); +} + +/*********************************************************************//** + * @brief + * The cmdStartDGChemicalDisinfect function sends a start chemical disinfect + * command message to the DG. + * @details Inputs: none + * @details Outputs: start chemical disinfect mode command sent to DG. + * @return none + *************************************************************************/ +void cmdStartDGChemicalDisinfect( void ) +{ + BOOL start = TRUE; + dgCmdResp[ DG_CMD_START_CHEM_DISINFECT ].commandID = DG_CMD_NONE; + sendDGStartChemicalDisinfectModeCommand( start ); } /*********************************************************************//** * @brief + * The cmdStopDGChemicalDisinfect function sends a stop chemical disinfect + * command message to the DG. + * @details Inputs: none + * @details Outputs: stop chemical disinfect mode command sent to DG. + * @return none + *************************************************************************/ +void cmdStopDGChemicalDisinfect( void ) +{ + BOOL start = FALSE; + dgCmdResp[ DG_CMD_STOP_CHEM_DISINFECT ].commandID = DG_CMD_NONE; + sendDGStartChemicalDisinfectModeCommand( start ); +} + +/*********************************************************************//** + * @brief * The handleDGCommandResponse function processes the latest DG command response. * @details Inputs: none * @details Outputs: process command response from DG