incomplete addDevice function
This commit is contained in:
parent
296c6270c0
commit
434dece345
@ -150,6 +150,26 @@ static bool setFrontendThresholdCmd(uint8_t argc, char **args) {
|
|||||||
0, 1023);
|
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[] = {
|
const static cmd_t SET_COMMANDS[] = {
|
||||||
{ .name = "devicename", .cmdFunc = setDeviceNameCmd,
|
{ .name = "devicename", .cmdFunc = setDeviceNameCmd,
|
||||||
.help = \
|
.help = \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user