Index: firmware/App/Services/Messaging.h =================================================================== diff -u -r395522dffef1348e176564925656012f529c1910 -r4a822b31b79b7e8a6bf60b45065be70c16172214 --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision 395522dffef1348e176564925656012f529c1910) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision 4a822b31b79b7e8a6bf60b45065be70c16172214) @@ -7,22 +7,22 @@ * * @file Messaging.h * -* @author (last) Shyam Kumar Mathamala -* @date (last) 25-Aug-2025 +* @author (last) Dara Navaei +* @date (last) 13-Apr-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 * ***************************************************************************/ - -#ifndef __MESSAGING_H__ -#define __MESSAGING_H__ +#ifndef __MESSAGING_H__ +#define __MESSAGING_H__ + #include "TDCommon.h" #include "TDDefs.h" #include "MessageSupport.h" #include "MsgQueues.h" - + /** * @defgroup Messaging Messaging * @brief The system communication messages unit provides helper functions @@ -35,7 +35,7 @@ // ********** public definitions ********** #define ACK_REQUIRED TRUE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. -#define ACK_NOT_REQUIRED FALSE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. +#define ACK_NOT_REQUIRED FALSE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. #pragma pack(push, 1) /// Payload record structure for ACK response. @@ -58,47 +58,6 @@ U32 rejectionReason; ///< Rejection reason if not accepted. } UI_RESPONSE_PAYLOAD_T; -/// Payload record structure for UF change response. -typedef struct -{ - BOOL accepted; ///< Accepted/Rejected - U32 rejectionReason; ///< Rejection reason if not accepted. - F32 ufVolume; ///< UF Volume in mL. - U32 durationInMinutes; ///< new Treatment duration in minutes. - S32 timeDiff; ///< Treatment duration difference. - F32 ufRate; ///< new UF rate in mL/min. - F32 rateDiff; ///< difference between new and old UF rates. - F32 oldUFRate; ///< Previous UF Rate in mL/min. -} UF_SETTINGS_CHANGE_RESPONSE_PAYLOAD_T; - -/// Payload record structure for UF change confirmation response. -typedef struct -{ - BOOL accepted; ///< Accepted/Rejected - U32 rejectionReason; ///< Rejection reason if not accepted. - F32 volume; ///< UF Volume in mL. - U32 duration; ///< Treatment duration in minutes - F32 ufRate; ///< UF rate in mL. -} UF_SETTINGS_CONFIRMATION_RESPONSE_PAYLOAD_T; - -/// Payload record structure for treatment duration change response. -typedef struct -{ - BOOL accepted; ///< Accepted/Rejected - U32 rejectionReason; ///< Rejection reason if not accepted. - U32 duration; ///< Treatment duration in minutes - F32 volume; ///< UF Volume in mL. -} TREATMENT_TIME_CHANGE_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; - /// Payload record structure for treatment parameter broadcast messages. typedef struct { @@ -110,6 +69,7 @@ U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) } TREATMENT_PARAM_BROADCAST_PAYLOAD_T; +/// Institutional record structure containing treatment parameter range limits. typedef struct { U32 minBloodFlowMLPM; ///< Min blood flow in mL/min. @@ -138,13 +98,13 @@ F32 maxHeparinBolusVolumeML; ///< Max heparin bolus volume in mL. U32 enableChemicalDisinfect; ///< Enable/disable chemical disinfect. } HD_INSTITUTIONAL_LOCAL_RECORD_T; - -// ********** public function prototypes ********** -// Serialize message +// ********** public function prototypes ********** + +// Serialize message U32 serializeMessage( MESSAGE_T msg, COMM_BUFFER_T buffer, BOOL ackReq ); -// ACK MSG +// ACK MSG BOOL sendACKMsg( MESSAGE_T *message ); // Handle version request message @@ -154,10 +114,12 @@ BOOL isTestingActivated( void ); void setTesterStatusToLoggedOut( void ); +void resetMicroControllerUnit( void ); void handleIncomingMessage( MESSAGE_T *message ); BOOL handleUICheckIn( MESSAGE_T *message ); BOOL handleTesterLogInRequest( MESSAGE_T *message ); +BOOL handleUpdateAvailable( MESSAGE_T *message ); BOOL testTDSoftwareResetRequest( MESSAGE_T *message ); @@ -171,4 +133,4 @@ /**@}*/ -#endif +#endif