diff --git a/cube/User/Src/configCmds.c b/cube/User/Src/configCmds.c index 5578810..5986ce1 100644 --- a/cube/User/Src/configCmds.c +++ b/cube/User/Src/configCmds.c @@ -150,6 +150,26 @@ static bool setFrontendThresholdCmd(uint8_t argc, char **args) { 0, 1023); } +static bool addDeviceCmd(uint8_t argc, char **args) { + if (argc != 8) { + sendString("wrong number of arguments\n\r"); + return false; + } + + char *deviceName = args[1]; + + long int rawAddress = strtol(args[2], NULL, 10); + if (rawAddress < 1 || rawAddress > 254) { + sendString("illegal address\n\r"); + return false; + } + uint8_t address = (uint8_t)rawAddress; + + + + return true; +} + const static cmd_t SET_COMMANDS[] = { { .name = "devicename", .cmdFunc = setDeviceNameCmd, .help = \