Osetreni SSID, konciciho znakem ?, aktivace noveho nastaveni (pozor!!! mozna je problem se statickymi ip adresami - proverit...

This commit is contained in:
Pavel Brychta 2020-10-20 07:51:23 +02:00
parent 6f1dd6a7ba
commit 4cdce88ca5

View File

@ -807,6 +807,12 @@ bool WiFiConfig::_testWifi(wificonfig_cb cb)
case WIFIMODE_AP: case WIFIMODE_AP:
DEBUG_MSG("AP mode.\r\n"); 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 WiFi.mode(WIFI_AP); // startujeme AP
if (pass.length()) { if (pass.length()) {
// je zadane heslo do AP // 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); setEEPROMuint32(configBase + offsetof(wificonfigarea_t, dns), (uint32_t) dns);
} }
EEPROM.commit(); // ulozime zmeny v EEPROM EEPROM.commit(); // ulozime zmeny v EEPROM
_testWifi(nullptr); // nastavime novou WiFi konfiguraci
} }
// Zastarale - bude brzy odstraneno!!!
void WiFiConfigPrepare(int configBase, String ssid, String pass) void WiFiConfigPrepare(int configBase, String ssid, String pass)
{ {