From db4d14c89d46fb64795e8c7501f04415d597bc0b Mon Sep 17 00:00:00 2001 From: Vincent Coubard Date: Wed, 23 May 2018 17:18:56 +0100 Subject: [PATCH] BLE NRF52: Fix advertising filtering when no bonds are present. --- .../targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xGap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xGap.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xGap.cpp index e2c76f2c05..a5053b23f4 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xGap.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF52/source/nRF5xGap.cpp @@ -1432,7 +1432,9 @@ void nRF5xGap::on_advertising_packet(const ble_gap_evt_adv_report_t &evt) { bool peer_address_resolved = evt.peer_addr.addr_id_peer; if (_privacy_enabled && - peer_address_resolved == false && + evt.peer_addr.addr_type == BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE && + peer_address_resolved == false && + get_sm().get_resolving_list().size() > 0 && _central_privacy_configuration.resolution_strategy == CentralPrivacyConfiguration_t::RESOLVE_AND_FILTER ) { return;