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
755f8578
Commit
755f8578
authored
4 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Looking for corresponding code
parent
96d9138d
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ampel-firmware/sensor_commands.cpp
+17
-7
ampel-firmware/sensor_commands.cpp
with
17 additions
and
7 deletions
+17
-7
ampel-firmware/sensor_commands.cpp
+
17
-
7
View file @
755f8578
...
@@ -59,10 +59,19 @@ namespace sensor_commands {
...
@@ -59,10 +59,19 @@ namespace sensor_commands {
return
0
;
return
0
;
}
}
void
listAvailableCallbacks
()
{
Serial
.
println
(
"DEBUG - Available commands :"
);
for
(
uint8_t
i
=
0
;
i
<
callbacks_count
;
i
++
)
{
Serial
.
print
(
" "
);
Serial
.
println
(
callbacks
[
i
].
name
);
}
}
void
run
(
const
char
*
command
)
{
void
run
(
const
char
*
command
)
{
char
function_name
[
MAX_COMMAND_SIZE
];
char
function_name
[
MAX_COMMAND_SIZE
];
long
parameter
;
long
parameter
;
if
(
parseCommand
(
command
,
function_name
,
parameter
))
{
if
(
parseCommand
(
command
,
function_name
,
parameter
))
{
listAvailableCallbacks
();
return
;
return
;
}
}
Serial
.
print
(
"Command : '"
);
Serial
.
print
(
"Command : '"
);
...
@@ -72,14 +81,15 @@ namespace sensor_commands {
...
@@ -72,14 +81,15 @@ namespace sensor_commands {
// Test all the callbacks.
// Test all the callbacks.
for
(
uint8_t
i
=
0
;
i
<
callbacks_count
;
i
++
)
{
for
(
uint8_t
i
=
0
;
i
<
callbacks_count
;
i
++
)
{
if
(
startsWith
(
function_name
,
callbacks
[
i
].
name
))
{
if
(
!
strcmp
(
function_name
,
callbacks
[
i
].
name
))
{
Serial
.
print
(
"OHHHH YES!!!"
);
Serial
.
print
(
"Function found!!!"
);
Serial
.
print
(
"Trying '"
);
Serial
.
print
(
callbacks
[
i
].
name
);
Serial
.
println
(
"'"
);
callbacks
[
i
].
function
(
callbacks
[
i
].
data
);
return
;
}
}
Serial
.
print
(
"Trying '"
);
Serial
.
print
(
callbacks
[
i
].
name
);
Serial
.
println
(
"'"
);
callbacks
[
i
].
function
(
callbacks
[
i
].
data
);
}
}
Serial
.
println
(
"Done."
);
listAvailableCallbacks
(
);
}
}
}
}
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