config
This commit is contained in:
parent
f990625a91
commit
3e82defcef
@ -24,6 +24,10 @@ static bool showConfigCmd(uint8_t argc, char **args) {
|
||||
configBlock.macAddress[3],
|
||||
configBlock.macAddress[4],
|
||||
configBlock.macAddress[5]);
|
||||
sendFormatString("NTP Server: %s\n\r", configBlock.ntpServer);
|
||||
sendFormatString("deviceId: %s\n\r", configBlock.deviceId);
|
||||
sendFormatString("sharedSecret: (will not be displayed)\n\r");
|
||||
sendFormatString("Location: %s\n\r", configBlock.location);
|
||||
|
||||
return retCode;
|
||||
}
|
||||
@ -80,6 +84,30 @@ static bool setDeviceNameCmd(uint8_t argc, char **args) {
|
||||
sizeof(((t_configBlock*)0)->deviceName));
|
||||
}
|
||||
|
||||
static bool setNtpServerCmd(uint8_t argc, char **args) {
|
||||
return setStringParameterCmd(argc, args,
|
||||
offsetof(t_configBlock, ntpServer),
|
||||
sizeof(((t_configBlock*)0)->ntpServer));
|
||||
}
|
||||
|
||||
static bool setDeviceIdCmd(uint8_t argc, char **args) {
|
||||
return setStringParameterCmd(argc, args,
|
||||
offsetof(t_configBlock, deviceId),
|
||||
sizeof(((t_configBlock*)0)->deviceId));
|
||||
}
|
||||
|
||||
static bool setSharedSecretCmd(uint8_t argc, char **args) {
|
||||
return setStringParameterCmd(argc, args,
|
||||
offsetof(t_configBlock, sharedSecret),
|
||||
sizeof(((t_configBlock*)0)->sharedSecret));
|
||||
}
|
||||
|
||||
static bool setLocationCmd(uint8_t argc, char **args) {
|
||||
return setStringParameterCmd(argc, args,
|
||||
offsetof(t_configBlock, location),
|
||||
sizeof(((t_configBlock*)0)->location));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -88,6 +116,22 @@ const static cmd_t SET_COMMANDS[] = {
|
||||
.help = \
|
||||
"devicename ........................... Name of this device\n\r"
|
||||
},
|
||||
{ .name = "ntp server", .cmdFunc = setNtpServerCmd,
|
||||
.help = \
|
||||
"ntp server ........................... Name of the NTP server\n\r"
|
||||
},
|
||||
{ .name = "deviceid", .cmdFunc = setDeviceIdCmd,
|
||||
.help = \
|
||||
"deviceid ............................. ID of this device\n\r"
|
||||
},
|
||||
{ .name = "sharedSecret", .cmdFunc = setSharedSecretCmd,
|
||||
.help = \
|
||||
"sharedsecret ......................... Shared secret\n\r"
|
||||
},
|
||||
{ .name = "location", .cmdFunc = setLocationCmd,
|
||||
.help = \
|
||||
"location ............................. Location of this device\n\r"
|
||||
},
|
||||
{ .name = "END_OF_CMDS", .help = "",.cmdFunc = NULL }
|
||||
};
|
||||
|
||||
|
@ -40,7 +40,7 @@ void my_setup_2() {
|
||||
|
||||
wizInit();
|
||||
|
||||
// cmdHandlerInit();
|
||||
cmdHandlerInit();
|
||||
|
||||
counterInit();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user