Loading system/main/shim/btm_api.cc +9 −0 Original line number Diff line number Diff line Loading @@ -720,6 +720,15 @@ tBTM_STATUS bluetooth::shim::BTM_BleObserve(bool start, uint8_t duration_sec, return BTM_CMD_STARTED; } void bluetooth::shim::BTM_BleOpportunisticObserve( bool enable, tBTM_INQ_RESULTS_CB* p_results_cb) { if (enable) { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = p_results_cb; } else { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = nullptr; } } void bluetooth::shim::BTM_EnableInterlacedPageScan() { Stack::GetInstance()->GetBtm()->SetInterlacedPageScan(); } Loading system/main/shim/btm_api.h +20 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,26 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_cmpl_cb); /******************************************************************************* * * Function BTM_BleOpportunisticObserve * * Description Register/unregister opportunistic scan callback. This method * does not trigger scan start/stop, but if scan is ever started, * this callback would get called with scan results. Additionally, * this callback is not reset on each scan start/stop. It's * intended to be used by LE Audio related profiles, that would * find yet unpaired members of CSIS set, or broadcasts. * * Parameters enable: enable/disable observing. * p_results_cb: callback for results. * * Returns void * ******************************************************************************/ void BTM_BleOpportunisticObserve(bool enable, tBTM_INQ_RESULTS_CB* p_results_cb); void BTM_EnableInterlacedInquiryScan(); void BTM_EnableInterlacedPageScan(); Loading system/stack/btm/btm_ble_gap.cc +30 −0 Original line number Diff line number Diff line Loading @@ -374,6 +374,20 @@ inline bool BTM_LE_STATES_SUPPORTED(const uint8_t* x, uint8_t bit_num) { return ((x)[offset] & mask); } void BTM_BleOpportunisticObserve(bool enable, tBTM_INQ_RESULTS_CB* p_results_cb) { if (bluetooth::shim::is_gd_shim_enabled()) { bluetooth::shim::BTM_BleOpportunisticObserve(enable, p_results_cb); return; } if (enable) { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = p_results_cb; } else { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = NULL; } } /******************************************************************************* * * Function BTM_BleObserve Loading Loading @@ -1988,6 +2002,14 @@ void btm_ble_process_adv_pkt_cont(uint16_t evt_type, uint8_t addr_type, const_cast<uint8_t*>(adv_data.data()), adv_data.size()); } tBTM_INQ_RESULTS_CB* p_opportunistic_obs_results_cb = btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb; if (p_opportunistic_obs_results_cb) { (p_opportunistic_obs_results_cb)((tBTM_INQ_RESULTS*)&p_i->inq_info.results, const_cast<uint8_t*>(adv_data.data()), adv_data.size()); } cache.Clear(addr_type, bda); } Loading Loading @@ -2054,6 +2076,14 @@ void btm_ble_process_adv_pkt_cont_for_inquiry( const_cast<uint8_t*>(advertising_data.data()), advertising_data.size()); } tBTM_INQ_RESULTS_CB* p_opportunistic_obs_results_cb = btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb; if (p_opportunistic_obs_results_cb) { (p_opportunistic_obs_results_cb)( (tBTM_INQ_RESULTS*)&p_i->inq_info.results, const_cast<uint8_t*>(advertising_data.data()), advertising_data.size()); } } void btm_ble_process_phy_update_pkt(uint8_t len, uint8_t* data) { Loading system/stack/btm/btm_ble_int_types.h +3 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,9 @@ typedef struct { tBTM_CMPL_CB* p_obs_cmpl_cb; alarm_t* observer_timer; /* opportunistic observer */ tBTM_INQ_RESULTS_CB* p_opportunistic_obs_results_cb; /* background connection procedure cb value */ uint16_t scan_int; uint16_t scan_win; Loading system/stack/include/btm_ble_api.h +20 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,26 @@ extern tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_cmpl_cb); /******************************************************************************* * * Function BTM_BleOpportunisticObserve * * Description Register/unregister opportunistic scan callback. This method * does not trigger scan start/stop, but if scan is ever started, * this callback would get called with scan results. Additionally, * this callback is not reset on each scan start/stop. It's * intended to be used by LE Audio related profiles, that would * find yet unpaired members of CSIS set, or broadcasts. * * Parameters enable: enable/disable observing. * p_results_cb: callback for results. * * Returns void * ******************************************************************************/ extern void BTM_BleOpportunisticObserve(bool enable, tBTM_INQ_RESULTS_CB* p_results_cb); /** Returns local device encryption root (ER) */ const Octet16& BTM_GetDeviceEncRoot(); Loading Loading
system/main/shim/btm_api.cc +9 −0 Original line number Diff line number Diff line Loading @@ -720,6 +720,15 @@ tBTM_STATUS bluetooth::shim::BTM_BleObserve(bool start, uint8_t duration_sec, return BTM_CMD_STARTED; } void bluetooth::shim::BTM_BleOpportunisticObserve( bool enable, tBTM_INQ_RESULTS_CB* p_results_cb) { if (enable) { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = p_results_cb; } else { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = nullptr; } } void bluetooth::shim::BTM_EnableInterlacedPageScan() { Stack::GetInstance()->GetBtm()->SetInterlacedPageScan(); } Loading
system/main/shim/btm_api.h +20 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,26 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_cmpl_cb); /******************************************************************************* * * Function BTM_BleOpportunisticObserve * * Description Register/unregister opportunistic scan callback. This method * does not trigger scan start/stop, but if scan is ever started, * this callback would get called with scan results. Additionally, * this callback is not reset on each scan start/stop. It's * intended to be used by LE Audio related profiles, that would * find yet unpaired members of CSIS set, or broadcasts. * * Parameters enable: enable/disable observing. * p_results_cb: callback for results. * * Returns void * ******************************************************************************/ void BTM_BleOpportunisticObserve(bool enable, tBTM_INQ_RESULTS_CB* p_results_cb); void BTM_EnableInterlacedInquiryScan(); void BTM_EnableInterlacedPageScan(); Loading
system/stack/btm/btm_ble_gap.cc +30 −0 Original line number Diff line number Diff line Loading @@ -374,6 +374,20 @@ inline bool BTM_LE_STATES_SUPPORTED(const uint8_t* x, uint8_t bit_num) { return ((x)[offset] & mask); } void BTM_BleOpportunisticObserve(bool enable, tBTM_INQ_RESULTS_CB* p_results_cb) { if (bluetooth::shim::is_gd_shim_enabled()) { bluetooth::shim::BTM_BleOpportunisticObserve(enable, p_results_cb); return; } if (enable) { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = p_results_cb; } else { btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb = NULL; } } /******************************************************************************* * * Function BTM_BleObserve Loading Loading @@ -1988,6 +2002,14 @@ void btm_ble_process_adv_pkt_cont(uint16_t evt_type, uint8_t addr_type, const_cast<uint8_t*>(adv_data.data()), adv_data.size()); } tBTM_INQ_RESULTS_CB* p_opportunistic_obs_results_cb = btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb; if (p_opportunistic_obs_results_cb) { (p_opportunistic_obs_results_cb)((tBTM_INQ_RESULTS*)&p_i->inq_info.results, const_cast<uint8_t*>(adv_data.data()), adv_data.size()); } cache.Clear(addr_type, bda); } Loading Loading @@ -2054,6 +2076,14 @@ void btm_ble_process_adv_pkt_cont_for_inquiry( const_cast<uint8_t*>(advertising_data.data()), advertising_data.size()); } tBTM_INQ_RESULTS_CB* p_opportunistic_obs_results_cb = btm_cb.ble_ctr_cb.p_opportunistic_obs_results_cb; if (p_opportunistic_obs_results_cb) { (p_opportunistic_obs_results_cb)( (tBTM_INQ_RESULTS*)&p_i->inq_info.results, const_cast<uint8_t*>(advertising_data.data()), advertising_data.size()); } } void btm_ble_process_phy_update_pkt(uint8_t len, uint8_t* data) { Loading
system/stack/btm/btm_ble_int_types.h +3 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,9 @@ typedef struct { tBTM_CMPL_CB* p_obs_cmpl_cb; alarm_t* observer_timer; /* opportunistic observer */ tBTM_INQ_RESULTS_CB* p_opportunistic_obs_results_cb; /* background connection procedure cb value */ uint16_t scan_int; uint16_t scan_win; Loading
system/stack/include/btm_ble_api.h +20 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,26 @@ extern tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_cmpl_cb); /******************************************************************************* * * Function BTM_BleOpportunisticObserve * * Description Register/unregister opportunistic scan callback. This method * does not trigger scan start/stop, but if scan is ever started, * this callback would get called with scan results. Additionally, * this callback is not reset on each scan start/stop. It's * intended to be used by LE Audio related profiles, that would * find yet unpaired members of CSIS set, or broadcasts. * * Parameters enable: enable/disable observing. * p_results_cb: callback for results. * * Returns void * ******************************************************************************/ extern void BTM_BleOpportunisticObserve(bool enable, tBTM_INQ_RESULTS_CB* p_results_cb); /** Returns local device encryption root (ER) */ const Octet16& BTM_GetDeviceEncRoot(); Loading