Index: firmware/App/Services/TxParams.h =================================================================== diff -u -re9e339870c5ed01230963f00d400331ab879c91f -rc92e2b5ae61f359e5633b32b2d5b691347d0d293 --- firmware/App/Services/TxParams.h (.../TxParams.h) (revision e9e339870c5ed01230963f00d400331ab879c91f) +++ firmware/App/Services/TxParams.h (.../TxParams.h) (revision c92e2b5ae61f359e5633b32b2d5b691347d0d293) @@ -86,6 +86,93 @@ U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) } TREATMENT_PARAM_RANGE_BROADCAST_PAYLOAD_T; +/// Payload record structure for treatment duration validate request. +typedef struct +{ + U32 duration; ///< Requested treatment duration in minutes. +} DURATION_VALIDATE_REQUEST_PAYLOAD_T; + +/// Payload record structure for treatment duration confirm request. +typedef struct +{ + U32 duration; ///< Confirmed treatment duration in minutes. + F32 ufRate; ///< Confirmed UF rate in L/hr. +} DURATION_CONFIRM_REQUEST_PAYLOAD_T; + +/// Payload record structure for treatment duration validate response. +typedef struct +{ + BOOL accepted; ///< Accepted/Rejected + U32 rejectionReason; ///< Rejection reason if not accepted. + U32 duration; ///< Treatment duration in minutes. + F32 ufVolumeGoal; ///< UF volume goal in L. + F32 ufRate; ///< UF rate in L/hr. +} DURATION_VALIDATE_RESPONSE_PAYLOAD_T; + +/// Payload record structure for bolus volume change request. +typedef struct +{ + U32 bolusVolume; ///< Requested bolus volume (in mL) +} BOLUS_VOLUME_CHANGE_REQUEST_PAYLOAD_T; + +/// Payload record structure for bolus volume change response. +typedef struct +{ + BOOL accepted; ///< Accepted/Rejected + U32 rejectionReason; ///< Rejection reason if not accepted +} BOLUS_VOLUME_CHANGE_RESPONSE_PAYLOAD_T; + +/// Payload record structure for pressure limit change request. +typedef struct +{ + S32 arterialPressureLimitWindowMMHG; ///< Arterial pressure limit window in mmHg. + S32 venousPressureLimitWindowMMHG; ///< Venous pressure limit window in mmHg. + S32 venousAsymmetricPressureLimitWindowMMHG; ///< Venous asymmetric pressure limit window in mmHg. + S32 tmpPressureLimitWindowMMHG; ///< TMP pressure limit window in mmHg. +} PRESSURE_LIMIT_CHANGE_REQUEST_T; + +/// Payload record structure for in-treatment pressure limit change response. +typedef struct +{ + BOOL accepted; ///< Accepted/Rejected. + U32 arterialPressureLimitWindowRejectionReason; ///< Rejection reason for arterial pressure limit window. + U32 venousPressureLimitWindowRejectionReason; ///< Rejection reason for venous pressure limit window. + U32 venousAsymmetricPressureLimitWindowRejectionReason; ///< Rejection reason for venous asymmetric pressure limit window. + U32 tmpPressureLimitWindowRejectionReason; ///< Rejection reason for TMP pressure limit window. +} PRESSURE_LIMITS_CHANGE_RESPONSE_PAYLOAD_T; + +/// Payload record structure for UF volume validate request. +typedef struct +{ + F32 ufVolume; ///< Requested UF volume in L. +} UF_VOLUME_VALIDATE_REQUEST_PAYLOAD_T; + +/// Payload record structure for UF volume confirm request. +typedef struct +{ + F32 ufVolume; ///< Confirmed UF volume in L. + F32 ufRate; ///< Confirmed UF rate in L/hr. +} UF_VOLUME_CONFIRM_REQUEST_PAYLOAD_T; + +/// Payload record structure for UF change response. +typedef struct +{ + BOOL accepted; ///< Accepted/Rejected + U32 rejectionReason; ///< Rejection reason if not accepted. + F32 ufVolumeGoal; ///< UF Volume in L. + U32 duration; ///< new Treatment duration in minutes. + F32 ufRate; ///< new UF rate in L/hr. +} UF_VOLUME_RESPONSE_PAYLOAD_T; + +/// Payload record structure for blood / dialysate rate change response. +typedef struct +{ + BOOL accepted; ///< Accepted/Rejected + U32 rejectionReason; ///< Rejection reason if not accepted. + U32 bloodRate; ///< new blood flow rate + U32 dialRate; ///< new dialysate flow rate +} BLOOD_DIAL_RATE_CHANGE_RESPONSE_PAYLOAD_T; + // ********** public function prototypes **************** BOOL setTreatmentParameterU32( TREATMENT_PARAM_T param, U32 value ); // Set a specified unsigned integer treatment parameter value @@ -94,10 +181,16 @@ F32 getTreatmentParameterF32( TREATMENT_PARAM_T param ); // Get a specified floating point treatment parameter 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 +// Edit Treatment parameter handlers +BOOL validateAndSetTreatmentDuration( MESSAGE_T *message ); // User provided treatment duration to be set and validated +BOOL validateAndSetBolusVolume( MESSAGE_T *message ); // User provided bolus volume to be set and validated +BOOL pressureLimitHandleChangeRequest( MESSAGE_T *message ); // User provided pressure limit window values to be validated and applied +BOOL validateAndSetUFVolume( MESSAGE_T *message ); // User provided ultrafiltration volume to be set and validated +BOOL signalUserConfirmationOfTreatmentDuration( MESSAGE_T *message ); // Process UI confirm/reject treatment duration +BOOL signalUserConfirmationOfUFVolume( MESSAGE_T *message ); // Process UI confirm/reject ultrafiltration volume change + void resetTreatmentParameters( void ); // Reset all parameters to defaults -//BOOL signalUserConfirmationOfTreatmentParameters( MESSAGE_T *message ); // Process UI confirm/reject Treatment parameters BOOL getValidTreatParamsReceived( void ); // Determine whether valid Treatment Parameters exist BOOL getTreatParamsConfirmed( void ); // Determine whether user confirmed the parameters