mirror of
https://gitlab.com/fabinfra/fabhardware/fabreader.git
synced 2025-03-13 07:01:44 +01:00
Added: Reader Timeoute
This commit is contained in:
parent
0670e33f12
commit
67a4537882
@ -23,6 +23,9 @@ PubSubClient* mqtt;
|
|||||||
NFC* nfc;
|
NFC* nfc;
|
||||||
OTAProxy* ota;
|
OTAProxy* ota;
|
||||||
|
|
||||||
|
unsigned long otatimeout = 3000;
|
||||||
|
unsigned long lastotatime;
|
||||||
|
|
||||||
void setup_wifi()
|
void setup_wifi()
|
||||||
{
|
{
|
||||||
delay(10);
|
delay(10);
|
||||||
@ -125,8 +128,16 @@ void loop()
|
|||||||
if(nfc->connecttoCard())
|
if(nfc->connecttoCard())
|
||||||
{
|
{
|
||||||
Serial.println("Card connected");
|
Serial.println("Card connected");
|
||||||
|
lastotatime = millis();
|
||||||
ota->startOTA();
|
ota->startOTA();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(ota->hasActiveOTA())
|
||||||
|
{
|
||||||
|
if(millis() - lastotatime > otatimeout)
|
||||||
|
{
|
||||||
|
ota->cancelOTA();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user