Added: Reader Timeoute

This commit is contained in:
TheJoKlLa 2022-10-31 20:36:08 +01:00
parent 0670e33f12
commit 67a4537882

View File

@ -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();
}
}
}