Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r6042952abe8c5b39b4d64c3f13f832713bcfb79a -r549fea9aba0bc5bc03d195d1a5659261e3ace9d0 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 6042952abe8c5b39b4d64c3f13f832713bcfb79a) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 549fea9aba0bc5bc03d195d1a5659261e3ace9d0) @@ -507,16 +507,16 @@ confirm_id = GENERIC_CONFIRM_ID_DISINFECT_STOP_CHEMICAL; } // Send message to UI to indicate user request to cancel disinfect - disinfectCancelReqID = sendConfirmationRequest( confirm_id, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); + disinfectCancelReqID = addConfirmationRequest( confirm_id, GENERIC_CONFIRM_CMD_REQUEST_OPEN, 0 ); } else if ( GENERIC_CONFIRM_ID_NONE != disinfectCancelReqID ) { - confirm_status = checkConfirmationRequestStatus( disinfectCancelReqID ); + // Get the confirmation request. It consumes the request if completed and responds to UI. + confirm_status = getConfirmationRequestStatus( disinfectCancelReqID ); switch ( confirm_status ) { case CONFIRMATION_REQUEST_STATUS_ACCEPTED : - // send a accept close to UI, don't save request id because there will be no response - sendConfirmationRequest( disinfectCancelReqID, GENERIC_CONFIRM_CMD_ACCEPT_CLOSE, 0 ); + // Clear request active status disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; switch ( currentStandbyState ) @@ -534,22 +534,20 @@ break; default: - // Close the UI Confirm - sendConfirmationRequest( disinfectCancelReqID, GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE, 0 ); + // UI Confirm already closed. Nothing to do. break; } break; case CONFIRMATION_REQUEST_STATUS_TIMEOUT : - // send a cancel to UI, don't save request id because there will be no response - sendConfirmationRequest( disinfectCancelReqID, GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE, 0 ); + case CONFIRMATION_REQUEST_STATUS_REJECTED : + // Clear request active status disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; break; - case CONFIRMATION_REQUEST_STATUS_REJECTED : - // UI rejected, cancel pending request - sendConfirmationRequest( disinfectCancelReqID, GENERIC_CONFIRM_CMD_ACCEPT_CLOSE, 0 ); - disinfectCancelReqID = GENERIC_CONFIRM_ID_NONE; + case CONFIRMATION_REQUEST_STATUS_PENDING: + case CONFIRMATION_REQUEST_STATUS_UNUSED: + // Nothing to do break; default :