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