incomplete change

This commit is contained in:
Wolfgang Hottgenroth 2020-12-11 22:48:22 +01:00
parent 66395f4d15
commit 2ee6360820
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -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 = \