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
aab7df5d
Commit
aab7df5d
authored
Feb 15, 2022
by
Eric Duminil
Browse files
Done
parent
e588950d
Pipeline
#5834
passed with stage
in 2 minutes and 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/web_config.cpp
View file @
aab7df5d
...
...
@@ -130,9 +130,9 @@ namespace web_config {
TextTParameter
<
STRING_LEN
>
ntpServerParam
=
Builder
<
TextTParameter
<
STRING_LEN
>>
(
"ntp_server"
).
label
(
"NTP Server"
).
defaultValue
(
NTP_SERVER
).
build
();
IntTParameter
<
int16_t
>
timeOffsetParam
=
Builder
<
IntTParameter
<
int16_t
>>
(
"timezone"
).
label
(
"Timezone"
).
defaultValue
(
UTC_OFFSET
).
min
(
-
23
).
max
(
23
).
step
(
1
).
placeholder
(
"[h]"
).
build
();
UTC_OFFSET
).
min
(
-
23
).
max
(
23
).
step
(
1
).
placeholder
(
"[h]"
).
build
();
CheckboxTParameter
dstParam
=
Builder
<
CheckboxTParameter
>
(
"dst"
).
label
(
"Daylight Saving Time?"
).
defaultValue
(
DAYLIGHT_SAVING_TIME
).
build
();
DAYLIGHT_SAVING_TIME
).
build
();
/**
* LoRaWAN
...
...
@@ -149,7 +149,6 @@ namespace web_config {
LORAWAN_APPLICATION_EUI
).
build
();
TextTParameter
<
33
>
appKeyParam
=
Builder
<
TextTParameter
<
33
>>
(
"app_key"
).
label
(
"App key (MSB)"
).
defaultValue
(
LORAWAN_APPLICATION_KEY
).
build
();
#endif
OptionalGroupHtmlFormatProvider
optionalGroupHtmlFormatProvider
;
...
...
@@ -172,7 +171,7 @@ namespace web_config {
}
void
initialize
()
{
iotWebConf
=
new
IotWebConf
(
ampel
.
sensorId
,
&
dnsServer
,
&
http
,
AMPEL_PASSWORD
,
config_version
);
iotWebConf
=
new
IotWebConf
(
ampel
.
sensorId
,
&
dnsServer
,
&
http
,
""
,
config_version
);
iotWebConf
->
setHtmlFormatProvider
(
&
optionalGroupHtmlFormatProvider
);
...
...
@@ -182,6 +181,10 @@ namespace web_config {
iotWebConf
->
getThingNameParameter
()
->
label
=
"Ampel name"
;
iotWebConf
->
getApPasswordParameter
()
->
label
=
"Ampel password (user : 'admin')"
;
iotWebConf
->
getApPasswordParameter
()
->
defaultValue
=
AMPEL_PASSWORD
;
iotWebConf
->
getWifiSsidParameter
()
->
defaultValue
=
WIFI_SSID
;
iotWebConf
->
getWifiPasswordParameter
()
->
defaultValue
=
WIFI_PASSWORD
;
co2Params
.
addItem
(
&
timestepParam
);
co2Params
.
addItem
(
&
temperatureOffsetParam
);
co2Params
.
addItem
(
&
altitudeParam
);
...
...
@@ -257,14 +260,10 @@ namespace web_config {
iotWebConf
->
skipApStartup
();
//TODO: Add callbacks
//TODO: Add default values for SSID/password
//TODO: Save LoRaWAN key if possible?
iotWebConf
->
init
();
//TODO: Authenticate only if required?
//TODO: / captive fast return?
http
.
on
(
"/config"
,
[]
{
iotWebConf
->
handleConfig
();
});
...
...
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