From 21679cf2ba4e1288bcb87007a8cf688b18b53232 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 8 Dec 2022 13:39:33 +1300 Subject: [PATCH 1/2] Fix ble parsing with zero padded advertisements (#4162) --- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp index 853e998c80..fb377e2be2 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp @@ -705,8 +705,13 @@ void ESPBTDevice::parse_adv_(const esp_ble_gap_cb_param_t::ble_scan_result_evt_p while (offset + 2 < len) { const uint8_t field_length = payload[offset++]; // First byte is length of adv record - if (field_length == 0) + if (field_length == 0) { + if (offset < param.adv_data_len && param.scan_rsp_len > 0) { // Zero padded advertisement data + offset = param.adv_data_len; + continue; + } break; + } // first byte of adv record is adv record type const uint8_t record_type = payload[offset++]; From 7b0a298497512682bff744cac96970b96a964f0b Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 8 Dec 2022 13:42:25 +1300 Subject: [PATCH 2/2] Bump version to 2022.12.0b2 --- esphome/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/const.py b/esphome/const.py index 1fc09b400f..851dcbe1d2 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -1,6 +1,6 @@ """Constants used by esphome.""" -__version__ = "2022.12.0b1" +__version__ = "2022.12.0b2" ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"