Commit 87fa57ed authored by Eric Duminil's avatar Eric Duminil
Browse files

Pointer. possibly not needed

parent b5fddd0f
......@@ -60,20 +60,25 @@ namespace web_server {
DNSServer dnsServer;
IotWebConf iotWebConf(ampel.sensorId, &dnsServer, &http, HTTP_PASSWORD);
IotWebConf *iotWebConf;
void update() {
iotWebConf.doLoop();
iotWebConf->doLoop();
// http.handleClient(); // Listen for HTTP requests from clients
}
void initialize() {
iotWebConf.init();
Serial.print("HELLO : ");
Serial.println(ampel.sensorId);
iotWebConf = new IotWebConf(ampel.sensorId, &dnsServer, &http, HTTP_PASSWORD);
iotWebConf->init();
sensor_console::defineCommand("reset_config", []() {
Serial.print("Resetting config...");
iotWebConf.getSystemParameterGroup()->applyDefaultValue();
iotWebConf.saveConfig();
iotWebConf->getSystemParameterGroup()->applyDefaultValue();
iotWebConf->saveConfig();
Serial.println("Done!");
}, F("(resets the complete IotWeb config)"));
......@@ -222,10 +227,10 @@ namespace web_server {
#endif
http.on("/config", [] {
iotWebConf.handleConfig();
iotWebConf->handleConfig();
});
http.onNotFound([]() {
iotWebConf.handleNotFound();
iotWebConf->handleNotFound();
});
// http.begin();
......@@ -244,7 +249,7 @@ namespace web_server {
void handleWebServerRoot() {
// -- Let IotWebConf test and handle captive portal requests.
if (iotWebConf.handleCaptivePortal()) {
if (iotWebConf->handleCaptivePortal()) {
// -- Captive portal request were already served.
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment