From ba8a3b48dc01b6a66925cdb2c3dcf5ca5e75ba52 Mon Sep 17 00:00:00 2001 From: Lech Date: Wed, 24 Jan 2018 11:06:06 +0100 Subject: [PATCH] DoorLockController: Fix possible multiple-key conflict Ensured that if more than 1 key is available and authentication fails for at least the last one, door will open. This is by ending the loop on 1st available key. --- DoorLockController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DoorLockController.cpp b/DoorLockController.cpp index bea602d..0654257 100644 --- a/DoorLockController.cpp +++ b/DoorLockController.cpp @@ -36,7 +36,6 @@ void DoorLockController::checkForKeys() logger.info("Access granted."); unauthorizedAccess = false; doorLock.open(); - continue; } else { @@ -44,8 +43,9 @@ void DoorLockController::checkForKeys() logger.error("ACCESS DENIED!"); unauthorizedAccess = true; delay(DOOR_OPEN_TIME_MS); - continue; } + + return; } }