diff --git a/ampel-firmware/sensor_console.cpp b/ampel-firmware/sensor_console.cpp index ec55534d0ed69c96a820047939ff0b1285db4faa..b7ae8b5627f0be3a41f847b55c7c5e713102b80a 100644 --- a/ampel-firmware/sensor_console.cpp +++ b/ampel-firmware/sensor_console.cpp @@ -50,13 +50,11 @@ namespace sensor_console { 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); - Serial.print(F("Received : '")); - Serial.print(command); - Serial.println("'"); char *arg; char *part1; part1 = strtok(split_command, " "); if (!part1) { + Serial.println(F("Received empty command")); // Empty string return 1; } @@ -143,18 +141,20 @@ namespace sensor_console { Serial.print(F("Calling : ")); Serial.print(function_name); if (has_argument) { - Serial.print("("); + Serial.print(F("(")); Serial.print(argument); - Serial.println(")"); + Serial.println(F(")")); commands[i].intFunction(argument); } else { - Serial.println("()"); + Serial.println(F("()")); commands[i].voidFunction(); } return; } } - Serial.println(F("Message not supported. Available commands :")); + Serial.print(F("'")); + Serial.print(command); + Serial.println(F("' not supported. Available commands :")); listAvailableCommands(); } }