weatherstation/firmware/webserver.ino
2018-06-23 21:49:11 +02:00

28 lines
544 B
C++

//*************************************************************************//
WiFiServer server(80);
void doWebserver(void)
{
WiFiClient client = server.available();
if (client)
{
String request = client.readStringUntil('\r');
if (request.indexOf("/WU") != -1)
{
setupWebUpdater();
webUpdaterEnabled = true; // enable the web update mechanism
} else if (request.indexOf("/RW") != -1)
{
WiFi.disconnect(); // erase the wifi credentials
while(1); // trigger the watchdog
}
}
}