diff --git a/src/meshwifi/meshhttp.cpp b/src/meshwifi/meshhttp.cpp index c2f6ed342..0f8988ddf 100644 --- a/src/meshwifi/meshhttp.cpp +++ b/src/meshwifi/meshhttp.cpp @@ -30,7 +30,7 @@ void initWebServer() // webserver.on("/", handleJSONChatHistory); // webserver.on("/json/chat/history", handleJSONChatHistory); webserver.on("/hotspot-detect.html", handleHotspot); - webserver.on("/", []() { webserver.send(200, "text/plain", "Everything is awesome!"); }); + webserver.on("/", handleRoot); webserver.begin(); } @@ -82,6 +82,11 @@ void handleHotspot() { DEBUG_MSG("Hotspot Request\n"); + /* + If we don't do a redirect, be sure to return a "Success" message + otherwise iOS will have trouble detecting that the connection to the SoftAP worked. + */ + String out = ""; // out += "Success\n"; out += "\n"; @@ -89,6 +94,61 @@ void handleHotspot() return; } +void handleRoot() +{ + DEBUG_MSG("Hotspot Request\n"); + + /* + If we don't do a redirect, be sure to return a "Success" message + otherwise iOS will have trouble detecting that the connection to the SoftAP worked. + */ + + String out = ""; + // out += "Success\n"; + out += "\n" + "\n" + "\n" + "\n" + "Meshtastic - WebUI\n" + "\n" + "\n" + "\n" + "
\n" + "
\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "
Meshtastic - WebUI (Pre-Alpha)
\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "
Channels:
\n" + "
\n" + " #general
\n" + " #stuff
\n" + " #things
\n" + "
Everything is awesome!
\n" + "
\n" + "
\n" + "
\n" + "\n" + "\n"; + webserver.send(200, "text/html", out); + return; +} + void notifyWebUI() { DEBUG_MSG("************ Got a message! ************\n"); diff --git a/src/meshwifi/meshhttp.h b/src/meshwifi/meshhttp.h index 8c607f6fd..b1a5dbb94 100644 --- a/src/meshwifi/meshhttp.h +++ b/src/meshwifi/meshhttp.h @@ -14,3 +14,5 @@ void handleJSONChatHistory(); void notifyWebUI(); void handleHotspot(); + +void handleRoot(); \ No newline at end of file