split commands
This commit is contained in:
37
cube/User/Src/regularCmds.c
Normal file
37
cube/User/Src/regularCmds.c
Normal file
@ -0,0 +1,37 @@
|
||||
#include <cmdHelper.h>
|
||||
#include <logger.h>
|
||||
|
||||
#include <mbusComm.h>
|
||||
|
||||
|
||||
static bool globalStatsCmd(uint8_t argc, char **args) {
|
||||
t_mbusCommStats *stats = mbusCommGetStats();
|
||||
sendFormatString(\
|
||||
"Global statistics\n\r" \
|
||||
" Meterbus Requests: %ld\n\r" \
|
||||
" Meterbus Errors: %ld\n\r" \
|
||||
" UART Octets: %ld\n\r" \
|
||||
" UART Overruns: %ld\n\r" \
|
||||
" UART Framing Errs: %ld\n\r" \
|
||||
" UART Parity Errs: %ld\n\r" \
|
||||
" UART Noise Errs: %ld\n\r",
|
||||
stats->mbusRequestCnt, stats->mbusErrorCnt,
|
||||
stats->uartOctetCnt, stats->uartOverrunCnt, stats->uartFramingErrCnt, stats->uartParityErrCnt, stats->uartNoiseErrCnt
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const cmd_t COMMANDS[] = {
|
||||
{ .name = "globalStats", .cmdFunc = globalStatsCmd,
|
||||
.help = \
|
||||
"globalStats .......................... Show the global statistics\n\r" \
|
||||
" counters requestCnt and errorCnt\n\r"
|
||||
},
|
||||
{ .name = "END_OF_CMDS", .help = "",.cmdFunc = NULL }
|
||||
};
|
||||
|
||||
const cmd_t *getRegularCommands() {
|
||||
return COMMANDS;
|
||||
}
|
Reference in New Issue
Block a user