Skip to content

Commit

Permalink
Merge pull request #2381 from MichaelDvP/dev
Browse files Browse the repository at this point in the history
 ignore src==0 (#2378) and fix typo
  • Loading branch information
proddy authored Jan 29, 2025
2 parents 9188d03 + f2ae84b commit bfff842
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/core/telegram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ void RxService::add(uint8_t * data, uint8_t length) {
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
uint8_t crc = calculate_crc(data, length - 1);
if (data[length - 1] != crc) {
Expand Down
4 changes: 2 additions & 2 deletions src/devices/heatpump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
register_device_value(DeviceValueTAG::TAG_DHW1, &wwStartsHp_, DeviceValueType::UINT24, FL_(wwStartsHp), DeviceValueUOM::NONE);

register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &fuelHeat_, DeviceValueType::UINT32, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(fuelHeat), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DHW1, &elDhw_, DeviceValueType::UINT32, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(fuelDhw), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &fuelHeat_, DeviceValueType::UINT32, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(elHeat), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DHW1, &fuelDhw_, DeviceValueType::UINT32, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(fuelDhw), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &elHeat_, DeviceValueType::UINT32, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(elHeat), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DHW1, &elDhw_, DeviceValueType::UINT32, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(elDhw), DeviceValueUOM::KWH);
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
&elGenHeat_,
Expand Down

0 comments on commit bfff842

Please sign in to comment.