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
6e522d4e
Commit
6e522d4e
authored
4 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Simpler log
parent
591e2082
master
develop
experimental/example_for_iotwebconf
senseair_s8
v0.3.0
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.0
archive/refactor/src_structure
archive/experimental/wifimanager
archive/experimental/simple
archive/experimental/save_lora_session
archive/experimental/save_config
archive/experimental/ota
archive/experimental/binary_clock
archive/experimental/autoconnect
archive/dev/debugcalib
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ampel-firmware/sensor_commands.cpp
+5
-7
ampel-firmware/sensor_commands.cpp
ampel-firmware/web_server.h
+1
-0
ampel-firmware/web_server.h
with
6 additions
and
7 deletions
+6
-7
ampel-firmware/sensor_commands.cpp
+
5
-
7
View file @
6e522d4e
...
...
@@ -5,6 +5,7 @@ namespace sensor_commands {
const
uint8_t
MAX_COMMAND_SIZE
=
30
;
uint8_t
callbacks_count
=
0
;
//TODO: Add example? Add description?
struct
Callback
{
Callback
(
const
char
*
s
=
0
,
void
(
*
f
)(
int32_t
)
=
0
)
:
name
(
s
),
function
(
f
)
{
...
...
@@ -57,22 +58,19 @@ namespace sensor_commands {
}
void
listAvailableCallbacks
()
{
Serial
.
println
(
"DEBUG -
Available commands :"
);
Serial
.
println
(
F
(
"Message not supported. Doing nothing.
Available commands :"
)
)
;
for
(
uint8_t
i
=
0
;
i
<
callbacks_count
;
i
++
)
{
Serial
.
print
(
" "
);
Serial
.
println
(
callbacks
[
i
].
name
);
Serial
.
print
(
callbacks
[
i
].
name
);
Serial
.
println
(
" 1234"
);
}
led_effects
::
showKITTWheel
(
color
::
red
,
1
);
Serial
.
println
(
F
(
"Message not supported. Doing nothing."
));
}
void
run
(
const
char
*
command
)
{
char
function_name
[
MAX_COMMAND_SIZE
];
int32_t
parameter
;
if
(
parseCommand
(
command
,
function_name
,
parameter
))
{
listAvailableCallbacks
();
return
;
}
parseCommand
(
command
,
function_name
,
parameter
);
for
(
uint8_t
i
=
0
;
i
<
callbacks_count
;
i
++
)
{
if
(
!
strcmp
(
function_name
,
callbacks
[
i
].
name
))
{
...
...
This diff is collapsed.
Click to expand it.
ampel-firmware/web_server.h
+
1
-
0
View file @
6e522d4e
...
...
@@ -9,6 +9,7 @@
#include
"config.h"
#include
"util.h"
#include
"co2_sensor.h"
#include
"sensor_commands.h"
#ifdef AMPEL_CSV
# include "csv_writer.h"
#endif
...
...
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