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.
This commit is contained in:
parent
40ddf07c00
commit
ba8a3b48dc
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue