From 518b1b43c80f8934125f934876feb66dd57e2278 Mon Sep 17 00:00:00 2001 From: Pavel Brychta Date: Wed, 27 Oct 2021 10:22:59 +0200 Subject: [PATCH] Moznost zapnout ArduinoOTA i pri bezicim konfiguracnim AP --- src/WiFiConfig.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/WiFiConfig.cpp b/src/WiFiConfig.cpp index 51ccfa5..e97e20f 100644 --- a/src/WiFiConfig.cpp +++ b/src/WiFiConfig.cpp @@ -11,6 +11,9 @@ # include # include #endif +#ifdef USE_WIFICONFIG_ARDUINO_OTA +# include +#endif #if defined(ESP8266) // ESP8266 @@ -628,6 +631,9 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb) yield(); }); #endif +#ifdef USE_WIFICONFIG_ARDUINO_OTA + ArduinoOTA.begin(); +#endif #ifdef USE_WIFICONFIG_FSEDITOR #if 0 #if defined(ESP8266) @@ -661,6 +667,9 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb) if (cb) cb(WCS_CONFIGWAIT); // volame uzivatelsky callback (napr. signalizace) dnsServer->processNextRequest(); +#ifdef USE_WIFICONFIG_ARDUINO_OTA + ArduinoOTA.handle(); +#endif yield(); // procesy uvnitr systemu ESP potrebuji take svuj cas if (_timeout) { if (millis() > _time) { @@ -674,6 +683,9 @@ wificonfigresult_t WiFiConfig::_setupAP(wificonfig_cb cb) // tady by asi melo byt zastaveni weboveho a dns serveru... dnsServer->stop(); server->end(); +#ifdef USE_WIFICONFIG_ARDUINO_OTA + ArduinoOTA.end(); +#endif return WCR_TIMEOUT; // nepripojeno, vyprsel timeout konfiguracniho AP }