working now?

This commit is contained in:
2020-11-25 10:02:38 +01:00
parent 7c63579390
commit edf1942ad3
6 changed files with 40 additions and 35 deletions

View File

@ -44,7 +44,7 @@ typedef struct {
// clear statistics
bool clearCmd(uint8_t argc, char **args) {
t_mbusCommStats zeroedStats = { .requestCnt = 0, .errorCnt = 0 };
t_mbusCommStats zeroedStats = { .mbusRequestCnt = 0, .mbusErrorCnt = 0, .uartOverrunCnt = 0, .uartFramingErrCnt = 0, .uartParityErrCnt = 0 };
mbusCommSetStats(zeroedStats);
coloredMsg(LOG_YELLOW, true, "ch cc global statistics cleared");
return true;
@ -55,9 +55,13 @@ bool globalStatsCmd(uint8_t argc, char **args) {
char buf[256];
sprintf(buf, \
"Global statistics\n\r" \
" Requests: %ld\n\r" \
" Errors: %ld\n\r",
stats->requestCnt, stats->errorCnt
" Meterbus Requests: %ld\n\r" \
" Meterbus Errors: %ld\n\r" \
" UART Overruns: %ld\n\r" \
" UART Framing Errs: %ld\n\r" \
" UART Parity Errs: %ld\n\r",
stats->mbusRequestCnt, stats->mbusErrorCnt,
stats->uartOverrunCnt, stats->uartFramingErrCnt, stats->uartParityErrCnt
);
send(CMD_SOCK, (uint8_t*)buf, strlen(buf));
return true;