mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 05:54:56 +01:00
Handle zero padding anywhere in the combined adv data (#4208)
fixes https://github.com/esphome/issues/issues/3913
This commit is contained in:
parent
b48b5d6cc7
commit
573ea55187
1 changed files with 1 additions and 5 deletions
|
@ -706,11 +706,7 @@ void ESPBTDevice::parse_adv_(const esp_ble_gap_cb_param_t::ble_scan_result_evt_p
|
||||||
while (offset + 2 < len) {
|
while (offset + 2 < len) {
|
||||||
const uint8_t field_length = payload[offset++]; // First byte is length of adv record
|
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
|
continue; // Possible zero padded advertisement data
|
||||||
offset = param.adv_data_len;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// first byte of adv record is adv record type
|
// first byte of adv record is adv record type
|
||||||
|
|
Loading…
Reference in a new issue