Index: firmware/App/Services/DDInterface.c =================================================================== diff -u -re9e339870c5ed01230963f00d400331ab879c91f -re7e2fef9fda6c6e876f7aba1c8f837d8aa713392 --- firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision e9e339870c5ed01230963f00d400331ab879c91f) +++ firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision e7e2fef9fda6c6e876f7aba1c8f837d8aa713392) @@ -46,6 +46,7 @@ static BOOL ddOpModeDataFreshFlag; ///< Flag to signal the handleDDOpMode() to process fresh dd op mode data. static BOOL ddDialysatePressureFreshFlag; ///< Flag to signal +static PRE_GEN_DIALYSATE_REQ_PAYLOAD_T preGenDialysateCmdSet; ///< Set of pre-generate dialysate parameters to send to the DD static DIALYSATE_DELIVERY_REQ_PAYLOAD_T dialysateDeliveryCmdSet; ///< Set of dialysate delivery parameters to send to the DD during treatment. // DD command response @@ -100,6 +101,14 @@ ddStarted = FALSE; ddStartCommandSent = FALSE; + preGenDialysateCmdSet.start = FALSE; + preGenDialysateCmdSet.dialRate = 0.0F; + preGenDialysateCmdSet.dialTemp = 0.0F; + preGenDialysateCmdSet.acidConvFactor = 0.0F; + preGenDialysateCmdSet.bicarbConvFactor = 0.0F; + preGenDialysateCmdSet.sodium = 0; + preGenDialysateCmdSet.bicarbonate = 0; + dialysateDeliveryCmdSet.start = FALSE; dialysateDeliveryCmdSet.dialRate = 0.0F; dialysateDeliveryCmdSet.ufRate = 0.0F; @@ -285,6 +294,38 @@ /*********************************************************************//** * @brief + * The cmdStartPreGenerateDialysate function sends a pre generate dialysate command + * to the DD with a given set of details. DD will transition to pre generate + * dialysate mode if it hasn't already. + * @details \b Inputs: none + * @details \b Outputs: preGenDialysateCmdSet + * @details \b Message \b Sent: Start/continue pre-generate dialysate command. + * @param qd Target dialysate flow rate (Qd). + * @param dialTemp Target dialysate temperature in deg C. + * @param acidConvFactor Conversion factor for the acid used. + * @param bicarbConvFactor Conversion factor for the bicarbonate used. + * @param sodium Level of sodium used in mEq/L. + * @param bicarbonate Level of bicarbonate used in mEq/L. + * @return none + *************************************************************************/ +void cmdStartPreGenerateDialysate( F32 qd, F32 dialTemp, F32 acidConvFactor, F32 bicarbConvFactor, U32 sodium, U32 bicarbonate ) +{ + preGenDialysateCmdSet.start = TRUE; + preGenDialysateCmdSet.dialRate = qd; + preGenDialysateCmdSet.dialTemp = dialTemp; + preGenDialysateCmdSet.acidConvFactor = acidConvFactor; + preGenDialysateCmdSet.bicarbConvFactor = bicarbConvFactor; + preGenDialysateCmdSet.sodium = sodium; + preGenDialysateCmdSet.bicarbonate = bicarbonate; + +#ifndef TEST_UI_ONLY + sendMessage( MSG_ID_DD_PRE_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&preGenDialysateCmdSet), sizeof( PRE_GEN_DIALYSATE_REQ_PAYLOAD_T ) ); +#endif +// ddStartCommandSent = TRUE; +} + +/*********************************************************************//** + * @brief * The cmdStartGenerateDialysate function sends a generate dialysate command * to the DD with a given set of details. DD will transition to dialysate * delivery mode if it hasn't already.