Index: firmware/App/Controllers/DGInterface.c =================================================================== diff -u -r549119eae64732f124d22df66de4fc88c56193c0 -r9a45dcbdfae33fc06479d99b8d52bada8f682194 --- firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 549119eae64732f124d22df66de4fc88c56193c0) +++ firmware/App/Controllers/DGInterface.c (.../DGInterface.c) (revision 9a45dcbdfae33fc06479d99b8d52bada8f682194) @@ -118,6 +118,7 @@ static DG_DISINFECT_UI_STATES_T disinfectsStatus; ///< DG disinfects status. +static DG_MIXING_RATIOS_T dgMixingRatios; ///< DG mixing ratios. // TOD remove // TODO New variables for the reservoir management @@ -328,7 +329,7 @@ { fillToVolume = FILL_RESERVOIR_TO_VOLUME_LOW_FLOW_ML; } - cmdStartDGFill( fillToVolume ); + cmdStartDGFill( fillToVolume, DEFAULT_TARGET_FILL_FLOW_RATE_LPM ); } } else @@ -627,7 +628,7 @@ * @brief * The getDGDisinfectsStates function returns the DG disinfects readings. * @details Inputs: none - * @details Outputs: disinfectsStatus + * @details Outputs: none * @return the current DG disinfects readings *************************************************************************/ DG_DISINFECT_UI_STATES_T getDGDisinfectsStates( void ) @@ -637,6 +638,19 @@ /*********************************************************************//** * @brief + * The getDGMixingRatios function returns the DG mixing ratios and the fill + * prep time. + * @details Inputs: none + * @details Outputs: none + * @return getDGMixingRatios which is the DG mixing ratios + *************************************************************************/ +DG_MIXING_RATIOS_T getDGMixingRatios( void ) +{ + return dgMixingRatios; +} + +/*********************************************************************//** + * @brief * The getReservoirWeight function gets the load cell weight of a given reservoir. * @details Inputs: loadCellWeightInGrams[] * @details Outputs: none @@ -800,6 +814,20 @@ memcpy( &disinfectsStatus, &states, sizeof(DG_DISINFECT_UI_STATES_T) ); } +/*********************************************************************//** + * @brief + * The setDGMixingRatios function sets the mixing ratios as well as the fill + * prep time upon a request from DG. + * @details Inputs: none + * @details Outputs: dgMixingRatios + * @param ratios the mixing ratios from DG + * @return none + *************************************************************************/ +void setDGMixingRatios( DG_MIXING_RATIOS_T ratios ) +{ + memcpy( &dgMixingRatios, &ratios, sizeof(DG_MIXING_RATIOS_T) ); +} + /*********************************************************************//** * @brief * The cmdSetDGDialysateTargetTemps function sends a target dialysate @@ -931,15 +959,16 @@ * The cmdStartDGFill function sends a fill command message to the DG. * @details Inputs: none * @details Outputs: fill command sent to DG. - * @param fillToVolMl volume (in mL) to fill inactive reservoir to + * @param fillToVolMl volume (in mL) to fill inactive reservoir to + * @param targetFlowLPM target flow rate in L/min * @return none *************************************************************************/ -void cmdStartDGFill( U32 fillToVolMl ) +void cmdStartDGFill( U32 fillToVolMl, F32 targetFlowLPM ) { dgCmdResp[ DG_CMD_START_FILL ].commandID = DG_CMD_NONE; dgReservoirFillVolumeTargetSet = fillToVolMl; - sendDGFillCommand( DG_CMD_START, fillToVolMl ); + sendDGFillCommand( DG_CMD_START, fillToVolMl, targetFlowLPM ); } /*********************************************************************//** @@ -954,7 +983,7 @@ dgCmdResp[ DG_CMD_STOP_FILL ].commandID = DG_CMD_NONE; dgReservoirFillVolumeTargetSet = 0; - sendDGFillCommand( DG_CMD_STOP, 0 ); + sendDGFillCommand( DG_CMD_STOP, 0, 0 ); } /*********************************************************************//** @@ -1085,12 +1114,25 @@ { BOOL start = FALSE; dgCmdResp[ DG_CMD_STOP_CHEM_DISINFECT ].commandID = DG_CMD_NONE; - sendDGStartChemicalDisinfectModeCommand( start ); } /*********************************************************************//** * @brief + * The cmdRequestDGConcentrateRatios function sends a request to DG to receive + * the concentrate ratios. + * @details Inputs: none + * @details Outputs: none + * @return none + *************************************************************************/ +void cmdRequestDGMixingRatios( void ) +{ + dgCmdResp[ DG_CMD_REQUEST_CONC_MIXING_RATIOS ].commandID = DG_CMD_NONE; + sendDGConcentrateMixingRatiosRequest(); +} + +/*********************************************************************//** + * @brief * The handleDGCommandResponse function processes the latest DG command response. * @details Inputs: none * @details Outputs: process command response from DG