OSDN Git Service

Add security record for devices found through LE batch scan
authorAndre Eisenbach <eisenbach@google.com>
Wed, 14 Sep 2016 19:41:37 +0000 (12:41 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Fri, 16 Sep 2016 00:27:38 +0000 (17:27 -0700)
Currently, starting an LE batch scan are not added to the stack internal
device database, which means that the address type and device type
needed for a connection are not available.

This patch ensures that devices found during an LE scan are added to the
device database to ensure connection attempts will succeed.

Bug: 31309376
Change-Id: Ic52d7eaa03d17dcbbd848af9140038bc84ea3bd0
(cherry picked from commit e0295e2c2eb7cc6eb331d581ed8455d6b30b3bc6)

stack/btm/btm_ble_batchscan.c

index 95609de..2b329b5 100644 (file)
@@ -123,6 +123,10 @@ void btm_ble_batchscan_filter_track_adv_vse_cback(UINT8 len, UINT8 *p)
 
         BTM_TRACE_EVENT("track_adv_vse_cback called: %d, %d, %d", adv_data.filt_index,
                          adv_data.addr_type, adv_data.advertiser_state);
+
+        // Make sure the device is known
+        BTM_SecAddBleDevice(adv_data.bd_addr.address, NULL, BT_DEVICE_TYPE_BLE, adv_data.addr_type);
+
         ble_advtrack_cb.p_track_cback(&adv_data);
         return;
     }