From 573ea5518703ed284b452908a028045453ccb84a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 19 Dec 2022 11:40:01 -1000 Subject: [PATCH] Handle zero padding anywhere in the combined adv data (#4208) fixes https://github.com/esphome/issues/issues/3913 --- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp index fb377e2be2..b1d469025b 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp @@ -706,11 +706,7 @@ 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 (offset < param.adv_data_len && param.scan_rsp_len > 0) { // Zero padded advertisement data - offset = param.adv_data_len; - continue; - } - break; + continue; // Possible zero padded advertisement data } // first byte of adv record is adv record type