diff --git a/src/WiFiSettingsService.cpp b/src/WiFiSettingsService.cpp index a9c1296..2f65d5e 100644 --- a/src/WiFiSettingsService.cpp +++ b/src/WiFiSettingsService.cpp @@ -61,10 +61,11 @@ void WiFiSettingsService::reconfigureWiFiConnection() { // disconnect and de-configure wifi and software access point WiFi.disconnect(true); - // configure static ip config for station mode (if set) + // configure for static IP if (_staticIPConfig) { WiFi.config(_localIP, _gatewayIP, _subnetMask, _dnsIP1, _dnsIP2); - } else { // else setting dynamic ip config and hostname + } else { + // configure for DHCP #if defined(ESP8266) WiFi.config(INADDR_ANY, INADDR_ANY, INADDR_ANY); WiFi.hostname(_hostname); @@ -79,7 +80,7 @@ void WiFiSettingsService::reconfigureWiFiConnection() { } void WiFiSettingsService::readIP(JsonObject& root, String key, IPAddress& _ip){ - if ( !root[key].is() || !_ip.fromString(root[key].as())){ + if (!root[key].is() || !_ip.fromString(root[key].as())){ _ip = INADDR_NONE; } }