mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-30 18:49:09 +03:00
don't count wrong tx-echos as rx-errors
This commit is contained in:
@@ -154,8 +154,12 @@ 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
|
// 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);
|
uint8_t crc = calculate_crc(data, length - 1);
|
||||||
if (data[length - 1] != crc) {
|
if (data[length - 1] != crc) {
|
||||||
telegram_error_count_++;
|
if ((data[0] & 0x7F) != ems_bus_id()) { // do not count echos as errors
|
||||||
LOG_ERROR(F("Rx: %s (CRC %02X != %02X)"), Helpers::data_to_hex(data, length).c_str(), data[length - 1], crc);
|
telegram_error_count_++;
|
||||||
|
LOG_WARNING(F("Rx: %s (CRC %02X != %02X)"), Helpers::data_to_hex(data, length).c_str(), data[length - 1], crc);
|
||||||
|
} else {
|
||||||
|
LOG_TRACE(F("Rx: %s (CRC %02X != %02X)"), Helpers::data_to_hex(data, length).c_str(), data[length - 1], crc);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user