don't output Rx errors in log if no bus connected

This commit is contained in:
proddy
2025-12-22 09:07:04 +01:00
parent 09f1c13d28
commit 6c80a34578

View File

@@ -152,9 +152,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
// if bus is not connected, do not count echos as errors
uint8_t crc = calculate_crc(data, length - 1);
if ((data[length - 1] != crc) && bus_connected()) {
if (data[length - 1] != crc) {
// if bus is not connected, assume its just noise on the line and ignore it
if (!bus_connected()) {
return;
}
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