This commit is contained in:
2020-11-16 17:53:18 +01:00
parent e239655e7f
commit 54e6e448d8
3 changed files with 74 additions and 18 deletions

View File

@ -12,6 +12,7 @@
#include <PontCoopScheduler.h>
#include <wizHelper.h>
#include <mbusComm.h>
#include <loopCtrl.h>
extern const uint8_t CMD_SOCK;
@ -61,6 +62,37 @@ bool globalStatsCmd(uint8_t argc, char **args) {
return true;
}
bool mbusCommEnableCmd(uint8_t argc, char **args) {
bool retCode = true;
if (argc == 2) {
if (0 == strcmp("false", args[1])) {
mbusCommEnable(false);
} else if (0 == strcmp("true", args[1])) {
mbusCommEnable(true);
} else {
retCode = false;
}
} else {
retCode = false;
}
return retCode;
}
bool loopEnableCmd(uint8_t argc, char **args) {
bool retCode = true;
if (argc == 2) {
if (0 == strcmp("false", args[1])) {
loopDisable();
} else if (0 == strcmp("true", args[1])) {
loopEnable();
} else {
retCode = false;
}
} else {
retCode = false;
}
return retCode;
}
const static cmd_t COMMANDS[] = {
{ .requiredConfigMode = true, .name = "clear", .cmdFunc = clearCmd,
@ -69,6 +101,19 @@ const static cmd_t COMMANDS[] = {
" statistics\n\r" \
" Required configuration mode\n\r"
},
{ .requiredConfigMode = true, .name = "mbusCommEnable", .cmdFunc = mbusCommEnableCmd,
.help = \
"mbusCommEnable true|false ............ Enables or disables the Meterbus\n\r" \
" communication\n\r"
},
{ .requiredConfigMode = true, .name = "loopEnable", .cmdFunc = loopEnableCmd,
.help = \
"loopEnable true|false ................ Enables or disables the loop.\n\r" \
" Disable Meterbus communication\n\r" \
" first if you want to disable the\n\r" \
" for a longer time, otherwise the\n\r" \
" request will enable it again\n\r"
},
{ .requiredConfigMode = false, .name = "globalStats", .cmdFunc = globalStatsCmd,
.help = \
"globalStats .......................... Show the global statistics\n\r" \