Index: firmware/App/Services/Messaging.h =================================================================== diff -u -r1abc0349c736a70fb56db6895947abfbba0eee22 -r58d4338b0c453ac49d3fdc4ba391b47949406b98 --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision 1abc0349c736a70fb56db6895947abfbba0eee22) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision 58d4338b0c453ac49d3fdc4ba391b47949406b98) @@ -7,22 +7,22 @@ * * @file Messaging.h * -* @author (last) Shyam Kumar Mathamala -* @date (last) 25-Aug-2025 +* @author (last) Vijay Pamula +* @date (last) 29-May-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,16 +69,9 @@ U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) } TREATMENT_PARAM_BROADCAST_PAYLOAD_T; -/// Payload record structure for Fluid Bolus response. +/// Institutional record structure containing treatment parameter range limits. typedef struct { - U32 accepted; ///< Accepted/Rejected - U32 rejectionReason; ///< Rejection reason if not accepted. - U32 targetVolumeMl; ///< Target fluid bolus volume in mL. -} FLUID_BOLUS_RESPONSE_PAYLOAD_T; - -typedef struct -{ U32 minBloodFlowMLPM; ///< Min blood flow in mL/min. U32 maxBloodFlowMLPM; ///< Max blood flow in mL/min. U32 minDialysateFlowMLPM; ///< Min dialysate flow in mL/min. @@ -146,13 +98,21 @@ F32 maxHeparinBolusVolumeML; ///< Max heparin bolus volume in mL. U32 enableChemicalDisinfect; ///< Enable/disable chemical disinfect. } HD_INSTITUTIONAL_LOCAL_RECORD_T; - -// ********** public function prototypes ********** -// Serialize message +/// Payload record structure for Fluid Bolus response. +typedef struct +{ + U32 accepted; ///< Accepted/Rejected + U32 rejectionReason; ///< Rejection reason if not accepted. + U32 targetVolumeMl; ///< Target fluid bolus volume in mL. +} FLUID_BOLUS_RESPONSE_PAYLOAD_T; + +// ********** 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 @@ -162,10 +122,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 ); @@ -179,4 +141,4 @@ /**@}*/ -#endif +#endif