diff --git a/WiFiManager.cpp b/WiFiManager.cpp index d91bace..67f2cc3 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -586,13 +586,14 @@ uint8_t WiFiManager::connectWifi(String ssid, String pass) { // Setup static IP config if provided if (_sta_static_ip) { - if(_sta_static_dns) { + if(_sta_static_dns) { DEBUG_WM(DEBUG_VERBOSE,F("Custom STA IP/GW/Subnet/DNS")); - WiFi.config(_sta_static_ip, _sta_static_gw, _sta_static_sn, _sta_static_dns); - } else { + WiFi.config(_sta_static_ip, _sta_static_gw, _sta_static_sn, _sta_static_dns); + } + else { DEBUG_WM(DEBUG_VERBOSE,F("Custom STA IP/GW/Subnet")); WiFi.config(_sta_static_ip, _sta_static_gw, _sta_static_sn); - } + } DEBUG_WM(WiFi.localIP()); } @@ -958,7 +959,7 @@ String WiFiManager::getStaticOut(){ // WiFi.gatewayIP().toString(); page += getIpForm(FPSTR(S_sn),FPSTR(S_subnet),(_sta_static_sn ? _sta_static_sn.toString() : "")); // @token subnet // WiFi.subnetMask().toString(); - if(_sta_static_dns) page += getIpForm(FPSTR(S_dns),FPSTR(S_staticdns),(_sta_static_dns ? _sta_static_dns.toString() : "")); // @token DNS + page += getIpForm(FPSTR(S_dns),FPSTR(S_staticdns),(_sta_static_dns ? _sta_static_dns.toString() : "")); // @token dns page += FPSTR(HTTP_BR); // @todo remove these, use css } return page; diff --git a/WiFiManager.h b/WiFiManager.h index e5509c2..5eebf6b 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -174,8 +174,8 @@ class WiFiManager void setAPStaticIPConfig(IPAddress ip, IPAddress gw, IPAddress sn); //sets config for a static IP void setSTAStaticIPConfig(IPAddress ip, IPAddress gw, IPAddress sn); - //sets config for a static IP with DNS - void setSTAStaticIPConfig(IPAddress ip, IPAddress gw, IPAddress sn, IPAddress dns); + //sets config for a static IP with DNS + void setSTAStaticIPConfig(IPAddress ip, IPAddress gw, IPAddress sn, IPAddress dns); //called when AP mode and config portal is started void setAPCallback( void (*func)(WiFiManager*) ); //called when settings have been changed and connection was successful @@ -248,7 +248,7 @@ class WiFiManager IPAddress _sta_static_ip; IPAddress _sta_static_gw; IPAddress _sta_static_sn; - IPAddress _sta_static_dns; + IPAddress _sta_static_dns; // defaults const byte DNS_PORT = 53;