move common network code to seperate class

This commit is contained in:
technyon
2022-07-02 12:04:03 +02:00
parent cb35eae2f7
commit beb87a959f
12 changed files with 549 additions and 411 deletions

View File

@@ -4,7 +4,7 @@
#include "hardware/WifiEthServer.h"
#include <esp_task_wdt.h>
WebCfgServer::WebCfgServer(NukiWrapper* nuki, NukiOpenerWrapper* nukiOpener, NetworkLock* network, EthServer* ethServer, Preferences* preferences, bool allowRestartToPortal)
WebCfgServer::WebCfgServer(NukiWrapper* nuki, NukiOpenerWrapper* nukiOpener, Network* network, EthServer* ethServer, Preferences* preferences, bool allowRestartToPortal)
: _server(ethServer),
_nuki(nuki),
_nukiOpener(nukiOpener),
@@ -106,7 +106,7 @@ void WebCfgServer::initialize()
buildConfirmHtml(response, "Restarting. Connect to ESP access point to reconfigure WiFi.", 0);
_server.send(200, "text/html", response);
waitAndProcess(true, 2000);
_network->restartAndConfigureWifi();
_network->reconfigureDevice();
}
});
_server.on("/method=get", [&]() {