Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r999e1a2f4e499155d934b3aaa93c0ae02161d3c7 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 999e1a2f4e499155d934b3aaa93c0ae02161d3c7) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -7,8 +7,8 @@ * * @file ModeTreatment.c * -* @author (last) Vijay Pamula -* @date (last) 26-Jun-2026 +* @author (last) Varshini Nagabooshanam +* @date (last) 05-Aug-2026 * * @author (original) Sean Nash * @date (original) 21-Apr-2025 @@ -679,13 +679,32 @@ // Came back from temp break? if ( TRUE == recircAllowed ) { - F32 rinsebackVolume_L = getDeliveredRinsebackVolume() / (F32)ML_PER_LITER; + // Add rinseback volume (ml) to uf volume. + F32 newUFVolumeMl = ( getTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME ) * + (F32)ML_PER_LITER ) + getDeliveredRinsebackVolume(); + F32 remainingTimeMins = (F32)( getTreatmentTimeRemainingSecs() / SEC_PER_MIN ); + F32 newUFRateMlMin = ( remainingTimeMins > 0.0F ) ? + ( newUFVolumeMl / remainingTimeMins ) : 0.0F; - presUFVolumeMl = ( getTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME ) + rinsebackVolume_L ) * (F32)ML_PER_LITER; - presUFRateMlMin = presUFVolumeMl / (F32)( getTreatmentTimeRemainingSecs() / SEC_PER_MIN ); - // Add rinseback volume to UF volume (fluid in circuit goes back to the patient when we resume treatment) - setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, presUFVolumeMl ); - setDialysisDDParams( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), presUFVolumeMl, presUFRateMlMin ); + // Clamp to max UF volume + if ( newUFVolumeMl > (F32)MAX_UF_VOLUME_ML ) + { + newUFVolumeMl = (F32)MAX_UF_VOLUME_ML; + } + + // Clamp to max UF rate + if ( newUFRateMlMin > MAX_UF_RATE_ML_MIN ) + { + newUFRateMlMin = MAX_UF_RATE_ML_MIN; + } + + presUFVolumeMl = newUFVolumeMl; + presUFRateMlMin = newUFRateMlMin; + setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, + presUFVolumeMl / (F32)ML_PER_LITER ); + setDialysisDDParams( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), + presUFVolumeMl, + presUFRateMlMin ); recircAllowed = FALSE; } Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r909d4064e98d5684ee139534f0ac6cbc5f8774d5 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 909d4064e98d5684ee139534f0ac6cbc5f8774d5) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -7,8 +7,8 @@ * * @file OperationModes.c * -* @author (last) Dara Navaei -* @date (last) 27-May-2026 +* @author (last) suresh +* @date (last) 04-Aug-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -17,6 +17,7 @@ #include "gio.h" +#include "Buttons.h" #include "Messaging.h" #include "ModeFault.h" #include "ModeInitPOST.h" @@ -28,6 +29,7 @@ #include "ModeUpdate.h" //#include "NVDataMgmt.h" #include "OperationModes.h" +#include "SystemCommTD.h" #include "TaskGeneral.h" #include "Timers.h" @@ -150,7 +152,8 @@ newMode = arbitrateModeRequest(); // Will return current mode if no pending requests #ifndef TEST_UI_ONLY - // Verify mode transition is legal unless tester working with system TODO - restore check when all modes are implemented + // Verify mode transition is legal unless tester working with system + //TODO - restore check when all modes are implemented // if ( ( isTestingActivated() != TRUE ) && ( getTestConfigStatus( TEST_CONFIG_RECOVER_TREATMENT ) != TRUE ) ) { newMode = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; @@ -160,7 +163,8 @@ // Is requested new mode valid and legal at this time? if ( newMode >= MODE_NLEG ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_ILLEGAL_MODE_TRANSITION_REQUESTED, newMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, + SW_FAULT_ID_OP_MODES_ILLEGAL_MODE_TRANSITION_REQUESTED, newMode ) newMode = currentMode; } @@ -175,7 +179,8 @@ if ( MODE_TREA == lastMode ) { // If the last mode is treatment but the new mode is not treatment - // it means the treatment is done. Get the elapsed time since the beginning of the treatment and convert it to hours to be written + // it means the treatment is done. Get the elapsed time since the + // beginning of the treatment and convert it to hours to be written U32 txElapsedTimeMS = calcTimeSince( getTreatmentStartTimeStamp() ); F32 txElapsedTimeHrs = (F32)txElapsedTimeMS / ( (F32)( MIN_PER_HOUR * SEC_PER_MIN * MS_PER_SECOND ) ); @@ -221,15 +226,18 @@ break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_STATE, currentMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, + SW_FAULT_ID_OP_MODES_INVALID_MODE_STATE, + currentMode ) currentMode = MODE_FAUL; currentSubMode = 0; break; } // End switch #ifndef _VECTORCAST_ // Send operation status event when appropriate - if ( ( priorSubMode != currentSubMode ) || ( priorSubState != currentSubState ) || ( prior4thLevelState != current4thLevelState ) ) + if ( ( priorSubMode != currentSubMode ) || ( priorSubState != currentSubState ) + || ( prior4thLevelState != current4thLevelState ) ) #endif { sendOperationStatusEvent(); @@ -340,7 +348,9 @@ // signalAlarmActionToPostTreatmentMode( action ); // break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_OP_MODES_INVALID_MODE_TO_SIGNAL_ACTION, currentMode ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, + SW_FAULT_ID_OP_MODES_INVALID_MODE_TO_SIGNAL_ACTION, + currentMode ) break; } } @@ -450,13 +460,15 @@ broadcastModeIntervalCtr = 0; data.opMode = (U32)currentMode; data.subMode = currentSubMode; - broadcastData( MSG_ID_TD_OP_MODE_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, (U08*)&data, sizeof( OP_MODE_PAYLOAD_T ) ); + broadcastData( MSG_ID_TD_OP_MODE_DATA, COMM_BUFFER_OUT_CAN_TD_BROADCAST, + (U08*)&data, sizeof( OP_MODE_PAYLOAD_T ) ); } } /*********************************************************************//** * @brief * The getConfirmationRequestStatus function returns the status of a confirmation request + * @details \b Message \b Sent: MSG_ID_TD_UI_GENERIC_CONFIRMATION_REQUEST * @details \b Inputs: confirmRequests[] * @details \b Outputs: confirmRequests[] consumed/cleared if completed. * @param requestID ID of confirmation being requested @@ -546,14 +558,17 @@ /*********************************************************************//** * @brief * The addConfirmationRequest function sends a confirmation request to UI + * @details \b Message \b Sent: MSG_ID_TD_UI_GENERIC_CONFIRMATION_REQUEST * @details \b Inputs: confirmRequests[] * @details \b Outputs: confirmRequests[] new added. * @param requestID ID of confirmation being requested * @param requestType Type of confirmation being requested (open, close, reject) * @param rejectReason Reason for reject if type is reject * @return request ID - will be non-zero if added *************************************************************************/ -GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, GENERIC_CONFIRM_COMMAND_T requestType, U32 rejectReason ) +GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, + GENERIC_CONFIRM_COMMAND_T requestType, + U32 rejectReason ) { U32 i; BOOL confirmAlreadyPending = FALSE; Index: firmware/App/Modes/OperationModes.h =================================================================== diff -u -r909d4064e98d5684ee139534f0ac6cbc5f8774d5 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision 909d4064e98d5684ee139534f0ac6cbc5f8774d5) +++ firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -7,8 +7,8 @@ * * @file OperationModes.h * -* @author (last) Sean Nash -* @date (last) 18-Apr-2025 +* @author (last) suresh +* @date (last) 05-Aug-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -72,6 +72,7 @@ void setCurrent4thLevelState( U32 state ); // Set the current 4th level state. void sendOperationStatusEvent( void ); // Constructs and sends operation status event +BOOL handleUIConfirmationResponse( MESSAGE_T *message ); // Handles the confirmation response received from the UI void handleConfirmationDialogTimeout( void ); // Handle timeout for confirmation dialog Index: firmware/App/Modes/StateTxPaused.c =================================================================== diff -u -r8345f0415ce34f2f47afcbf613a00216769f51c6 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Modes/StateTxPaused.c (.../StateTxPaused.c) (revision 8345f0415ce34f2f47afcbf613a00216769f51c6) +++ firmware/App/Modes/StateTxPaused.c (.../StateTxPaused.c) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -106,15 +106,8 @@ setCurrent4thLevelState( NO_SUB_STATE ); // Set user alarm recovery actions allowed in this sub-mode setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); - if ( FALSE ) // TODO ( TRUE == getRinsebackCompleted() ) - { - // block rinseback action if already done - setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); - } - else - { - setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, TRUE ); - } + setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, TRUE ); + setAlarmUserActionEnabled( ALARM_USER_ACTION_TEMPORARY_BREAK, TRUE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_END_TREATMENT, TRUE ); transitionToTxPausedState( currentTxPausedState ); @@ -367,34 +360,27 @@ * The handleTreatmentPausedBloodSittingTimer function handles the no re-circ * blood timer. It should only be called when Blood is NOT circulating. * Increments and checks for warning and alarm timeouts. - * @details Inputs: bloodSittingTimerCtr - * @details Outputs: bloodSittingTimerCtr - * @return next treatment paused state + * @details \b Inputs: bloodSittingTimerCtr + * @details \b Outputs: bloodSittingTimerCtr + * @return none *************************************************************************/ static void handleTreatmentPausedBloodSittingTimer( void ) { // Ensure we do not sit in stopped state for too long (if blood in line) - //if ( getRinsebackCompleted() != TRUE ) // TODO rinseback - if ( TRUE ) + bloodSittingTimerCtr++; + + if ( FALSE == doesAlarmStatusIndicateEndTxOnly() ) // Alarms appropriate only if we are not already at an alarm stop, end Tx only { - bloodSittingTimerCtr++; - if ( FALSE == doesAlarmStatusIndicateEndTxOnly() ) // Alarms appropriate only if we are not already at an alarm stop, end Tx only + if ( bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) { - if ( bloodSittingTimerCtr > WARN_TIME_BLOOD_SITTING ) - { - activateAlarmNoData( ALARM_ID_TD_BLOOD_SITTING_WARNING ); - } - if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) - { - // Activate the alarm - activateAlarmNoData( ALARM_ID_TD_BLOOD_SITTING_TOO_LONG ); - } + activateAlarmNoData( ALARM_ID_TD_BLOOD_SITTING_WARNING ); } + if ( bloodSittingTimerCtr > MAX_TIME_BLOOD_SITTING ) + { + // Activate the alarm + activateAlarmNoData( ALARM_ID_TD_BLOOD_SITTING_TOO_LONG ); + } } - else - { - bloodSittingTimerCtr = 0; - } } /*********************************************************************//** Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -rb30f390acbd6c972d4ecea536b875a409a2c8e77 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision b30f390acbd6c972d4ecea536b875a409a2c8e77) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -7,8 +7,8 @@ * * @file AlarmMgmtSWFaults.h * -* @author (last) Praneeth Bunne -* @date (last) 02-Jul-2026 +* @author (last) Varshini Nagabooshanam +* @date (last) 04-Aug-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -199,8 +199,11 @@ SW_FAULT_ID_PRE_TX_RECIRC_INVALID_STATE = 168, SW_FAULT_ID_TD_VALVES_INVALID_VALVE2 = 169, SW_FAULT_ID_INVALID_TUBE_SET_TYPE = 170, - SW_FAULT_ID_INVALID_RINSEBACK_STATE = 171, - SW_FAULT_ID_TREATMENT_INVALID_RECIRC_STATE = 172, + SW_FAULT_ID_INVALID_MESSAGE_PAYLOAD_LENGTH = 171, + SW_FAULT_ID_TD_BP_DRIVER_STATE = 172, + SW_FAULT_ID_TD_BP_MODULE_STATE = 173, + SW_FAULT_ID_INVALID_RINSEBACK_STATE = 174, + SW_FAULT_ID_TREATMENT_INVALID_RECIRC_STATE = 175, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T; Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r999e1a2f4e499155d934b3aaa93c0ae02161d3c7 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 999e1a2f4e499155d934b3aaa93c0ae02161d3c7) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -7,8 +7,8 @@ * * @file Messaging.c * -* @author (last) Vijay Pamula -* @date (last) 14-Jul-2026 +* @author (last) Varshini Nagabooshanam +* @date (last) 07-Aug-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -21,6 +21,7 @@ #include "AirTrap.h" #include "AlarmMgmt.h" #include "BloodFlow.h" +#include "BPModule.h" #include "Bubbles.h" #include "Buttons.h" #include "Compatible.h" @@ -31,6 +32,8 @@ #include "FpgaTD.h" #include "LevelSensors.h" #include "Messaging.h" +#include "ModeInitPOST.h" +#include "ModePreTreat.h" #include "ModeStandby.h" #include "ModeTreatment.h" #include "OperationModes.h" @@ -113,6 +116,7 @@ { MSG_ID_FW_VERSIONS_REQUEST, &handleVersionRequestMessage }, { MSG_ID_UI_CHECK_IN, &handleUICheckIn }, { MSG_ID_DD_OP_MODE_DATA, &setDDOpMode }, + { MSG_ID_UI_VERSION_INFO_RESPONSE, &handleUIVersionResponse }, { MSG_ID_DD_GEN_DIALYSATE_MODE_DATA, &setDialysateData }, { MSG_ID_DD_PRESSURES_DATA, &setDialysatePressure }, { MSG_ID_UI_TREATMENT_PARAMS_TO_VALIDATE, &validateAndSetTreatmentParameters }, @@ -123,6 +127,7 @@ { MSG_ID_UI_VITALS_ADJUSTMENT_REQUEST, &vitalsAdjustmentHandleChangeRequest }, { MSG_ID_UI_BOLUS_VOLUME_CHANGE_REQUEST, &validateAndSetBolusVolume }, { MSG_ID_UI_INITIATE_TREATMENT_WORKFLOW, &signalUserInitiateTreatment }, + { MSG_ID_UI_START_TREATMENT_REQUEST, &handleStartTreatmentRequest }, { MSG_ID_UI_UF_PAUSE_RESUME_REQUEST, &signalPauseResumeUF }, { MSG_ID_TESTER_LOGIN_REQUEST, &handleTesterLogInRequest }, { MSG_ID_UI_PRESSURE_LIMIT_WIDEN_REQUEST, &pressureLimitHandleWidenRequest }, @@ -136,6 +141,7 @@ { MSG_ID_UI_ADJUST_DISPOSABLES_CONFIRM_REQUEST, &handleAutoLoadRequest }, { MSG_ID_UI_SETUP_TUBING_SET_CONNECTIONS_CONFIRM_REQUEST, &handleSetupTubingSetConnectionConfirmRequest }, { MSG_ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_REQUEST, &handleAutoEjectRequest }, + { MSG_ID_UI_BLOOD_PRESSURE_REQUEST, &bpModuleHandleVitalsRequest }, { MSG_ID_FFU_SIGNAL_TD_UPDATE_AVAILABLE, &handleUpdateAvailable }, { MSG_ID_UI_FLUID_BOLUS_REQUEST, &handleFluidBolusRequest }, { MSG_ID_UI_RINSEBACK_CMD_REQUEST, &signalRinsebackUserAction }, @@ -246,7 +252,6 @@ static MsgFuncPtr getMsgHandler( U16 msgID ); static BOOL sendTestAckResponseMsg( MSG_ID_T msgID, BOOL ack ); -static BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ); /*********************************************************************//** * @brief @@ -405,7 +410,7 @@ * @param ack TRUE to ACK, FALSE to NAK * @return TRUE if response message successfully queued for transmit, FALSE if not *************************************************************************/ -static BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ) +BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ) { BOOL result; MESSAGE_T msg; @@ -532,7 +537,31 @@ return result; } +/*********************************************************************//** + * @brief + * The handleUIVersionResponse function handles a response to request for + * UI version information. + * @details Inputs: none + * @details Outputs: none + * @param message a pointer to the message to handle. + * @return none + *************************************************************************/ +BOOL handleUIVersionResponse( MESSAGE_T *message ) +{ + BOOL result = TRUE; + // Get UI version data and have it recorded + if ( sizeof(UI_VERSIONS_T) == message->hdr.payloadLen ) + { + UI_VERSIONS_T uiVersion; + + memcpy( &uiVersion, &message->payload[ 0 ], sizeof(UI_VERSIONS_T) ); + signalUIVersion( uiVersion ); + } + + return result; +} + // *********************************************************************** // ***************** Message Sending Helper Functions ******************** // *********************************************************************** @@ -577,36 +606,54 @@ /*********************************************************************//** * @brief - * The sendOffButtonMsgToUI function constructs an off button msg to the UI - * and queues the msg for transmit on the appropriate CAN channel. - * @details \b Message \b Sent: MSG_ID_OFF_BUTTON_PRESS_REQUEST + * The sendUIVersionRequest function constructs a UI version request msg + * to the UI and queues the msg for transmit on the appropriate CAN channel. + * @details \b Message \b Sent: MSG_ID_TD_UI_VERSION_INFO_REQUEST * @details \b Inputs: none - * @details \b Outputs: Off button msg constructed and queued. - * @param prompt 0=prompt user to confirm, 1=cancel prompt, 2=reject user off request + * @details \b Outputs: none * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL sendOffButtonMsgToUI( U08 prompt ) +BOOL sendUIVersionRequest( void ) { BOOL result; MESSAGE_T msg; - UI_OFF_BUTTON_RESPONSE_PAYLOAD_T cmd; - cmd.userRequest = prompt; - // Create a message record blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_OFF_BUTTON_PRESS_REQUEST; - msg.hdr.payloadLen = sizeof( UI_OFF_BUTTON_RESPONSE_PAYLOAD_T ); + msg.hdr.msgID = MSG_ID_TD_UI_VERSION_INFO_REQUEST; + msg.hdr.payloadLen = 0; - memcpy( &msg.payload, &cmd, sizeof( UI_OFF_BUTTON_RESPONSE_PAYLOAD_T ) ); - // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_TD_2_UI, ACK_REQUIRED ); return result; } +/*********************************************************************//** + * @brief + * The sendRequestForDDResendAlarms function sends out the TD request for + * DD re-send all active alarms. + * @details \b Inputs: none + * @details \b Outputs: DD alarms re-send request msg constructed and queued + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendRequestForDDResendAlarms( void ) +{ + BOOL result; + MESSAGE_T msg; + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_TD_DD_ALARMS_REQUEST; + msg.hdr.payloadLen = 0; + + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_TD_2_DD, ACK_REQUIRED ); + + return result; +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ @@ -777,6 +824,28 @@ } /*********************************************************************//** + * The sendPOSTTestResult function sends the result of a single TD POST + * test to the UI. + * @details \b Message \b Sent: MSG_ID_TD_POST_SINGLE_TEST_RESULT + * @details \b Inputs: none + * @details \b Outputs: TD POST test result msg queued for CAN transmit. + * @param test ID of the TD POST test. + * @param passed TRUE if POST test passed, FALSE if POST test failed. + * @return TRUE if message successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendPOSTTestResult( TD_POST_STATE_T test, BOOL passed ) +{ + U08 payload[ sizeof( BOOL ) + sizeof( U32 ) ]; + U32 testID = (U32)test; + + memcpy( payload, &passed, sizeof( BOOL ) ); + memcpy( &payload[ sizeof( BOOL ) ], &testID, sizeof( U32 ) ); + + // Use the generic send helper for transmission. + return sendMessage( MSG_ID_TD_POST_SINGLE_TEST_RESULT, COMM_BUFFER_OUT_CAN_TD_BROADCAST, payload, sizeof( payload ) ); +} + +/*********************************************************************//** * @brief * The handleUIConfirmationResponse function handles a UI response for a * confirmation request. @@ -810,6 +879,21 @@ } /*********************************************************************//** + * The sendPOSTFinalResult function sends the overall TD POST result + * and queues the message for transmit on the appropriate CAN channel. + * @details \b Message \b Sent: MSG_ID_TD_POST_FINAL_TEST_RESULT + * @details \b Inputs: none + * @details \b Outputs: TD POST final result msg queued for CAN transmit. + * @param passed TRUE if all TD POST tests passed, FALSE otherwise. + * @return TRUE if message successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendPOSTFinalResult( BOOL passed ) +{ + // Use the generic send helper for transmission. + return sendMessage( MSG_ID_TD_POST_FINAL_TEST_RESULT, COMM_BUFFER_OUT_CAN_TD_BROADCAST, (U08 *)&passed, sizeof( BOOL ) ); +} + +/*********************************************************************//** * @brief * The testTDSoftwareResetRequest function handles a request to reset the * TD firmware processor. Index: firmware/App/Services/Messaging.h =================================================================== diff -u -r999e1a2f4e499155d934b3aaa93c0ae02161d3c7 -rb55b4aad2941b470c5652aad5538a1bbb28a76ed --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision 999e1a2f4e499155d934b3aaa93c0ae02161d3c7) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision b55b4aad2941b470c5652aad5538a1bbb28a76ed) @@ -7,8 +7,8 @@ * * @file Messaging.h * -* @author (last) Praneeth Bunne -* @date (last) 04-Jun-2026 +* @author (last) suresh +* @date (last) 05-Aug-2026 * * @author (original) Sean Nash * @date (original) 01-Aug-2024 @@ -49,6 +49,7 @@ { U08 userRequest; ///< request to confirm, cancel, or reject off button request } UI_OFF_BUTTON_RESPONSE_PAYLOAD_T; + #pragma pack(pop) /// Payload record structure for UI response. @@ -69,6 +70,19 @@ U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) } TREATMENT_PARAM_BROADCAST_PAYLOAD_T; +/// Payload record structure for Pre-Treatment states broadcast. +typedef struct +{ + U32 mSubMode; ///< Current Pre-Treatment state. + U32 mInstallState; ///< Current Tube Set Install state. + U32 mSelfTestDryState; ///< Current Dry Self-Test state. + U32 mPrimeState; ///< Current Prime state. + U32 mRecirculateState; ///< Current Pre-Treatment Recirculate state. + U32 mConfirmRxState; ///< Current Confirm Rx state. + U32 mHeparinState; ///< Current Heparin Setup state. + U32 mPatientConnectionState; ///< Current Patient Connection state. +} PRE_TREATMENT_STATES_DATA_PAYLOAD_T; + /// Institutional record structure containing treatment parameter range limits. typedef struct { @@ -114,6 +128,7 @@ // ACK MSG BOOL sendACKMsg( MESSAGE_T *message ); +BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ); // Handle version request message BOOL handleVersionRequestMessage( MESSAGE_T *message ); @@ -128,13 +143,16 @@ BOOL handleUICheckIn( MESSAGE_T *message ); BOOL handleTesterLogInRequest( MESSAGE_T *message ); BOOL handleUpdateAvailable( MESSAGE_T *message ); +BOOL handleUIVersionResponse( MESSAGE_T *message ); -BOOL testTDSoftwareResetRequest( MESSAGE_T *message ); - // Test send message helper functions BOOL sendEvent( TD_EVENT_ID_T event, EVENT_DATA_T dat1, EVENT_DATA_T dat2 ); -BOOL sendOffButtonMsgToUI( U08 prompt ); +BOOL sendUIVersionRequest( void ); +BOOL sendRequestForDDResendAlarms( void ); +BOOL sendPOSTTestResult( TD_POST_STATE_T test, BOOL passed ); +BOOL sendPOSTFinalResult( BOOL passed ); +BOOL testTDSoftwareResetRequest( MESSAGE_T *message ); BOOL testSetTestConfiguration( MESSAGE_T *message ); BOOL testGetTestConfiguration( MESSAGE_T *message ); BOOL testResetAllTestConfigurations( MESSAGE_T *message );