Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
87fa57ed
Commit
87fa57ed
authored
May 14, 2021
by
Eric Duminil
Browse files
Pointer. possibly not needed
parent
b5fddd0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/web_server.cpp
View file @
87fa57ed
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment