mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Only handle possible advertising advertising packet for BLE V2
PiperOrigin-RevId: 519292612
This commit is contained in:
committed by
Copybara-Service
parent
e64dcb40c8
commit
9130b61f15
@@ -64,10 +64,17 @@ BleAdvertisementHeader::BleAdvertisementHeader(
|
||||
config_package_nearby::nearby_connections_feature::kEnableBleV2)) {
|
||||
// The BLE advertisement header is not encoded in base64, but still try to
|
||||
// parse it as raw bytes.
|
||||
NEARBY_LOG(
|
||||
WARNING,
|
||||
"Cannot deserialize BLEAdvertisementHeader: failed Base64 decoding");
|
||||
advertisement_header_bytes = ble_advertisement_header_bytes;
|
||||
if (ble_advertisement_header_bytes.size() ==
|
||||
kMinAdvertisementHeaderLength ||
|
||||
ble_advertisement_header_bytes.size() ==
|
||||
kMinAdvertisementHeaderLength + 2) {
|
||||
advertisement_header_bytes = ble_advertisement_header_bytes;
|
||||
} else {
|
||||
NEARBY_LOG(WARNING,
|
||||
"Cannot deserialize BLEAdvertisementHeader. Invalid "
|
||||
"advertising data.");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
NEARBY_LOG(
|
||||
ERROR,
|
||||
|
||||
Reference in New Issue
Block a user