incomplete change
This commit is contained in:
parent
66395f4d15
commit
2ee6360820
@ -52,25 +52,31 @@ static bool showConfigCmd(uint8_t argc, char **args) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
static bool setDeviceNameCmd(uint8_t argc, char **args) {
|
||||
return setStringParameterCmd(argc, args, )
|
||||
}
|
||||
|
||||
|
||||
static bool setStringParameterCmd(uint8_t argc, char **args) {
|
||||
bool retCode = true;
|
||||
|
||||
t_configBlock configBlock;
|
||||
char *newDeviceName = args[2];
|
||||
if (strlen(newDeviceName) >= sizeof(configBlock.deviceName)) {
|
||||
sendString("given new device name is too long\n\r");
|
||||
char *parameterName = args[1];
|
||||
char *newParameterValue = args[2];
|
||||
if (strlen(newParameterValue) >= sizeof(configBlock.deviceName)) {
|
||||
sendFormatString("given new value for %s is too long\n\r", parameterMeter);
|
||||
retCode = false;
|
||||
} else {
|
||||
sendFormatString("set device name to %s\n\r", newDeviceName);
|
||||
sendFormatString("set %s to %s\n\r", parameterName, newParameterValue);
|
||||
|
||||
eepromReadConfigBlock(&configBlock);
|
||||
strcpy(configBlock.deviceName, newDeviceName);
|
||||
strcpy(configBlock.deviceName, newParameterValue);
|
||||
eepromWriteConfigBlock(&configBlock);
|
||||
}
|
||||
|
||||
return retCode;
|
||||
}
|
||||
|
||||
const static cmd_t SET_COMMANDS[] = {
|
||||
{ .name = "devicename", .cmdFunc = setDeviceNameCmd,
|
||||
.help = \
|
||||
|
Loading…
x
Reference in New Issue
Block a user