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
033bdec3
Commit
033bdec3
authored
May 15, 2021
by
Eric Duminil
Browse files
Callbacks
parent
2a7ecdef
Changes
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/web_server.cpp
View file @
033bdec3
...
...
@@ -76,6 +76,22 @@ namespace web_server {
iotWebConf
->
setStatusPin
(
ONBOARD_LED_PIN
,
HIGH
);
# endif
iotWebConf
->
setWifiConnectionTimeoutMs
(
1000UL
*
WIFI_TIMEOUT
);
iotWebConf
->
setWifiConnectionCallback
([]()
{
led_effects
::
showKITTWheel
(
color
::
green
);
Serial
.
println
();
Serial
.
print
(
F
(
"WiFi - Connected! IP address: "
));
IPAddress
address
=
WiFi
.
localIP
();
snprintf
(
wifi
::
local_ip
,
sizeof
(
wifi
::
local_ip
),
"%d.%d.%d.%d"
,
address
[
0
],
address
[
1
],
address
[
2
],
address
[
3
]);
Serial
.
println
(
wifi
::
local_ip
);
});
iotWebConf
->
setWifiConnectionFailedHandler
([]()
{
led_effects
::
showKITTWheel
(
color
::
red
);
Serial
.
println
(
F
(
"Connection to WiFi failed"
));
return
NULL
;
});
iotWebConf
->
skipApStartup
();
//TODO: Add callbacks
//TODO: Add LED effects
...
...
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