Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -1049,7 +1049,17 @@ { if ( ( TRUE == stop ) && ( GENERIC_CONFIRM_ID_NONE == disinfectCancelReqID ) ) { - disinfectCancelReqID = addConfirmationRequest( currentDGCleaningMode.stopRequestCmdID, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + GENERIC_CONFIRMATION_REQUEST_T genericConfRequest; + + genericConfRequest.requestID = (U32)currentDGCleaningMode.stopRequestCmdID; + genericConfRequest.requestType = (U32)GENERIC_CONFIRM_CMD_REQUEST_OPEN; + genericConfRequest.rejectReason = 0; + genericConfRequest.genericPayload1 = 0.0F; + genericConfRequest.genericPayload2 = 0.0F; + genericConfRequest.genericPayload3 = 0.0F; + genericConfRequest.genericPayload4 = 0.0F; + + disinfectCancelReqID = addConfirmationRequest( &genericConfRequest ); } else if ( disinfectCancelReqID != GENERIC_CONFIRM_ID_NONE ) { @@ -1213,10 +1223,21 @@ } else if ( ( TRUE == currentDGCleaningMode.sampleRqstTrgrd ) && ( FALSE == isAlarmActive( ALARM_ID_DG_CHEM_DISINFECT_FLUSH_FLUSH_SAMPLE ) ) ) { + GENERIC_CONFIRMATION_REQUEST_T genericConfRequest; + // Sample flush alarm has been triggered and the user has cleared the alarm by pressing Ok. The user is collecting sample. // Send the notification to the UI to prompt the pass/fail screen so the user can choose whether the sampling after flush passed or failed currentDGCleaningMode.sampleRqstTrgrd = FALSE; - currentDGCleaningMode.sampleRequestID = addConfirmationRequest( GENERIC_CONFIRM_ID_DISINFECT_CHEM_FLUSH_SAMPLE_PASS_FAIL, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + + genericConfRequest.requestID = (U32)GENERIC_CONFIRM_ID_DISINFECT_CHEM_FLUSH_SAMPLE_PASS_FAIL; + genericConfRequest.requestType = (U32)GENERIC_CONFIRM_CMD_REQUEST_OPEN; + genericConfRequest.rejectReason = 0; + genericConfRequest.genericPayload1 = 0.0F; + genericConfRequest.genericPayload2 = 0.0F; + genericConfRequest.genericPayload3 = 0.0F; + genericConfRequest.genericPayload4 = 0.0F; + + currentDGCleaningMode.sampleRequestID = addConfirmationRequest( &genericConfRequest ); } if ( currentDGCleaningMode.sampleRequestID != GENERIC_CONFIRM_ID_NONE ) @@ -1267,10 +1288,21 @@ } else if ( ( TRUE == currentDGCleaningMode.sampleRqstTrgrd ) && ( FALSE == isAlarmActive( ALARM_ID_DG_RO_PERMEATE_SAMPLE_REMOVE_DIA_CAP ) ) ) { + GENERIC_CONFIRMATION_REQUEST_T genericConfRequest; + // Sample flush alarm has been triggered and the user has cleared the alarm by pressing Ok. The user is collecting sample. // Send the notification to the UI to prompt the pass/fail screen so the user can choose whether the sampling after flush passed or failed currentDGCleaningMode.sampleRqstTrgrd = FALSE; - currentDGCleaningMode.sampleRequestID = addConfirmationRequest( GENERIC_CONFIRM_ID_RO_PERMEATE_SAMPLE_STOP_OR_DISPENSE, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + + genericConfRequest.requestID = (U32)GENERIC_CONFIRM_ID_RO_PERMEATE_SAMPLE_STOP_OR_DISPENSE; + genericConfRequest.requestType = (U32)GENERIC_CONFIRM_CMD_REQUEST_OPEN; + genericConfRequest.rejectReason = 0; + genericConfRequest.genericPayload1 = 0.0F; + genericConfRequest.genericPayload2 = 0.0F; + genericConfRequest.genericPayload3 = 0.0F; + genericConfRequest.genericPayload4 = 0.0F; + + currentDGCleaningMode.sampleRequestID = addConfirmationRequest( &genericConfRequest ); } if ( currentDGCleaningMode.sampleRequestID != GENERIC_CONFIRM_ID_NONE ) Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -re2cda12dfbedc1b491efff3d5f76dc6743974feb -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision e2cda12dfbedc1b491efff3d5f76dc6743974feb) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -81,7 +81,6 @@ { U32 requestedTxDurationMins; ///< Requested treatment duration from the user in minutes. F32 newUFRateMLPM; ///< New calculated UF rate in mL/Min. - BOOL isUFRateConfInProgress; ///< Boolean flag to indicate whether a new UF rate confirmation has been requested. } TREATMENT_DURATION_RQST_T; // ********** private data ********** @@ -158,7 +157,6 @@ static TREATMENT_STATE_T handleTreatmentEndState( void ); static void resetSignalFlags( void ); static void resetAlarmSignalFlags( void ); -static void checkUFRateConfirmationMessageFromUI( void ); /*********************************************************************//** * @brief @@ -213,7 +211,6 @@ txDurationRequest.requestedTxDurationMins = 0; txDurationRequest.newUFRateMLPM = 0.0F; - txDurationRequest.isUFRateConfInProgress = FALSE; // reset dialysate temperature alarm persistences prior to starting a treatment. resetPersistentAlarmTimer( ALARM_ID_HD_DIALYSATE_TEMP_ABOVE_SAFETY_TEMP ); @@ -805,8 +802,6 @@ U32 msSinceLast = calcTimeBetween( lastTreatmentTimeStamp, newTime ); DIALYSIS_STATE_T dialysisState = getDialysisState(); - checkUFRateConfirmationMessageFromUI(); - // Update treatment time (unless delivering a saline bolus or is in blood leak zeroing state other than flush reservoir to DPi state) switch ( dialysisState ) { @@ -1103,20 +1098,25 @@ // If the UF volume in the treatment is 0 then send the response back to UI isResp2UINeeded = FALSE; + // Store the proposed treatment duration and the calculated new UF rate until the user approves it txDurationRequest.requestedTxDurationMins = treatmentTime; txDurationRequest.newUFRateMLPM = newUFRateMLPM; - txDurationRequest.isUFRateConfInProgress = TRUE; genericConfRequest.requestID = (U32)GENERIC_CONFIRM_ID_UF_RATE_CHANGE_IN_TX_DURATION_CHANGE; genericConfRequest.requestType = (U32)GENERIC_CONFIRM_CMD_REQUEST_OPEN; genericConfRequest.rejectReason = 0; - genericConfRequest.genericPayload1 = txDurationRequest.newUFRateMLPM; + genericConfRequest.genericPayload1 = ( txDurationRequest.newUFRateMLPM * (F32)MIN_PER_HOUR ) / (F32)ML_PER_LITER; // Convert to L/hr for UI genericConfRequest.genericPayload2 = 0.0F; genericConfRequest.genericPayload3 = 0.0F; genericConfRequest.genericPayload4 = 0.0F; - sendConfirmationRequest( &genericConfRequest ); + addConfirmationRequest( &genericConfRequest ); } + else + { + // Update the treatment time since there is not UF rate chnage that needs approval + presTreatmentTimeSecs = treatmentTime * SEC_PER_MIN; + } } else { @@ -1562,6 +1562,49 @@ /*********************************************************************//** * @brief + * The handleUFRateConfirmationMessageFromUI function handles the UF rate + * message received from UI. It checks whether the accept or reject needs + * to be handled. + * @details Inputs: txDurationRequest + * @details Outputs: presTreatmentTimeSecs, presUFRate, txDurationRequest, + * presMaxUFVolumeML + * @return none + *************************************************************************/ +void handleUFRateConfirmationMessageFromUI( void ) +{ + BOOL result = FALSE; + CONFIRMATION_REQUEST_STATUS_T status = getConfirmationRequestStatus( GENERIC_CONFIRM_ID_UF_RATE_CHANGE_IN_TX_DURATION_CHANGE ); + + if ( ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == status ) || ( CONFIRMATION_REQUEST_STATUS_REJECTED == status ) ) + { + if ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == status ) + { + result = TRUE; + sendTreatmentLogEventData( TREATMENT_DURATION_CHANGE_EVENT, ( presTreatmentTimeSecs / SEC_PER_MIN ), txDurationRequest.requestedTxDurationMins ); + presTreatmentTimeSecs = txDurationRequest.requestedTxDurationMins * SEC_PER_MIN; + presUFRate = txDurationRequest.newUFRateMLPM; + setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, ( presMaxUFVolumeML / (F32)ML_PER_LITER ) ); + setTreatmentParameterU32( TREATMENT_PARAM_TREATMENT_DURATION, ( presTreatmentTimeSecs / SEC_PER_MIN ) ); + setDialysisDialInFlowAndUFRate( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), presMaxUFVolumeML, presUFRate ); + signalInitiatePressureStabilization( USE_NORMAL_STABILIZATION_PERIOD ); + } + + // Regardless of accept or reject there is no reject reason. + sendChangeTreatmentDurationResponse( result, 0, ( presTreatmentTimeSecs / SEC_PER_MIN ), presMaxUFVolumeML ); + // Send new ranges for settings + treatmentParamsRangesBroadcastTimerCtr = getU32OverrideValue( &treatmentParamRangesPublishInterval ); + broadcastTreatmentSettingsRanges(); + // Send time/state data immediately for UI update + broadcastTreatmentTimeAndState(); + + // Done with treatment duration changes whether they were accepted or rejected. + txDurationRequest.newUFRateMLPM = 0.0F; + txDurationRequest.requestedTxDurationMins = 0; + } +} + +/*********************************************************************//** + * @brief * The broadcastTreatmentSettingsRanges function computes and broadcasts * updated treatment parameter ranges that the user may change during treatment. * It is assumed that prescription settings have already been set prior to calling @@ -1717,54 +1760,7 @@ endTreatmentAlarmResponseRequest = FALSE; } -/*********************************************************************//** - * @brief - * The checkUFRateConfirmationMessageFromUI function checks whether a response - * from UI has been received to see if the new UF rate due to change of - * the treatment duration is accepted or rejected. - * @details Inputs: txDurationRequest - * @details Outputs: presTreatmentTimeSecs, presUFRate, txDurationRequest, - * presMaxUFVolumeML - * @return none - *************************************************************************/ -static void checkUFRateConfirmationMessageFromUI( void ) -{ - if ( TRUE == txDurationRequest.isUFRateConfInProgress ) - { - BOOL result = FALSE; - CONFIRMATION_REQUEST_STATUS_T status = getConfirmationRequestStatus( GENERIC_CONFIRM_ID_UF_RATE_CHANGE_IN_TX_DURATION_CHANGE ); - if ( ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == status ) || ( CONFIRMATION_REQUEST_STATUS_REJECTED == status ) ) - { - if ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == status ) - { - result = TRUE; - sendTreatmentLogEventData( TREATMENT_DURATION_CHANGE_EVENT, ( presTreatmentTimeSecs / SEC_PER_MIN ), txDurationRequest.requestedTxDurationMins ); - presTreatmentTimeSecs = txDurationRequest.requestedTxDurationMins * SEC_PER_MIN; - presUFRate = txDurationRequest.newUFRateMLPM; - setTreatmentParameterF32( TREATMENT_PARAM_UF_VOLUME, ( presMaxUFVolumeML / (F32)ML_PER_LITER ) ); - setTreatmentParameterU32( TREATMENT_PARAM_TREATMENT_DURATION, ( presTreatmentTimeSecs / SEC_PER_MIN ) ); - setDialysisDialInFlowAndUFRate( getTreatmentParameterU32( TREATMENT_PARAM_DIALYSATE_FLOW ), presMaxUFVolumeML, presUFRate ); - signalInitiatePressureStabilization( USE_NORMAL_STABILIZATION_PERIOD ); - } - - // Regardless of accept or reject there is no reject reason. - sendChangeTreatmentDurationResponse( result, 0, ( presTreatmentTimeSecs / SEC_PER_MIN ), presMaxUFVolumeML ); - // Send new ranges for settings - treatmentParamsRangesBroadcastTimerCtr = getU32OverrideValue( &treatmentParamRangesPublishInterval ); - broadcastTreatmentSettingsRanges(); - // Send time/state data immediately for UI update - broadcastTreatmentTimeAndState(); - - // Done with treatment duration changes whether they were accepted or rejected. - txDurationRequest.isUFRateConfInProgress = FALSE; - txDurationRequest.newUFRateMLPM = 0.0F; - txDurationRequest.requestedTxDurationMins = 0; - } - } -} - - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Modes/ModeTreatment.h =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/ModeTreatment.h (.../ModeTreatment.h) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -137,6 +137,8 @@ BOOL verifyBloodAndDialysateRateSettingsChange( U32 bloodRate, U32 dialRate ); BOOL verifyPressureLimitsChange( PRESSURE_LIMIT_CHANGE_REQUEST_T *data ); +void handleUFRateConfirmationMessageFromUI( void ); + BOOL testSetTreatmentTimeRemainingOverride( U32 value ); BOOL testSetTreatmentTimePublishIntervalOverride( U32 ms ); BOOL testResetTreatmentTimePublishIntervalOverride( void ); Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r39f3201d30dde0b55188c47239c683156aa36ca3 -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 39f3201d30dde0b55188c47239c683156aa36ca3) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -547,12 +547,10 @@ * The addConfirmationRequest function sends a confirmation request to UI * @details Inputs: confirmRequests[] * @details 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 + * @param request pointer to generic confirmation message request structure * @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_CONFIRMATION_REQUEST_T *request ) { U32 i; BOOL confirmAlreadyPending = FALSE; @@ -561,7 +559,7 @@ // Check to make sure specified confirmation is not already pending for ( i = 0; i < MAX_PENDING_CONFIRM_REQUESTS; i++ ) { - if ( ( confirmRequests[ i ].requestID == requestID ) && + if ( ( confirmRequests[ i ].requestID == request->requestID ) && ( confirmRequests[ i ].status != CONFIRMATION_REQUEST_STATUS_UNUSED ) ) { confirmAlreadyPending = TRUE; @@ -574,26 +572,26 @@ { GENERIC_CONFIRMATION_REQUEST_T genConfRqst; - genConfRqst.rejectReason = rejectReason; - genConfRqst.genericPayload1 = 0.0F; - genConfRqst.genericPayload2 = 0.0F; - genConfRqst.genericPayload3 = 0.0F; - genConfRqst.genericPayload4 = 0.0F; + genConfRqst.rejectReason = request->rejectReason; + genConfRqst.genericPayload1 = request->genericPayload1; + genConfRqst.genericPayload2 = request->genericPayload2; + genConfRqst.genericPayload3 = request->genericPayload3; + genConfRqst.genericPayload4 = request->genericPayload4; for ( i = 0; i < MAX_PENDING_CONFIRM_REQUESTS; i++ ) { if ( CONFIRMATION_REQUEST_STATUS_UNUSED == confirmRequests[ i ].status ) { // Save the confirmation request info - confirmRequests[ i ].requestID = requestID; - confirmRequests[ i ].requestType = requestType; + confirmRequests[ i ].requestID = (GENERIC_CONFIRM_ID_T)request->requestID; + confirmRequests[ i ].requestType = (GENERIC_CONFIRM_COMMAND_T)request->requestType; confirmRequests[ i ].timeStamp = getMSTimerCount(); confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_PENDING; - newID = requestID; + newID = (GENERIC_CONFIRM_ID_T)request->requestID; // Get ready for the generic confirmation request - genConfRqst.requestID = (U32)requestID; - genConfRqst.requestType = (U32)requestType; + genConfRqst.requestID = request->requestID; + genConfRqst.requestType = request->requestType; sendConfirmationRequest( &genConfRqst ); break; Index: firmware/App/Modes/OperationModes.h =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -40,6 +40,18 @@ U32 subMode; ///< Current sub-mode of current operating mode } OP_MODE_PAYLOAD_T; +/// Payload structure for generic confirmation request +typedef struct +{ + U32 requestID; ///< Generic request ID. + U32 requestType; ///< Generic request type. + U32 rejectReason; ///< Reject reason. + F32 genericPayload1; ///< Generic payload 1. + F32 genericPayload2; ///< Generic payload 2. + F32 genericPayload3; ///< Generic payload 3. + F32 genericPayload4; ///< Generic payload 4. +} GENERIC_CONFIRMATION_REQUEST_T; + // ********** public function prototypes ********** void initOperationModes( void ); // Initialize this module @@ -51,7 +63,9 @@ void initiateAlarmAction( ALARM_ACTION_T action ); // Initiate an alarm or alarm recovery action according to current op mode CONFIRMATION_REQUEST_STATUS_T getConfirmationRequestStatus( GENERIC_CONFIRM_ID_T requestID ); // Get the current confirmation request status void setConfirmationRequestStatus( GENERIC_CONFIRM_ID_T requestID, CONFIRMATION_REQUEST_STATUS_T status ); // Set the confirmation request status -GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, GENERIC_CONFIRM_COMMAND_T requestType, U32 rejectReason ); // Add a new confirmation request + +GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRMATION_REQUEST_T *request ); // Add a new confirmation request + void setCurrentSubState( U32 subState ); // Set the current substate. void setCurrent4thLevelState( U32 state ); // Set the current 4th level state. void sendOperationStatusEvent( void ); // Constructs and sends operation status event Index: firmware/App/Modes/Rinseback.c =================================================================== diff -u -r5abe83b5825151a96e9684c97e5d8804d6108684 -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 5abe83b5825151a96e9684c97e5d8804d6108684) +++ firmware/App/Modes/Rinseback.c (.../Rinseback.c) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -685,6 +685,7 @@ *************************************************************************/ void signalRinsebackUserAction( REQUESTED_RINSEBACK_USER_ACTIONS_T action ) { + GENERIC_CONFIRMATION_REQUEST_T genericConfRequest; BOOL accepted = FALSE; REQUEST_REJECT_REASON_CODE_T rejReason = REQUEST_REJECT_REASON_NONE; @@ -726,8 +727,16 @@ break; case REQUESTED_USER_ACTION_RINSEBACK_END_TREATMENT: + genericConfRequest.requestID = (U32)GENERIC_CONFIRM_ID_TREATMENT_END; + genericConfRequest.requestType = (U32)GENERIC_CONFIRM_CMD_REQUEST_OPEN; + genericConfRequest.rejectReason = 0; + genericConfRequest.genericPayload1 = 0.0F; + genericConfRequest.genericPayload2 = 0.0F; + genericConfRequest.genericPayload3 = 0.0F; + genericConfRequest.genericPayload4 = 0.0F; + // Send message to UI to get user confirmation to end treatment - action initiated only upon receipt of user confirmation from UI - addConfirmationRequest( GENERIC_CONFIRM_ID_TREATMENT_END, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + addConfirmationRequest( &genericConfRequest ); accepted = TRUE; break; Index: firmware/App/Modes/TreatmentRecirc.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/TreatmentRecirc.c (.../TreatmentRecirc.c) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -351,6 +351,7 @@ *************************************************************************/ void signalTreatmentRecircUserAction( REQUESTED_TREATMENT_RECIRC_USER_ACTIONS_T action ) { + GENERIC_CONFIRMATION_REQUEST_T genericConfRequest; BOOL accepted = FALSE; REQUEST_REJECT_REASON_CODE_T rejReason = REQUEST_REJECT_REASON_NONE; @@ -372,8 +373,16 @@ break; case REQUESTED_USER_ACTION_TX_RECIRC_END_TREATMENT: + genericConfRequest.requestID = (U32)GENERIC_CONFIRM_ID_TREATMENT_END; + genericConfRequest.requestType = (U32)GENERIC_CONFIRM_CMD_REQUEST_OPEN; + genericConfRequest.rejectReason = 0; + genericConfRequest.genericPayload1 = 0.0F; + genericConfRequest.genericPayload2 = 0.0F; + genericConfRequest.genericPayload3 = 0.0F; + genericConfRequest.genericPayload4 = 0.0F; + // Send message to UI to get user confirmation to end treatment - action initiated only upon receipt of user confirmation from UI - addConfirmationRequest( GENERIC_CONFIRM_ID_TREATMENT_END, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + addConfirmationRequest( &genericConfRequest ); accepted = TRUE; break; Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r3309dc1279d58aef3ed325ecf2ad21f5acd7b9b5 -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 3309dc1279d58aef3ed325ecf2ad21f5acd7b9b5) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -624,6 +624,7 @@ // Ignore alarm action if invalid or too soon after last one (essentially a debounce in case user double tapped a button) if ( ( TRUE == alarmActionIsValid ) && ( calcTimeSince( lastUserAlarmActionReceivedTime ) >= MIN_TIME_BETWEEN_ALARM_ACTIONS_MS ) ) { + GENERIC_CONFIRMATION_REQUEST_T genericConfRequest; BOOL allRecAlarmsCleared = TRUE; // Clear recoverable alarms on user action @@ -665,8 +666,16 @@ break; case ALARM_USER_ACTION_END_TREATMENT: + genericConfRequest.requestID = (U32)GENERIC_CONFIRM_ID_TREATMENT_END; + genericConfRequest.requestType = (U32)GENERIC_CONFIRM_CMD_REQUEST_OPEN; + genericConfRequest.rejectReason = 0; + genericConfRequest.genericPayload1 = 0.0F; + genericConfRequest.genericPayload2 = 0.0F; + genericConfRequest.genericPayload3 = 0.0F; + genericConfRequest.genericPayload4 = 0.0F; + // Send message to UI to get user confirmation to end treatment - action initiated only upon receipt of user confirmation from UI - addConfirmationRequest( GENERIC_CONFIRM_ID_TREATMENT_END, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + addConfirmationRequest( &genericConfRequest ); break; case ALARM_USER_ACTION_ACK: Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rbdbb0ede1af201d43125d663a4ca5740e39509f6 -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision bdbb0ede1af201d43125d663a4ca5740e39509f6) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -3489,10 +3489,17 @@ payloadPtr += sizeof(U32); memcpy( &status, payloadPtr, sizeof(U32) ); - if ( ( CONFIRMATION_REQUEST_STATUS_REJECTED == status ) || - ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == status ) ) + if ( ( CONFIRMATION_REQUEST_STATUS_REJECTED == status ) || ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == status ) ) { setConfirmationRequestStatus( (GENERIC_CONFIRM_ID_T)request_id, (CONFIRMATION_REQUEST_STATUS_T)status ); + + if ( GENERIC_CONFIRM_ID_UF_RATE_CHANGE_IN_TX_DURATION_CHANGE == (GENERIC_CONFIRM_ID_T)request_id ) + { + // If the user selected accept or reject on the UF rate change ID, call the below function to handle the signal + // This is to make sure if during the UF rate change process the HD Software transitioned to treatment stop, standby, fault + // or other modes the screen is not left open. + handleUFRateConfirmationMessageFromUI(); + } } } Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r39f3201d30dde0b55188c47239c683156aa36ca3 -r56ae47b6766bed3f138fa3f1989431d7a439ea7a --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 39f3201d30dde0b55188c47239c683156aa36ca3) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 56ae47b6766bed3f138fa3f1989431d7a439ea7a) @@ -137,18 +137,6 @@ U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) } TREATMENT_PARAM_BROADCAST_PAYLOAD_T; -/// Payload structure for generic confirmation request -typedef struct -{ - U32 requestID; ///< Generic request ID. - U32 requestType; ///< Generic request type. - U32 rejectReason; ///< Reject reason. - F32 genericPayload1; ///< Generic payload 1. - F32 genericPayload2; ///< Generic payload 2. - F32 genericPayload3; ///< Generic payload 3. - F32 genericPayload4; ///< Generic payload 4. -} GENERIC_CONFIRMATION_REQUEST_T; - // ********** public function prototypes ********** // Serialize message