Commit 6e522d4e authored by Eric Duminil's avatar Eric Duminil
Browse files

Simpler log

parent 591e2082
......@@ -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)) {
......
......@@ -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
......
Supports Markdown
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