Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -reb877ae36c28eb83553ee11ccccf42e2c4a5b4d2 -r43e59e505bbea87c76822c51a3273eec3f4addaa --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision eb877ae36c28eb83553ee11ccccf42e2c4a5b4d2) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 43e59e505bbea87c76822c51a3273eec3f4addaa) @@ -1,59 +1,442 @@ -/************************************************************************** - * - * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. - * - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN - * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * - * @file SystemCommMessages.h - * - * @date 10-Oct-2019 - * @author S. Nash - * - * @brief header file for System Communication message definitions and functions. - * - **************************************************************************/ +/************************************************************************** +* +* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. +* +* THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +* +* @file SystemCommMessages.h +* +* @author (last) Dara Navaei +* @date (last) 13-Jul-2022 +* +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 +* +***************************************************************************/ #ifndef __SYSTEM_COMM_MESSAGES_H__ #define __SYSTEM_COMM_MESSAGES_H__ -#include "Common.h" -#include "MsgQueues.h" +#include "AirTrap.h" +#include "BloodFlow.h" +#include "BloodLeak.h" +#include "BloodPrime.h" +#include "Bubble.h" +#include "CommBuffers.h" +#include "DGInterface.h" +#include "DialInFlow.h" +#include "DialOutFlow.h" +#include "Dialysis.h" +#include "Fans.h" +#include "FluidLeak.h" +#include "HDCommon.h" +#include "MessageSupport.h" +#include "ModeInitPOST.h" +#include "ModePostTreat.h" +#include "ModePreTreat.h" +#include "ModeStandby.h" +#include "ModeTreatment.h" +#include "ModeTreatmentParams.h" +#include "MsgQueues.h" +#include "NVDataMgmt.h" +#include "PresOccl.h" +#include "Prime.h" +#include "Rinseback.h" +#include "Switches.h" +#include "SyringePump.h" +#include "Temperatures.h" +#include "Valves.h" +#include "Voltages.h" -// ********** public definitions ********** +/** + * @defgroup SystemCommMessages SystemCommMessages + * @brief The system communication messages module provides helper functions + * for sending outgoing system message and handling incoming system messages. + * + * @addtogroup SystemCommMessages + * @{ + */ + +// ********** 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. -typedef enum Msg_IDs -{ - MSG_ID_UNUSED = 0, - MSG_ID_OFF_BUTTON_PRESS, - MSG_ID_FIRST_TESTER_MESSAGE = 8000, - MSG_ID_TESTER_LOGIN_REQUEST = MSG_ID_FIRST_TESTER_MESSAGE, - MSG_ID_HD_MESSAGE, - MSG_ID_OFF_BUTTON_STATE_OVERRIDE, - MSG_ID_STOP_BUTTON_STATE_OVERRIDE, - MSG_ID_ALARM_LAMP_PATTERN_OVERRIDE, - MSG_ID_WATCHDOG_TASK_CHECKIN_OVERRIDE, - NUM_OF_MSG_IDS -} MSG_ID_T; - +#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. + // ********** public function prototypes ********** + +// Serialize message +U32 serializeMessage( MESSAGE_T msg, COMM_BUFFER_T buffer, BOOL ackReq ); + +// ACK MSG +BOOL sendACKMsg( MESSAGE_T *message ); + +// MSG_ID_DG_CHECK_IN +void handleDGCheckIn( MESSAGE_T *message ); +// MSG_ID_UI_CHECK_IN +void handleUICheckIn( MESSAGE_T *message ); + +// MSG_ID_REQUEST_FW_VERSIONS +void handleFWVersionRequest( MESSAGE_T *message ); + +// MSG_ID_HD_UI_VERSION_INFO_RESPONSE +void handleUIVersionResponse( MESSAGE_T *message ); + +// MSG_ID_HD_UI_VERSION_INFO_REQUEST +BOOL sendUIVersionRequest( void ); + +// MSG_ID_REQUEST_FW_VERSIONS +void handleHDSerialNumberRequest( void ); + +// MSG_ID_UI_REQUEST_SERVICE_INFO +void handleHDServiceScheduleRequest( MESSAGE_T *message ); + +// MSG_ID_REQUEST_HD_USAGE_INFO +void handleHDUsageInfoRequest( MESSAGE_T *message ); + +// MSG_ID_DG_VERSION +void handleDGVersionResponse( MESSAGE_T *message ); + +// MSG_ID_HD_DG_POST_RESULT_REQUEST +BOOL sendDGPOSTResultRequest( void ); + +// MSG_ID_HD_EVENT +BOOL sendEvent( HD_EVENT_ID_T event, EVENT_DATA_T dat1, EVENT_DATA_T dat2 ); + // MSG_ID_OFF_BUTTON_PRESS -BOOL sendOffButtonMsgToUI( void ); +BOOL sendOffButtonMsgToUI( U08 cmd ); void handleOffButtonConfirmMsgFromUI( MESSAGE_T *message ); + +// MSG_ID_ALARM_TRIGGERED +void handleAlarmTriggered( MESSAGE_T *message ); + +// MSG_ID_ALARM_CLEARED +void handleAlarmCleared( MESSAGE_T *message ); -// *********** public test support message functions ********** +// MSG_ID_USER_REQUEST_ALARM_SILENCE +void handleUIAlarmSilenceRequest( MESSAGE_T *message ); + +// MSG_ID_ALARM_CONDITION_CLEARED +void handleAlarmUserAction( MESSAGE_T *message ); + +// MSG_ID_HD_POST_SINGLE_TEST_RESULT +BOOL sendPOSTTestResult( HD_POST_STATE_T test, BOOL passed ); + +// MSG_ID_HD_POST_FINAL_TEST_RESULT +BOOL sendPOSTFinalResult( BOOL passed ); + +// MSG_ID_DG_POST_FINAL_TEST_RESULT +void handleDGPOSTFinalResult( MESSAGE_T *message ); + +// MSG_ID_HD_REQUEST_UI_FINAL_POST_RESULT +BOOL sendUIRequestPOSTFinalResult( void ); + +// MSG_ID_UI_POST_FINAL_TEST_RESULT +void handleUIPOSTFinalResult( MESSAGE_T *message ); + +// MSG_ID_LOAD_CELL_READINGS +void handleLoadCellReadingsFromDG( MESSAGE_T *message ); -// DEBUG OUTPUT -BOOL sendDebugData( U08 *dbgData, U32 len ); +// MSG_ID_DG_TEMPERATURE_DATA: +void handleDGTemperatureData( MESSAGE_T *message ); +// MSG_ID_RO_PUMP_DATA: +void handleROPumpData( MESSAGE_T *message ); + +// MSG_ID_DG_DIALYSATE_FLOW_METER_DATA: +void handleDialysateFlowData( MESSAGE_T *message ); + +// MSG_ID_DRAIN_PUMP_DATA: +void handleDrainPumpData( MESSAGE_T *message ); + +// MSG_ID_DG_PRESSURES_DATA: +void handleDGPressuresData( MESSAGE_T *message ); + +// MSG_ID_DG_RESERVOIR_DATA: +void handleDGReservoirData( MESSAGE_T *message ); + +// MSG_ID_UI_INITIATE_TREATMENT_REQUEST +void handleInitiateTreatmentRequest( MESSAGE_T *message ); + +// MSG_ID_UI_INITIATE_TREATMENT_RESPONSE +BOOL sendInitiateTreatmentResponseMsg( BOOL accepted, U32 reason ); + +// MSG_ID_UI_NEW_TREATMENT_PARAMS +void handleTreatmentParametersFromUI( MESSAGE_T *message ); + +// MSG_ID_HD_NEW_TREATMENT_PARAMS_RESPONSE +BOOL sendTreatmentParametersResponseMsg( BOOL accepted, U08 *rejectReasons, U32 byteLength ); + +// MSG_ID_UI_SET_UF_VOLUME_PARAMETER +void handleUFVolumeSetRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SET_UF_VOLUME_PARAMETER_RESPONSE +BOOL sendUFVolumeSetResponseMsg( BOOL accepted, U32 reason, F32 uFVolumeMl ); + +// MSG_ID_UI_USER_CONFIRM_TREATMENT_PARAMS +void handleUIUserConfirmTreatmentParameters( MESSAGE_T *message ); + +// MSG_ID_USER_UF_PAUSE_RESUME_REQUEST +void handleUFPauseResumeRequest( MESSAGE_T *message ); + +// MSG_ID_USER_UF_PAUSE_RESUME_RESPONSE +BOOL sendUFPauseResumeResponse( BOOL accepted, U32 reason, U32 ufState ); + +// MSG_ID_USER_UF_SETTINGS_CHANGE_REQUEST +void handleChangeUFSettingsRequest( MESSAGE_T *message ); + +// MSG_ID_USER_UF_SETTINGS_CHANGE_RESPONSE +BOOL sendChangeUFSettingsResponse( BOOL accepted, U32 reason, F32 volume_mL, U32 time_min, F32 ufRate_mL_min, S32 timeDiff, F32 rateDiff, F32 oldUFRate_mL_min ); + +// MSG_ID_USER_CONFIRM_UF_SETTINGS_CHANGE +void handleChangeUFSettingsConfirmation( MESSAGE_T *message ); + +// MSG_ID_USER_UF_SETTINGS_CHANGE_CONFIRMATION_RESPONSE +BOOL sendChangeUFSettingsOptionResponse( BOOL accepted, U32 reason, F32 volume_mL, U32 time_min, F32 ufRate_mL_min ); + +// MSG_ID_USER_TREATMENT_TIME_CHANGE_REQUEST +void handleChangeTreatmentDurationRequest( MESSAGE_T *message ); + +// MSG_ID_USER_TREATMENT_TIME_CHANGE_RESPONSE +BOOL sendChangeTreatmentDurationResponse( BOOL accepted, U32 reason, U32 time_min, F32 volume_mL ); + +// MSG_ID_TREATMENT_TIME_REMAINING_OVERRIDE: +void handleTestTreatmentTimeRemainingOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_TREATMENT_PARAM_CHANGE_RANGES +BOOL sendTreatmentParamsRangesToUI( U32 minTime, U32 maxTime, F32 minUFVol, F32 maxUFVol, U32 minDialRate, U32 maxDialRate ); + +// MSG_ID_HD_TREATMENT_LOG_PERIODIC_DATA +BOOL sendTreatmentPeriodicDataToUI( TREATMENT_LOG_DATA_PERIODIC_T * periodDataPtr ); + +// MSG_ID_USER_BLOOD_DIAL_RATE_CHANGE_REQUEST +void handleChangeBloodDialysateRateChangeRequest( MESSAGE_T *message ); + +// MSG_ID_USER_SALINE_BOLUS_REQUEST +void handleSalineBolusRequest( MESSAGE_T *message ); + +// MSG_ID_USER_SALINE_BOLUS_RESPONSE +BOOL sendSalineBolusResponse( BOOL accepted, U32 rejReason, U32 bolusVol ); + +// MSG_ID_USER_BLOOD_DIAL_RATE_CHANGE_RESPONSE +BOOL sendChangeBloodDialysateRateChangeResponse( BOOL accepted, U32 reason, U32 bloodRate, U32 dialRate ); + +// MSG_ID_UI_PRESSURE_LIMITS_CHANGE_REQUEST +void handleChangePressureLimitsRequest( MESSAGE_T *message ); + +// MSG_ID_HD_PRESSURE_LIMITS_CHANGE_RESPONSE +BOOL sendPressureLimitsChangeResponse( PRESSURE_LIMIT_CHANGE_RESPONSE_T *data ); + +// MSG_ID_UI_HEPARIN_PAUSE_RESUME_REQUEST +void handleHeparinCommandRequest( MESSAGE_T *message ); + +// MSG_ID_HD_HEPARIN_PAUSE_RESUME_RESPONSE +BOOL sendHeparinCommandResponse( U32 accepted, U32 rejReason ); + +// MSG_ID_UI_SET_ALARM_AUDIO_VOLUME_LEVEL_CMD +void handleAlarmAudioVolumeSetCmd( MESSAGE_T *message ); + +// MSG_ID_HD_ALARM_AUDIO_VOLUME_SET_RESPONSE +BOOL sendAlarmAudioVolumeSetResponse( U32 accepted, U32 rejReason ); + +// MSG_ID_UI_SAMPLE_WATER_CMD +void handleSampleWaterCmd( MESSAGE_T *message ); + +// MSG_ID_HD_SAMPLE_WATER_CMD_RESPONSE +BOOL sendSampleWaterCmdResponse( BOOL accepted, U32 reason ); + +// MSG_ID_UI_SAMPLE_WATER_RESULT +void handleSampleWaterResult( MESSAGE_T *message ); + +// MSG_ID_UI_CONSUMABLE_INSTALL_CONFIRM +void handleConsumableInstallConfirm( MESSAGE_T *message ); + +// MSG_ID_UI_INSTALLATION_CONFIRM_RESPONSE +BOOL sendConsumableInstallCmdResponse( BOOL accepted, U32 reason ); + +// MSG_ID_UI_INSTALLATION_CONFIRM +void handleInstallationConfirm( MESSAGE_T *message ); + +// MSG_ID_UI_START_PRIME_REQUEST +void handleStartPrimeCmd( MESSAGE_T *message ); + +// MSG_ID_HD_START_PRIME_RESPONSE +BOOL sendStartPrimeCmdResponse( BOOL accepted, U32 reason ); + +// MSG_ID_UI_CONTINUE_TO_TREATMENT_REQUEST +void handleContinueToTreatmentCmd( MESSAGE_T *message ); + +// MSG_ID_HD_CONTINUE_TO_TREATMENT_RESPONSE +BOOL sendContinueToTreatmentCmdResponse( BOOL accepted, U32 reason ); + +// MSG_ID_UI_PATIENT_CONNECTION_CONFIRM +void handlePatientConnectionConfirmCmd( MESSAGE_T *message ); + +// MSG_ID_HD_PATIENT_CONNECTION_CONFIRM_RESPONSE +BOOL sendPatientConnectionConfirmCmdResponse( BOOL accepted, U32 reason ); + +// MSG_ID_UI_START_TREATMENT_REQUEST +void handleStartTreatmentRequest( MESSAGE_T *message ); + +// MSG_ID_HD_START_TREATMENT_RESPONSE +BOOL sendStartTreatmentResponse( BOOL accepted, U32 reason ); + +// MSG_ID_UI_RINSEBACK_CMD +void handlRinsebackCmd( MESSAGE_T *message ); + +// MSG_ID_HD_RINSEBACK_CMD_RESPONSE +BOOL sendRinsebackCmdResponse( BOOL accepted, U32 rejReason ); + +// MSG_ID_UI_RECIRC_CMD +void handleTreatmentRecircCmd( MESSAGE_T *message ); + +// MSG_ID_HD_RECIRC_CMD_RESPONSE +BOOL sendTreatmentRecircCmdResponse( BOOL accepted, U32 rejReason ); + +// MSG_ID_UI_TX_END_CMD: +void handleTreatmentEndCmd( MESSAGE_T *message ); + +// MSG_ID_HD_RECIRC_CMD_RESPONSE +BOOL sendTreatmentEndCmdResponse( BOOL accepted, U32 rejReason ); + +// MSG_ID_UI_PATIENT_DISCONNECTION_CONFIRM +void handlePatientDisconnectionConfirmCmd( MESSAGE_T *message ); + +// MSG_ID_UI_DISPOSABLE_REMOVAL_CONFIRM +void handleDisposableRemovalConfirmCmd( MESSAGE_T *message ); + +// MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE +BOOL sendDisposableRemovalConfirmResponse( BOOL accepted, U32 reason ); + +// MSG_ID_UI_TREATMENT_LOG_DATA_REQUEST +void handleUITreatmentLogDataRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_LOG_DATA_RESPONSE +BOOL sendTreatmentLogData( BOOL accepted, U32 reason, TREATMENT_LOG_DATA_PAYLOAD_T *logDataPtr ); + +// MSG_ID_UI_DISINFECT_REQUEST +void handleUIDisinfectRequest( MESSAGE_T *message ); + +// MSG_ID_HD_DISINFECT_RESPONSE +BOOL sendDisinfectConfirmResponse( BOOL accepted, U32 reason ); + +// MSG_ID_HD_SET_STANDBY_DISINFECT_SUB_MODE_REQUEST +void handleSetHDStandbyDisinfectSubmodeRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SET_STANDBY_DISINFECT_SUB_MODE_RESPONSE +BOOL handleSetHDStandbyDisinfectSubmodeResponse( BOOL accepted, U32 reason ); + +// MSG_ID_DG_FLUSH_DATA +void handleFlushUIStateReadingFromDG( MESSAGE_T *message ); + +// MSG_ID_DG_HEAT_DISINFECT_DATA +void handleHeatDisinfectUIStateReadingFromDG( MESSAGE_T *message ); + +// MSG_ID_DG_CHEM_DISINFECT_DATA +void handleChemDisinfectUIStateReadingFromDG( MESSAGE_T *message ); + +// MSG_ID_UI_ACTIVE_ALARMS_LIST_REQUEST +void handleUIActiveAlarmsListRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ACTIVE_ALARMS_LIST_REQUEST_RESPONSE +BOOL sendActiveAlarmsList( BOOL accepted, U32 reason, U32 *alarmList, U32 size ); + +// MSG_ID_HD_TREATMENT_LOG_ALARM_EVENT +BOOL sendTreatmentLogAlarmEventData( ALARM_ID_T alarmID, ALARM_DATA_T almData1, ALARM_DATA_T almData2 ); + +// MSG_ID_HD_TREATMENT_LOG_EVENT +BOOL sendTreatmentLogEventData( TX_EVENT_ID_T event, F32 oldValue, F32 newValue ); + +// *********** public DG command functions ********** + +// MSG_ID_SET_DG_DIALYSATE_TEMP_TARGETS +BOOL sendDialysateHeatingParamsToDG( DG_CMD_DIALYSATE_HEATING_PARAMS_T *params ); + +// MSG_ID_DG_SWITCH_RESERVOIR_CMD +BOOL sendDGSwitchReservoirCommand( U32 activeReservoir ); + +// MSG_ID_DG_CHANGE_VALVE_SETTING_CMD +BOOL sendDGChangeValveSettingCommand( U32 valveSettingCmd ); + +// MSG_ID_DG_FILL_CMD +BOOL sendDGFillCommand( U32 cmd, U32 fillToVolumeMl, F32 targetFlowRateLPM ); + +// MSG_ID_DG_DRAIN_CMD +BOOL sendDGDrainCommand( DRAIN_RESERVOIR_CMD_PAYLOAD_T *drainCmdPtr ); + +// MSG_ID_STARTING_STOPPING_TREATMENT_CMD +BOOL sendDGStartStopCommand( BOOL start ); + +// MSG_ID_DG_START_STOP_TRIMMER_HEATER_CMD +BOOL sendDGStartStopTrimmerHeaterCommand( BOOL start ); + +// MSG_ID_DG_SAMPLE_WATER_CMD +BOOL sendDGSampleWaterCommand( SAMPLE_WATER_CMD_T cmd ); + +// MSG_ID_DG_COMMAND_RESPONSE +void handleDGCmdResp( MESSAGE_T *messagePtr ); + +// MSG_ID_UI_HD_SET_RTC_REQUEST: +void handleUIClockSyncRequest( MESSAGE_T *message ); + +// MSG_ID_DG_OP_MODE +void handleDGOpMode( MESSAGE_T *message ); + +// MSG_ID_DG_START_STOP_FLUSH +BOOL sendDGStartFlushModeCommand( BOOL start ); + +// MSG_ID_DG_START_STOP_HEAT_DISINFECT +BOOL sendDGStartHeatDisinfectModeCommand( BOOL start ); + +// MSG_ID_DG_START_STOP_CHEM_DISINFECT +BOOL sendDGStartChemicalDisinfectModeCommand( BOOL start ); + +// MSG_ID_ALARM_STATUS +BOOL broadcastAlarmStatus( COMP_ALARM_STATUS_T almStatus ); + +// MSG_ID_HD_SEND_CALIBRATION_RECORD +BOOL sendHDCalibrationRecord( U32 payloadCurrNum, U32 payloadTotalNum, U32 length, U08* calRcrdAddress ); + +// MSG_ID_HD_SEND_SYSTEM_RECORD +BOOL sendHDSystemRecord( U32 payloadCurrNum, U32 payloadTotalNum, U32 length, U08* sysRcrdAddress ); + +// MSG_ID_HD_SEND_SERVICE_RECORD +BOOL sendHDServiceRecord( U32 payloadCurrNum, U32 payloadTotalNum, U32 length, U08* srvcRcrdAddress ); + +// MSG_ID_DG_REQUEST_CONCENTRATE_RATIOS +BOOL sendDGConcentrateMixingRatiosRequest( void ); + +// MSG_ID_DG_CONCENTRATE_MIXING_RATIOS_DATA +void handleDGMixingRatios( MESSAGE_T *message ); + +// MSG_ID_HD_SEND_SW_CONFIG_RECORD +BOOL sendHDSWConfigRecord( U32 payloadCurrNum, U32 payloadTotalNum, U32 length, U08* swRcrdAddress ); + +// MSG_ID_HD_GET_SW_CONFIG_RECORD +void handleGetHDSoftwareConfigRecord( MESSAGE_T *message ); + +// MSG_ID_HD_SET_SW_CONFIG_RECORD +void handleSetHDSoftwareConfigRecord( MESSAGE_T *message ); + +// MSG_ID_UI_REQUEST_SERVICE_MODE +void handleUIServiceModeRequest( MESSAGE_T *message ); +void sendUIServiceModeResponse( BOOL accepted, U32 rejCode ); + +#ifdef EMC_TEST_BUILD +// MSG_ID_CAN_ERROR_COUNT +BOOL broadcastCANErrorCount( U32 count ); +#endif + +// *********** public test support message functions ********** + // MSG_TESTER_LOG_IN void handleTesterLogInRequest( MESSAGE_T *message ); BOOL isTestingActivated( void ); -// MSG_ID_HD_MESSAGE -void handleTestHDMessageRequest( MESSAGE_T *message ); - // MSG_ID_OFF_BUTTON_STATE_OVERRIDE void handleTestOffButtonStateOverrideRequest( MESSAGE_T *message ); @@ -66,4 +449,366 @@ // MSG_ID_WATCHDOG_TASK_CHECKIN_OVERRIDE: void handleTestWatchdogCheckInStateOverrideRequest( MESSAGE_T *message ); +// MSG_ID_ALARM_STATE_OVERRIDE +void handleTestAlarmStateOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_ALARM_TIME_OVERRIDE +void handleTestAlarmTimeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_FLOW_SET_PT_OVERRIDE +void handleTestBloodFlowSetPointOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_FLOW_MEAS_OVERRIDE +void handleTestBloodFlowMeasuredOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_ROTOR_COUNT_OVERRIDE +void handleHDBloodPumpRotorCountOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_SET_ARTERIAL_PRESSURE_OFFSET +void handleHDSetArterialPressureOffsetRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_PUMP_MC_MEAS_SPEED_OVERRIDE +void handleTestBloodPumpMCMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_PUMP_MC_MEAS_CURR_OVERRIDE +void handleTestBloodPumpMCMeasuredCurrentOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_FLOW_SEND_INTERVAL_OVERRIDE +void handleTestBloodFlowBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_PUMP_MEAS_SPEED_OVERRIDE +void handleTestBloodPumpMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_PUMP_MEAS_ROTOR_SPEED_OVERRIDE +void handleTestBloodPumpRotorMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_FLOW_SET_PT_OVERRIDE +void handleTestDialInFlowSetPointOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_FLOW_SET_PT_OVERRIDE +void handleTestDialOutFlowSetPointOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_FLOW_MEAS_OVERRIDE +void handleTestDialInFlowMeasuredOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_PUMP_MC_MEAS_SPEED_OVERRIDE +void handleTestDialInPumpMCMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_PUMP_MC_MEAS_CURR_OVERRIDE +void handleTestDialInPumpMCMeasuredCurrentOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_FLOW_SEND_INTERVAL_OVERRIDE +void handleTestDialInFlowBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_PUMP_MEAS_SPEED_OVERRIDE +void handleTestDialInPumpMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_PUMP_MEAS_ROTOR_SPEED_OVERRIDE +void handleTestDialInPumpRotorMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_PRESSURE_ARTERIAL_OVERRIDE +void handleTestArterialPressureOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_PRESSURE_VENOUS_OVERRIDE +void handleTestVenousPressureOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_OCCLUSION_BLOOD_PUMP_OVERRIDE +void handleTestBloodPumpOcclusionOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_PRES_OCCL_SEND_INTERVAL_OVERRIDE +void handleTestPresOcclBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_SET_RTC_TIMESTAMP +void handleSetRTCTimestamp( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_FLOW_SEND_INTERVAL_OVERRIDE +void handleTestDialOutFlowBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_UF_REF_VOLUME_OVERRIDE +void handleTestDialOutUFReferenceVolumeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_UF_MEAS_VOLUME_OVERRIDE +void handleTestDialOutUFMeasuredVolumeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_PUMP_MC_MEAS_SPEED_OVERRIDE +void handleTestDialOutPumpMCMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_PUMP_MC_MEAS_CURR_OVERRIDE +void handleTestDialOutPumpMCMeasuredCurrentOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_PUMP_MEAS_SPEED_OVERRIDE +void handleTestDialOutPumpMeasuredSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_PUMP_MEAS_ROTOR_SPEED_OVERRIDE +void handleTestDialOutPumpMeasuredRotorSpeedOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_LOAD_CELL_WEIGHT_OVERRIDE +void handleTestDialOutLoadCellWeightOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SAFETY_SHUTDOWN_OVERRIDE: +void handleTestHDSafetyShutdownOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ACCEL_OVERRIDE: +void handleTestHDAccelOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ACCEL_MAX_OVERRIDE: +void handleTestHDAccelMaxOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ACCEL_SEND_INTERVAL_OVERRIDE: +void handleTestHDAccelBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SET_PARAMETER_TREATMENT_PARAMETER +void handleTestSetTreatmentParameter( MESSAGE_T *message ); + +// MSG_ID_VALVES_STATES_PUBLISH_INTERVAL_OVERRIDE +void handleTestHDValvesBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_HOME_VALVE +void handleHomeHDValve( MESSAGE_T *message ); + +// MSG_ID_HD_VALVES_SET_AIR_TRAP_VALVE +void handleSetAirTrapValve( MESSAGE_T *message ); + +// MSG_ID_HD_VALVES_SET_POSITION +void handleSetHDValvePositionOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_VALVES_SET_PWM_OVERRIDE +void handleSetHDValvePWMOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SOFTWARE_RESET_REQUEST +void handleHDSoftwareResetRequest( MESSAGE_T *message ); + +// MSG_ID_BLOOD_PUMP_HOME_CMD +void handleTestBloodPumpHomeRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_IN_PUMP_HOME_CMD +void handleTestDialInPumpHomeRequest( MESSAGE_T *message ); + +// MSG_ID_DIAL_OUT_PUMP_HOME_CMD +void handleTestDialOutPumpHomeRequest( MESSAGE_T *message ); + +// MSG_ID_HD_AIR_TRAP_SEND_INTERVAL_OVERRIDE +void handleSetAirTrapBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_AIR_TRAP_LEVEL_SENSOR_OVERRIDE +void handleSetAirTrapLevelSensorOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_FLUID_LEAK_SEND_INTERVAL_OVERRIDE +void handleSetFluidLeakBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_FLUID_LEAK_STATE_OVERRIDE +void handleSetFluidLeakStateOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BLOOD_LEAK_DATA_SEND_INTERVAL_OVERRIDE +void handleSetBloodLeakDataBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BLOOD_LEAK_STATUS_OVERRIDE +void handleSetBloodLeakStatusOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BLOOD_LEAK_ZERO_REQUEST +void handleBloodLeakZeroRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BUBBLES_DATA_SEND_INTERVAL_OVERRIDE +void handleSetBubblesDataBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BUBBLE_STATUS_OVERRIDE +void handleSetBubbleStatusOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BUBBLE_SELF_TEST_REQUEST +void handleBubbleSelfTestRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BLOOD_PRIME_VOLUME_OVERRIDE +void handleBloodPrimeVolumeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_RINSEBACK_VOLUME_OVERRIDE +void handleRinsebackVolumeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SWITCHES_STATUS_OVERRIDE +void handleSetSwitchesStatusOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SWITCHES_PUBLISH_INTERVAL_OVERRIDE +void handleTestSwitchesPublishIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BATTERY_REMAINING_PERCENT_OVERRIDE +void handleBatteryRemainingPercentOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_SUPER_CLEAR_ALARMS_CMD +void handleTestSuperClearAlarmsRequest( MESSAGE_T *message ); + +// MSG_ID_HD_REQUEST_CALIBRATION_DATA +void handleTestHDCalibrationDataRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SET_CALIBRATION_RECORD +void handleSetHDCalibrationRecord( MESSAGE_T *message ); + +// MSG_ID_HD_GET_CALIBRATION_RECORD +void handleGetHDCalibrationRecord( MESSAGE_T *message ); + +// MSG_ID_HD_SET_SYSTEM_RECORD +void handleSetHDSystemRecord( MESSAGE_T *message ); + +// MSG_ID_HD_GET_SYSTEM_RECORD +void handleGetHDSystemRecord( MESSAGE_T *message ); + +// MSG_ID_HD_GET_SERVICE_RECORD +void handleGetHDServiceRecord( MESSAGE_T *message ); + +// MSG_ID_HD_SET_SERVICE_RECORD +void handleSetHDServiceRecord( MESSAGE_T *message ); + +// MSG_ID_HD_SET_OP_MODE_REQUEST +void handleTestSetOpModeRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_SEND_INTERVAL_OVERRIDE: +void handleTestSyringePumpDataBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_OPERATION_REQUEST: +void handleTestSyringePumpOperationRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_MEASURED_RATE_OVERRIDE: +void handleTestSyringePumpMeasuredRateOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_HEPRIN_BOLUS_TARGET_RATE_OVERRIDE: +void handleTestSyringePumpHeprinBolusTargetRateOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_MEASURED_FORCE_OVERRIDE: +void handleTestSyringePumpMeasuredForceOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_SYRINGE_DETECT_OVERRIDE: +void handleTestSyringePumpMeasuredSyringeDetectOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_MEASURED_HOME_OVERRIDE: +void handleTestSyringePumpMeasuredHomeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_MEASURED_POSITION_OVERRIDE: +void handleTestSyringePumpMeasuredPositionOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_MEASURED_VOLUME_OVERRIDE: +void handleTestSyringePumpMeasuredVolumeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_VALVES_CURRENT_OVERRIDE +void handleTestValvesCurrentOverrideRequest( MESSAGE_T *message ); + +// MSD_ID_HD_VALVES_POSITION_COUNT_OVERRIDE +void handleTestValvesPositionCountOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_MONITORED_VOLTAGES_SEND_INTERVAL_OVERRIDE +void handleTestMonitoredVoltagesSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_MONITORED_VOLTAGES_OVERRIDE +void handleTestMonitoredVoltageOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ALARM_INFO_SEND_INTERVAL_OVERRIDE +void handleTestAlarmInfoSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ALARM_AUDIO_VOLUME_LEVEL_OVERRIDE +void handleTestAlarmAudioVolumeOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ALARM_AUDIO_CURRENT_HG_OVERRIDE +void handleTestAlarmAudioCurrentHgOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ALARM_AUDIO_CURRENT_LG_OVERRIDE +void handleTestAlarmAudioCurrentLgOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ALARM_BACKUP_AUDIO_CURRENT_OVERRIDE +void handleTestAlarmBackupAudioCurrentOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_STATUS_OVERRIDE +void handleTestSyringePumpStatusOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_ENCODER_STATUS_OVERRIDE +void handleTestSyringePumpEncoderStatusOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_ADC_DAC_STATUS_OVERRIDE +void handleTestSyringePumpADCandDACStatusOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_ADC_READ_COUNTER_OVERRIDE +void handleTestSyringePumpADCReadCtrOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_ALARM_STATUS_PUBLISH_INTERVAL_OVERRIDE +void handleTestAlarmStatusSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_TIME_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentTimeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_RANGES_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentRangesSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_STOP_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentStopDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_BLOOD_PRIME_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestBloodPrimeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_RINSEBACK_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestRinsebackDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_STANDBY_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestStandbyModeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_OP_MODE_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestOpModeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_PRE_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestPreTreatmentModeDataSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestTreatmentModeSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_POST_TREATMENT_DATA_PUBLISH_INTERVAL_OVERRIDE +void handleTestPostTreatmentModeSendIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_TEMPERATURES_VALUE_OVERRIDE +void handleTestTemperaturesValueOverrideRequest( MESSAGE_T * message ); + +// MSG_ID_HD_TEMPERATURES_PUBLISH_INTERVAL_OVERRRIDE +void handleTestTemperaturesBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_FANS_PUBLISH_INTERVAL_OVERRIDE +void handleTestFansBroadcastIntervalOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_FANS_RPM_OVERRIDE +void handleFansRPMOverride( MESSAGE_T *message ); + +// MSG_ID_HD_BLOCK_MESSAGE_TRANSMISSION +void handleTestBlockMessagesRequest( MESSAGE_T *message ); + +// MSG_ID_HD_SYRINGE_PUMP_FORCE_SENSOR_DAC_CALIBRATE +void handleTestSyringePumpForceSensorCalibrateRequest( MESSAGE_T *message ); + +// MSG_ID_HD_STOP_RTC_CLOCK +void handleStopHDRTCClock( MESSAGE_T *message ); + +// MSG_ID_HD_FANS_DUTY_CYCLE_OVERRIDE +void handleSetFansDutyCycleOverrideRequest( MESSAGE_T *message ); + +// MSG_ID_HD_REQ_CURRENT_TREATMENT_PARAMETERS +void handleTestCurrentTreamtmentParametersRequest( MESSAGE_T *message ); + +// MSG_ID_HD_RES_CURRENT_TREATMENT_PARAMETERS +BOOL sendTestCurrentTreatmentParametersResponse(CURRENT_TREATMENT_PARAMS_DATA_PAYLOAD_T current_params); + +// MSG_ID_HD_SET_FANS_RPM_ALARM_START_TIME_OFFSET +void handleTestFansRPMAlarmStartTimeOffsetRequest( MESSAGE_T *message ); + +// MSG_ID_HD_GET_USAGE_INFO_RECORD +void handleGetHDUsageInfoRecord( MESSAGE_T *message ); + +// MSG_ID_HD_SET_USAGE_INFO_RECORD +void handleSetHDUsageInfoRecord( MESSAGE_T *message ); + +// MSG_ID_HD_SEND_USAGE_INFO_RECORD +BOOL handleSendHDUsageInfoRecord( U32 payloadCurrNum, U32 payloadTotalNum, U32 length, U08* usageInfoAddress ); + +// MSG_ID_HD_SET_BLOOD_LEAK_2_EMB_MODE +void handleSetBloodLeak2EmbeddedMode( MESSAGE_T* message ); + +// MSG_ID_HD_SET_BLOOD_LEAK_EMB_MODE_COMMAND +void handleSetBloodLeakEmbeddedModeCommand( MESSAGE_T* message ); + +// MSG_ID_HD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE +BOOL handleSendBloodLeakEmbeddedModeCommandResponse( U32 responseLen, U08* response ); + +/**@}*/ + #endif