aboutsummaryrefslogtreecommitdiff
path: root/stack/btm/btm_ble_gap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'stack/btm/btm_ble_gap.cc')
-rw-r--r--stack/btm/btm_ble_gap.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/stack/btm/btm_ble_gap.cc b/stack/btm/btm_ble_gap.cc
index 9f8f7b0b7..907d0d85c 100644
--- a/stack/btm/btm_ble_gap.cc
+++ b/stack/btm/btm_ble_gap.cc
@@ -175,7 +175,8 @@ void btm_ble_process_adv_pkt_cont(uint16_t evt_type, uint8_t addr_type,
uint8_t secondary_phy,
uint8_t advertising_sid, int8_t tx_power,
int8_t rssi, uint16_t periodic_adv_int,
- uint8_t data_len, uint8_t* data);
+ uint8_t data_len, uint8_t* data,
+ const RawAddress& original_bda);
static uint8_t btm_set_conn_mode_adv_init_addr(RawAddress& p_peer_addr_ptr,
tBLE_ADDR_TYPE* p_peer_addr_type,
tBLE_ADDR_TYPE* p_own_addr_type);
@@ -1774,13 +1775,17 @@ void btm_ble_process_ext_adv_pkt(uint8_t data_len, uint8_t* data) {
rssi);
}
+ // Store this to pass up the callback chain to GattService#onScanResult for the check
+ // in ScanFilter#matches
+ RawAddress original_bda = bda;
+
if (addr_type != BLE_ADDR_ANONYMOUS) {
btm_ble_process_adv_addr(bda, &addr_type);
}
btm_ble_process_adv_pkt_cont(event_type, addr_type, bda, primary_phy,
secondary_phy, advertising_sid, tx_power, rssi,
- periodic_adv_int, pkt_data_len, pkt_data);
+ periodic_adv_int, pkt_data_len, pkt_data, original_bda);
}
}
@@ -1829,6 +1834,9 @@ void btm_ble_process_adv_pkt(uint8_t data_len, uint8_t* data) {
pkt_data_len, rssi);
}
+ // Pass up the address to GattService#onScanResult to use in ScanFilter#matches
+ RawAddress original_bda = bda;
+
btm_ble_process_adv_addr(bda, &addr_type);
uint16_t event_type;
@@ -1860,7 +1868,7 @@ void btm_ble_process_adv_pkt(uint8_t data_len, uint8_t* data) {
btm_ble_process_adv_pkt_cont(
event_type, addr_type, bda, PHY_LE_1M, PHY_LE_NO_PACKET, NO_ADI_PRESENT,
TX_POWER_NOT_PRESENT, rssi, 0x00 /* no periodic adv */, pkt_data_len,
- pkt_data);
+ pkt_data, original_bda);
}
}
@@ -1873,7 +1881,8 @@ void btm_ble_process_adv_pkt_cont(uint16_t evt_type, uint8_t addr_type,
uint8_t secondary_phy,
uint8_t advertising_sid, int8_t tx_power,
int8_t rssi, uint16_t periodic_adv_int,
- uint8_t data_len, uint8_t* data) {
+ uint8_t data_len, uint8_t* data,
+ const RawAddress& original_bda) {
tBTM_INQUIRY_VAR_ST* p_inq = &btm_cb.btm_inq_vars;
bool update = true;
@@ -1974,6 +1983,9 @@ void btm_ble_process_adv_pkt_cont(uint16_t evt_type, uint8_t addr_type,
if (!update) result &= ~BTM_BLE_INQ_RESULT;
+ // Pass address up to GattService#onScanResult
+ p_i->inq_info.results.original_bda = original_bda;
+
tBTM_INQ_RESULTS_CB* p_inq_results_cb = p_inq->p_inq_results_cb;
if (p_inq_results_cb && (result & BTM_BLE_INQ_RESULT)) {
(p_inq_results_cb)((tBTM_INQ_RESULTS*)&p_i->inq_info.results,