fix compilation error with TELEINFO enabled (#18058)

This commit is contained in:
Charles 2023-02-26 20:52:49 +01:00 committed by GitHub
parent 66271ca0dd
commit 1bfa110e73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -530,7 +530,7 @@ bool ResponseAppendTInfo(char sep, bool all)
if (me->name && me->value && *me->name && *me->value) { if (me->name && me->value && *me->name && *me->value) {
// Check back checksum in case of any memory corruption // Check back checksum in case of any memory corruption
if (me->checksum==tinfo.calcChecksum(me->name, me->value))) { if (me->checksum==tinfo.calcChecksum(me->name, me->value)) {
// Does this label blacklisted ? // Does this label blacklisted ?
if (!isBlacklistedLabel(me->name)) { if (!isBlacklistedLabel(me->name)) {
@ -582,7 +582,7 @@ bool ResponseAppendTInfo(char sep, bool all)
} }
} else { } else {
AddLog(LOG_LEVEL_WARNING, PSTR("TIC: bad checksum for %s"), me->name); AddLog(LOG_LEVEL_INFO, PSTR("TIC: bad checksum for %s"), me->name);
} }
} }
} }
@ -909,7 +909,7 @@ bool TInfoCmd(void) {
case CMND_TELEINFO_STATS: { case CMND_TELEINFO_STATS: {
char stats_name[MAX_TINFO_COMMAND_NAME]; char stats_name[MAX_TINFO_COMMAND_NAME];
// Get the raw name // Get the raw name
GetTextIndexed(statsname, MAX_TINFO_COMMAND_NAME, command_code, kTInfo_Commands); GetTextIndexed(stats_name, MAX_TINFO_COMMAND_NAME, command_code, kTInfo_Commands);
int l = strlen(stats_name); int l = strlen(stats_name);
// At least "EnergyConfig Stats" plus one space and one (or more) digit // At least "EnergyConfig Stats" plus one space and one (or more) digit
// so "EnergyConfig Stats" or "EnergyConfig Stats 0" // so "EnergyConfig Stats" or "EnergyConfig Stats 0"
@ -919,7 +919,7 @@ bool TInfoCmd(void) {
Settings->teleinfo.show_stats = value ; Settings->teleinfo.show_stats = value ;
AddLog(LOG_LEVEL_INFO, PSTR("TIC: Show stats=%d"), value); AddLog(LOG_LEVEL_INFO, PSTR("TIC: Show stats=%d"), value);
} else if (value == 2) { } else if (value == 2) {
tinfo.clearstats(); tinfo.clearStats();
AddLog(LOG_LEVEL_INFO, PSTR("TIC: Stats cleared")); AddLog(LOG_LEVEL_INFO, PSTR("TIC: Stats cleared"));
} else { } else {
AddLog(LOG_LEVEL_INFO, PSTR("TIC: bad Stats param '%d'"), value); AddLog(LOG_LEVEL_INFO, PSTR("TIC: bad Stats param '%d'"), value);