Index: firmware/App/Services/DDInterface.c =================================================================== diff -u -r9c833ef5623ce842267e284d958820ac0dc3a7fc -rfff7eb3560421130e0cd4788f84bce0a8ee7ff44 --- firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision 9c833ef5623ce842267e284d958820ac0dc3a7fc) +++ firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision fff7eb3560421130e0cd4788f84bce0a8ee7ff44) @@ -382,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 qsub Hemodiafiltration rate (QSub) (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. @@ -390,7 +391,7 @@ * @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 qsub, F32 dialTemp, BOOL bypass, F32 acidConvFactor, F32 bicarbConvFactor, U32 sodium, U32 bicarbonate ) { dialysateDeliveryCmdSet.start = TRUE; dialysateDeliveryCmdSet.dialRate = qd; @@ -401,7 +402,7 @@ dialysateDeliveryCmdSet.bicarbConvFactor = bicarbConvFactor; dialysateDeliveryCmdSet.sodium = sodium; dialysateDeliveryCmdSet.bicarbonate = bicarbonate; - dialysateDeliveryCmdSet.substitutionRate = 0.0F; + dialysateDeliveryCmdSet.substitutionRate = qsub; #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 ) ); @@ -461,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.substitutionRate = 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 @@ -625,7 +651,19 @@ } } +/*********************************************************************//** + * @brief + * The getTDUFRate function gets the last set UF rate. + * @details \b Inputs: dialysateDeliveryCmdSet.ufRate + * @details \b Outputs: none + * @return Latest uf rate. + *************************************************************************/ +F32 getTDUFRate( void ) +{ + return dialysateDeliveryCmdSet.ufRate; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/