@@ -300,30 +300,7 @@ bool webServerAssignResources(int httpPort = 80)
300300 dnsserver->start ();
301301 }
302302
303- // Start the server with a given IP
304- if (WiFi.getMode () == WIFI_MODE_APSTA)
305- {
306- // If we are connected to a local AP, use that IP
307- if (settings.wifiConfigOverAP == false && wifiIsConnected ())
308- webServer = new WebServer (WiFi.localIP (), httpPort);
309- else // Use our own AP's IP
310- webServer = new WebServer (WiFi.softAPIP (), httpPort);
311- }
312- else if (WiFi.getMode () == WIFI_MODE_AP)
313- webServer = new WebServer (WiFi.softAPIP (), httpPort);
314- else if (WiFi.getMode () == WIFI_MODE_STA)
315- webServer = new WebServer (WiFi.localIP (), httpPort);
316-
317- // If WiFi is off, fall back to ethernet
318- else if (WiFi.getMode () == WIFI_OFF && present.ethernet_ws5500 )
319- webServer = new WebServer (ETH.localIP (), httpPort);
320-
321- else
322- {
323- systemPrintln (" Error: Unknown WebServer connection mode." );
324- return (false );
325- }
326-
303+ webServer = new WebServer (httpPort);
327304 if (!webServer)
328305 {
329306 systemPrintln (" ERROR: Failed to allocate webServer" );
@@ -466,10 +443,9 @@ bool webServerAssignResources(int httpPort = 80)
466443 webServer->send_P (200 , " text/plain" , (const char *)icomoon_woof, sizeof (icomoon_woof));
467444 });
468445
469- // https://lemariva.com/blog/2017/11/white-hacking-wemos-captive-portal-using-micropython
470- webServer->on (" /connecttest.txt" , HTTP_GET, []() {
471- webServer->send (200 , " text/plain" , " Microsoft Connect Test" );
472- });
446+ // https://lemariva.com/blog/2017/11/white-hacking-wemos-captive-portal-using-micropython
447+ webServer->on (" /connecttest.txt" , HTTP_GET,
448+ []() { webServer->send (200 , " text/plain" , " Microsoft Connect Test" ); });
473449
474450 // Handler for the /uploadFile form POST
475451 webServer->on (
@@ -1132,7 +1108,7 @@ void createDynamicDataString(char *settingsCSV)
11321108
11331109 stringRecord (settingsCSV, " batteryIconFileName" , batteryIconFileName);
11341110
1135- // Limit batteryLevelPercent to sane levels
1111+ // Limit batteryLevelPercent to sane levels
11361112 if (batteryLevelPercent > 100 )
11371113 batteryLevelPercent = 100 ;
11381114
0 commit comments