Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
7b2a157a
Commit
7b2a157a
authored
3 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Ugly, but seems to work
parent
f5b118ba
master
develop
experimental/example_for_iotwebconf
senseair_s8
v0.3.0
archive/experimental/save_lora_session
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ampel-firmware/ampel-firmware.ino
+12
-4
ampel-firmware/ampel-firmware.ino
ampel-firmware/web_config.cpp
+2
-5
ampel-firmware/web_config.cpp
ampel-firmware/web_config.h
+2
-1
ampel-firmware/web_config.h
with
16 additions
and
10 deletions
+16
-10
ampel-firmware/ampel-firmware.ino
+
12
-
4
View file @
7b2a157a
...
...
@@ -56,6 +56,12 @@
* and define your credentials and parameters in 'config.h'.
*/
iotwebconf
::
WifiAuthInfo
*
failedConnection
()
{
Serial
.
println
(
"Seriously. What???"
);
led_effects
::
showKITTWheel
(
color
::
red
);
return
nullptr
;
}
/*****************************************************************
* Setup *
*****************************************************************/
...
...
@@ -89,10 +95,12 @@ void setup() {
Serial
.
println
(
WiFi
.
localIP
());
});
web_config
::
setWifiConnectionFailedCallback
([]()
{
led_effects
::
showKITTWheel
(
color
::
red
);
Serial
.
println
(
F
(
"Connection to WiFi failed"
));
});
web_config
::
setWifiFailCallback
(
failedConnection
);
// web_config::setWifiConnectionFailedCallback([]() {
// led_effects::showKITTWheel(color::red);
// Serial.println(F("Connection to WiFi failed"));
// });
#endif
pinMode
(
0
,
INPUT
);
// Flash button (used for forced calibration)
...
...
This diff is collapsed.
Click to expand it.
ampel-firmware/web_config.cpp
+
2
-
5
View file @
7b2a157a
...
...
@@ -162,11 +162,8 @@ namespace web_config {
iotWebConf
->
setWifiConnectionCallback
(
function
);
}
void
setWifiConnectionFailedCallback
(
void
(
*
function
)())
{
iotWebConf
->
setWifiConnectionFailedHandler
([
&
function
]()
->
WifiAuthInfo
*
{
function
();
return
NULL
;
});
void
setWifiFailCallback
(
WifiAuthInfo
*
(
*
function
)())
{
iotWebConf
->
setWifiConnectionFailedHandler
(
function
);
}
void
initialize
()
{
...
...
This diff is collapsed.
Click to expand it.
ampel-firmware/web_config.h
+
2
-
1
View file @
7b2a157a
...
...
@@ -2,6 +2,7 @@
#define AMPEL_WEB_CONFIG_H_
#define STRING_LEN 64
#include
<IotWebConf.h>
#if defined(ESP8266)
# include <ESP8266WebServer.h>
...
...
@@ -51,7 +52,7 @@ namespace config {
namespace
web_config
{
void
initialize
();
void
setWifiConnectionCallback
(
void
(
*
function
)());
void
setWifi
Connection
Fail
ed
Callback
(
void
(
*
function
)());
void
setWifiFailCallback
(
iotwebconf
::
WifiAuthInfo
*
(
*
function
)());
void
update
();
//TODO: Add saveConfig(), for e.g. after custom setters. Or simply reset after each configchange?
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets