addDevice
This commit is contained in:
@ -151,11 +151,6 @@ static bool setFrontendThresholdCmd(uint8_t argc, char **args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool makeDevice(uint8_t argOffset, uint8_t argc, char **args, t_deviceBlock *deviceBlock) {
|
static bool makeDevice(uint8_t argOffset, uint8_t argc, char **args, t_deviceBlock *deviceBlock) {
|
||||||
if ((argc - argOffset) != 8) {
|
|
||||||
sendString("wrong number of arguments\n\r");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *deviceName = args[1 + argOffset];
|
char *deviceName = args[1 + argOffset];
|
||||||
if (strcmp(deviceName, "help") == 0) {
|
if (strcmp(deviceName, "help") == 0) {
|
||||||
sendString("Arguments are\n\r");
|
sendString("Arguments are\n\r");
|
||||||
@ -166,6 +161,12 @@ static bool makeDevice(uint8_t argOffset, uint8_t argc, char **args, t_deviceBlo
|
|||||||
sendString("fields: between -1 (not considered) and 254\n\r");
|
sendString("fields: between -1 (not considered) and 254\n\r");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((argc - argOffset) != 8) {
|
||||||
|
sendString("wrong number of arguments\n\r");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (strlen(deviceName) >= sizeof(deviceBlock->deviceName)) {
|
if (strlen(deviceName) >= sizeof(deviceBlock->deviceName)) {
|
||||||
sendString("devicename too long\n\r");
|
sendString("devicename too long\n\r");
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user