Commit 9db226d7 authored by Eric Duminil's avatar Eric Duminil
Browse files

Some doc

parent 8b3997b0
......@@ -43,6 +43,10 @@ namespace sensor_commands {
}
}
/*
* Tries to split a string command (e.g. 'mqtt 60' or 'show_csv') into a function_name and an argument.
* Returns 0 if both are found, 1 if there is a problem and 2 if no argument is found.
*/
uint8_t parseCommand(const char *command, char *function_name, int32_t &argument) {
char split_command[MAX_COMMAND_SIZE];
strlcpy(split_command, command, MAX_COMMAND_SIZE);
......@@ -83,6 +87,9 @@ namespace sensor_commands {
led_effects::showKITTWheel(color::red, 1);
}
/*
* Tries to find the corresponding callback for a given command. Name and number of argument should fit.
*/
void run(const char *command) {
char function_name[MAX_COMMAND_SIZE];
int32_t argument = 0;
......
......@@ -3,7 +3,7 @@
/** Other scripts can use this namespace, in order to define callbacks.
* Those callbacks can then be used to send commands to the sensor (reset, calibrate, night mode, ...)
*
* The callbacks can either have no parameter, or one int32_t parameter.
*/
namespace sensor_commands {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment