Index: firmware/App/Services/TxParams.h =================================================================== diff -u -rda59fa4a98dbc11c37677e92a66aa940d251678f -rd387dc3cd21e6f1fb7e161032f30eb49a9c1b48e --- firmware/App/Services/TxParams.h (.../TxParams.h) (revision da59fa4a98dbc11c37677e92a66aa940d251678f) +++ firmware/App/Services/TxParams.h (.../TxParams.h) (revision d387dc3cd21e6f1fb7e161032f30eb49a9c1b48e) @@ -104,17 +104,54 @@ F32 uFVolume_L; ///< Current ultrafiltration volume (in L). } CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T; -/// Payload record structure for treatment parameter range broadcast messages. +#pragma pack(push, 1) + +/// Payload record structure for requesting an isolated UF duration change. typedef struct { - U32 minTreatmentTime; ///< Minimum treatment duration (in minutes) - U32 maxTreatmentTime; ///< Maximum treatment duration (in minutes) - F32 minUFVolume; ///< Minimum ultrafiltration volume (in mL) - F32 maxUFVolume; ///< Maximum ultrafiltration volume (in mL) - U32 minDialRate; ///< Minimum dialysate flow rate (in mL/min) - U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) -} TREATMENT_PARAM_RANGE_BROADCAST_PAYLOAD_T; + U32 mDuration; ///< Requested isolated UF duration in minutes. +} ISOLATED_UF_DURATION_CHANGE_REQUEST_PAYLOAD_T; +/// Payload record structure for requesting an isolated UF volume goal change. +typedef struct +{ + U32 mDuration; ///< Requested isolated UF duration in minutes. + U32 mVolume; ///< Requested isolated UF volume goal in mL. +} ISOLATED_UF_VOLUME_GOAL_CHANGE_REQUEST_PAYLOAD_T; + +/// Payload record structure for confirming an isolated UF settings change. +typedef struct +{ + U32 mConfirmed; ///< TRUE if user confirms the staged isolated UF settings. +} ISOLATED_UF_CONFIRM_REQUEST_PAYLOAD_T; + +/// Payload record structure for isolated UF duration change responses. +typedef struct +{ + U32 mAccepted; ///< Accepted/Rejected. + U32 mReason; ///< Rejection reason if not accepted. + U32 mVolumeMax; ///< Maximum isolated UF volume in mL for the requested duration. +} ISOLATED_UF_DURATION_CHANGE_RESPONSE_PAYLOAD_T; + +/// Payload record structure for isolated UF volume goal change responses. +typedef struct +{ + U32 mAccepted; ///< Accepted/Rejected. + U32 mReason; ///< Rejection reason if not accepted. + U32 mVolume; ///< Isolated UF volume goal in mL. + U32 mDuration; ///< Isolated UF duration in minutes. + U32 mRate; ///< Isolated UF rate in mL/min. +} ISOLATED_UF_VOLUME_GOAL_CHANGE_RESPONSE_PAYLOAD_T; + +/// Payload record structure for isolated UF confirmation responses. +typedef struct +{ + U32 mAccepted; ///< Accepted/Rejected. + U32 mReason; ///< Rejection reason if not accepted. +} ISOLATED_UF_CONFIRM_RESPONSE_PAYLOAD_T; + +#pragma pack(pop) + // ********** public function prototypes **************** BOOL setTreatmentParameterU32( TREATMENT_PARAM_T param, U32 value ); // Set a specified unsigned integer treatment parameter value @@ -124,6 +161,10 @@ BOOL validateAndSetTreatmentParameters( MESSAGE_T *message ); // User provided treatment params to be set and validated //BOOL validateAndSetUFVolume( MESSAGE_T *message ); // User provided ultrafiltration volume to be set and validated +F32 calculateIsolatedUFRateMlMin( U32 durationMin, F32 volumeGoalMl ); // Calculate isolated UF rate (mL/min) from duration and volume goal +BOOL handleIsolatedUFDurationChangeRequest( MESSAGE_T *message ); // User requested isolated UF duration change +BOOL handleIsolatedUFVolumeGoalChangeRequest( MESSAGE_T *message ); // User requested isolated UF volume goal change +BOOL handleIsolatedUFConfirmRequest( MESSAGE_T *message ); // User confirmed/rejected isolated UF settings change void resetTreatmentParameters( void ); // Reset all parameters to defaults //BOOL signalUserConfirmationOfTreatmentParameters( MESSAGE_T *message ); // Process UI confirm/reject Treatment parameters