don't count echos as errors also for remote thermostat emulation

This commit is contained in:
MichaelDvP
2024-10-31 16:29:36 +01:00
parent 13dfc87c57
commit e430ecf85c
3 changed files with 8 additions and 1 deletions

View File

@@ -148,7 +148,7 @@ void RxService::add(uint8_t * data, uint8_t length) {
// validate the CRC. if it fails then increment the number of corrupt/incomplete telegrams and only report to console/syslog
uint8_t crc = calculate_crc(data, length - 1);
if (data[length - 1] != crc) {
if ((data[0] & 0x7F) != ems_bus_id()) { // do not count echos as errors
if (data[0] != EMSuart::last_tx_src()) { // do not count echos as errors
telegram_error_count_++;
LOG_WARNING("Incomplete Rx: %s", Helpers::data_to_hex(data, length).c_str()); // include CRC
} else {