Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
66e24e75
Commit
66e24e75
authored
Feb 10, 2022
by
Eric Duminil
Browse files
A bit cleaner
parent
7b2a157a
Pipeline
#5782
passed with stage
in 2 minutes and 11 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/ampel-firmware.ino
View file @
66e24e75
...
...
@@ -56,10 +56,9 @@
* and define your credentials and parameters in 'config.h'.
*/
iotwebconf
::
WifiAuthInfo
*
failedConnection
()
{
void
failedConnection
()
{
Serial
.
println
(
"Seriously. What???"
);
led_effects
::
showKITTWheel
(
color
::
red
);
return
nullptr
;
}
/*****************************************************************
...
...
ampel-firmware/web_config.cpp
View file @
66e24e75
...
...
@@ -158,12 +158,16 @@ namespace web_config {
iotWebConf
->
doLoop
();
// Listen for HTTP requests from clients
}
void
setWifiConnectionCallback
(
void
(
*
function
)())
{
iotWebConf
->
setWifiConnectionCallback
(
function
);
void
setWifiConnectionCallback
(
void
(
*
success_
function
)())
{
iotWebConf
->
setWifiConnectionCallback
(
success_
function
);
}
void
setWifiFailCallback
(
WifiAuthInfo
*
(
*
function
)())
{
iotWebConf
->
setWifiConnectionFailedHandler
(
function
);
void
setWifiFailCallback
(
void
(
*
fail_function
)())
{
std
::
function
<
WifiAuthInfo
*
()
>
fail_and_return_null
=
[
fail_function
]()
{
fail_function
();
return
nullptr
;
};
iotWebConf
->
setWifiConnectionFailedHandler
(
fail_and_return_null
);
}
void
initialize
()
{
...
...
ampel-firmware/web_config.h
View file @
66e24e75
...
...
@@ -2,7 +2,6 @@
#define AMPEL_WEB_CONFIG_H_
#define STRING_LEN 64
#include
<IotWebConf.h>
#if defined(ESP8266)
# include <ESP8266WebServer.h>
...
...
@@ -51,8 +50,8 @@ namespace config {
namespace
web_config
{
void
initialize
();
void
setWifiConnectionCallback
(
void
(
*
function
)());
void
setWifiFailCallback
(
iotwebconf
::
WifiAuthInfo
*
(
*
function
)());
void
setWifiConnectionCallback
(
void
(
*
success_
function
)());
void
setWifiFailCallback
(
void
(
*
fail_
function
)());
void
update
();
//TODO: Add saveConfig(), for e.g. after custom setters. Or simply reset after each configchange?
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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