mirror of
https://github.com/bitlair/bitlair_doorduino.git
synced 2025-05-13 12:20:07 +02:00
added: only signal authentication failed if denied 3 times in a row
This commit is contained in:
parent
f3c182af9e
commit
cea173f0fa
1 changed files with 16 additions and 5 deletions
|
@ -459,6 +459,7 @@ void ToggleLock()
|
|||
void loop()
|
||||
{
|
||||
uint8_t addr[ADDRSIZE];
|
||||
uint32_t deniedcount = 0;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
|
@ -495,16 +496,26 @@ void loop()
|
|||
SetLEDState(LEDState_Authorized);
|
||||
Serial.print("iButton authenticated\n");
|
||||
ToggleLock();
|
||||
deniedcount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
deniedcount++;
|
||||
if (deniedcount == 3)
|
||||
{
|
||||
Serial.print("iButton not authenticated\n");
|
||||
SetLEDState(LEDState_Busy);
|
||||
digitalWrite(PIN_HORN, HIGH);
|
||||
DelayLEDs(500);
|
||||
digitalWrite(PIN_HORN, LOW);
|
||||
deniedcount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
deniedcount = 0;
|
||||
}
|
||||
|
||||
ProcessLEDs();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue