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.");
|
logger.info("Access granted.");
|
||||||
unauthorizedAccess = false;
|
unauthorizedAccess = false;
|
||||||
doorLock.open();
|
doorLock.open();
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -44,8 +43,9 @@ void DoorLockController::checkForKeys()
|
||||||
logger.error("ACCESS DENIED!");
|
logger.error("ACCESS DENIED!");
|
||||||
unauthorizedAccess = true;
|
unauthorizedAccess = true;
|
||||||
delay(DOOR_OPEN_TIME_MS);
|
delay(DOOR_OPEN_TIME_MS);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue