mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
ignore src==0, fixes #2378
This commit is contained in:
@@ -145,6 +145,12 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore src==0, https://github.com/emsesp/EMS-ESP32/issues/2378
|
||||||
|
if (!(data[0] & 0x7F)) {
|
||||||
|
LOG_WARNING("Invalid source: %s", Helpers::data_to_hex(data, length).c_str()); // include CRC
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user