From 4cdce88ca5e91e5eb97b63bd1caa78b762c967a0 Mon Sep 17 00:00:00 2001 From: Pavel Brychta Date: Tue, 20 Oct 2020 07:51:23 +0200 Subject: [PATCH] Osetreni SSID, konciciho znakem ?, aktivace noveho nastaveni (pozor!!! mozna je problem se statickymi ip adresami - proverit... --- src/WiFiConfig.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/WiFiConfig.cpp b/src/WiFiConfig.cpp index 73de73e..e7a4b95 100644 --- a/src/WiFiConfig.cpp +++ b/src/WiFiConfig.cpp @@ -807,6 +807,12 @@ bool WiFiConfig::_testWifi(wificonfig_cb cb) case WIFIMODE_AP: DEBUG_MSG("AP mode.\r\n"); + if (s.endsWith(F("?"))) { + char lmac[16]; + + sprintf_P(lmac, PSTR("%06X"), ESP_getChipId()); + s.replace(F("?"), String(lmac)); + } WiFi.mode(WIFI_AP); // startujeme AP if (pass.length()) { // je zadane heslo do AP @@ -948,8 +954,10 @@ void WiFiConfig::initConfig(int configBase, const String& ssid, const String& pa setEEPROMuint32(configBase + offsetof(wificonfigarea_t, dns), (uint32_t) dns); } EEPROM.commit(); // ulozime zmeny v EEPROM + _testWifi(nullptr); // nastavime novou WiFi konfiguraci } +// Zastarale - bude brzy odstraneno!!! void WiFiConfigPrepare(int configBase, String ssid, String pass) {