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
34cf4989
Commit
34cf4989
authored
Apr 17, 2021
by
Eric Duminil
Browse files
Simpler code
parent
6baf3b30
Changes
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/mqtt.cpp
View file @
34cf4989
...
...
@@ -73,16 +73,13 @@ namespace mqtt {
}
led_effects
::
onBoardLEDOn
();
Serial
.
print
(
F
(
"Message arrived on topic: "
));
Serial
.
print
(
sub_topic
);
Serial
.
print
(
F
(
". Message: '"
));
String
messageString
;
Serial
.
println
(
sub_topic
);
char
command
[
length
+
1
];
for
(
unsigned
int
i
=
0
;
i
<
length
;
i
++
)
{
Serial
.
print
((
char
)
message
[
i
]);
messageString
+=
(
char
)
message
[
i
];
command
[
i
]
=
message
[
i
];
}
Serial
.
println
(
"'."
);
sensor_commands
::
run
(
messageString
.
c_str
());
delay
(
50
);
command
[
length
]
=
0
;
sensor_commands
::
run
(
command
);
led_effects
::
onBoardLEDOff
();
}
...
...
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