diff --git a/BrewManiacEx/BrewManiacEx.ino b/BrewManiacEx/BrewManiacEx.ino index 08c10c2..db87964 100644 --- a/BrewManiacEx/BrewManiacEx.ino +++ b/BrewManiacEx/BrewManiacEx.ino @@ -36,6 +36,9 @@ extern void brewmaniac_setup(); extern void brewmaniac_loop(); + +#define ResponseAppleCNA true + /**************************************************************************************/ /**************************************************************************************/ @@ -161,6 +164,7 @@ R"END( } )END"; +void requestRestart(bool disc); class NetworkConfig:public AsyncWebHandler { @@ -189,6 +193,12 @@ public: request->send(400); return; } + if(root.containsKey("disconnect")){ + requestRestart(true); + request->send(200); + return; + } + File config=SPIFFS.open(CONFIG_FILENAME,"w+"); if(!config){ request->send(500); @@ -538,16 +548,37 @@ void bmwEventHandler(BrewManiacWeb* bmw, BmwEventType event) } } +#if ResponseAppleCNA == true -HttpUpdateHandler httpUpdateHandler(FIRMWARE_UPDATE_URL,JS_UPDATE_URL); -unsigned long _connectionTime; -byte _wifiState; +class AppleCNAHandler: public AsyncWebHandler +{ +public: + AppleCNAHandler(){} + void handleRequest(AsyncWebServerRequest *request){ + request->send(200, "text/html", "