Index: firmware/App/Services/DDInterface.c =================================================================== diff -u -rda59fa4a98dbc11c37677e92a66aa940d251678f -r1e0e209cd649584ea88b450b36558b2de63c60e2 --- firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision da59fa4a98dbc11c37677e92a66aa940d251678f) +++ firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision 1e0e209cd649584ea88b450b36558b2de63c60e2) @@ -114,6 +114,7 @@ dialysateDeliveryCmdSet.start = FALSE; dialysateDeliveryCmdSet.dialRate = 0.0F; dialysateDeliveryCmdSet.ufRate = 0.0F; + dialysateDeliveryCmdSet.hdfRate = 0.0F; dialysateDeliveryCmdSet.dialTemp = 0.0F; dialysateDeliveryCmdSet.bypassDialyzer = TRUE; dialysateDeliveryCmdSet.acidConvFactor = 0.0F; @@ -381,6 +382,7 @@ * @details \b Message \b Sent: Start/continue generate dialysate command. * @param qd Target dialysate flow rate (Qd). * @param quf Target ultrafiltration rate (Quf) (in mL/min). + * @param qhdf Hemodiafiltration rate (Qhdf) (in mL/min). * @param dialTemp Target dialysate temperature in deg C. * @param bypass Flag indicating whether dialyzer should be bypassed. * @param acidConvFactor Conversion factor for the acid used. @@ -389,11 +391,12 @@ * @param bicarbonate Level of bicarbonate used in mEq/L. * @return none *************************************************************************/ -void cmdStartGenerateDialysate( F32 qd, F32 quf, F32 dialTemp, BOOL bypass, F32 acidConvFactor, F32 bicarbConvFactor, U32 sodium, U32 bicarbonate ) +void cmdStartGenerateDialysate( F32 qd, F32 quf, F32 qhdf, F32 dialTemp, BOOL bypass, F32 acidConvFactor, F32 bicarbConvFactor, U32 sodium, U32 bicarbonate ) { dialysateDeliveryCmdSet.start = TRUE; dialysateDeliveryCmdSet.dialRate = qd; dialysateDeliveryCmdSet.ufRate = quf; + dialysateDeliveryCmdSet.hdfRate = qhdf; dialysateDeliveryCmdSet.dialTemp = dialTemp; dialysateDeliveryCmdSet.bypassDialyzer = bypass; dialysateDeliveryCmdSet.acidConvFactor = acidConvFactor; @@ -459,6 +462,31 @@ /*********************************************************************//** * @brief + * The cmdChangeQhdf function sends a generate dialysate command to the DD + * with a given new hemodiafiltration rate. + * @details \b Inputs: none + * @details \b Outputs: dialysateDeliveryCmdSet + * @details \b Message \b Sent: Continue generate dialysate command w/ new Quf. + * @param qhdf, hemodiafiltration flow rate (in mL/min). + * @return none + *************************************************************************/ +void cmdChangeQhdf( F32 qhdf ) +{ + if ( TRUE == dialysateDeliveryCmdSet.start ) + { + dialysateDeliveryCmdSet.hdfRate = qhdf; +#ifndef TEST_UI_ONLY + sendMessage( MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&dialysateDeliveryCmdSet), sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); +#endif + } + else + { + // TODO - s/w fault? + } +} + +/*********************************************************************//** + * @brief * The cmdBypassDialyzer function sends a generate dialysate command to the DD * with a given flag indicating whether dialyzer should be bypassed. * @details \b Inputs: none