Loading system/main/shim/btm_api.cc +4 −0 Original line number Diff line number Diff line Loading @@ -652,6 +652,10 @@ tBTM_STATUS bluetooth::shim::BTM_BleObserve(bool start, uint8_t duration_sec, std::lock_guard<std::mutex> lock(btm_cb_mutex_); if (btm_cb.ble_ctr_cb.is_ble_observe_active()) { if (duration_sec == 0) { Stack::GetInstance()->GetBtm()->CancelObservingTimer(); return BTM_CMD_STARTED; } LOG_WARN("%s Observing already active", __func__); return BTM_WRONG_MODE; } Loading system/stack/btm/btm_ble_gap.cc +9 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,9 @@ void BTM_BleOpportunisticObserve(bool enable, * events from a broadcast device. * * Parameters start: start or stop observe. * acceptlist: use acceptlist in observer mode or not. * duration: how long the scan should last, in seconds. 0 means * scan without timeout. Starting the scan second time without * timeout will disable the timer. * * Returns void * Loading Loading @@ -425,6 +427,12 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, if (start) { /* shared inquiry database, do not allow observe if any inquiry is active */ if (btm_cb.ble_ctr_cb.is_ble_observe_active()) { if (duration == 0) { if (alarm_is_scheduled(btm_cb.ble_ctr_cb.observer_timer)) { alarm_cancel(btm_cb.ble_ctr_cb.observer_timer); return BTM_CMD_STARTED; } } BTM_TRACE_ERROR("%s Observe Already Active", __func__); return status; } Loading system/stack/include/btm_ble_api.h +3 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,9 @@ extern void BTM_BleTrackAdvertiser(tBTM_BLE_TRACK_ADV_CBACK* p_track_cback, * events from a broadcast device. * * Parameters start: start or stop observe. * duration: how long the scan should last, in seconds. 0 means * scan without timeout. Starting the scan second time without * timeout will disable the timer. * * Returns void * Loading Loading
system/main/shim/btm_api.cc +4 −0 Original line number Diff line number Diff line Loading @@ -652,6 +652,10 @@ tBTM_STATUS bluetooth::shim::BTM_BleObserve(bool start, uint8_t duration_sec, std::lock_guard<std::mutex> lock(btm_cb_mutex_); if (btm_cb.ble_ctr_cb.is_ble_observe_active()) { if (duration_sec == 0) { Stack::GetInstance()->GetBtm()->CancelObservingTimer(); return BTM_CMD_STARTED; } LOG_WARN("%s Observing already active", __func__); return BTM_WRONG_MODE; } Loading
system/stack/btm/btm_ble_gap.cc +9 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,9 @@ void BTM_BleOpportunisticObserve(bool enable, * events from a broadcast device. * * Parameters start: start or stop observe. * acceptlist: use acceptlist in observer mode or not. * duration: how long the scan should last, in seconds. 0 means * scan without timeout. Starting the scan second time without * timeout will disable the timer. * * Returns void * Loading Loading @@ -425,6 +427,12 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration, if (start) { /* shared inquiry database, do not allow observe if any inquiry is active */ if (btm_cb.ble_ctr_cb.is_ble_observe_active()) { if (duration == 0) { if (alarm_is_scheduled(btm_cb.ble_ctr_cb.observer_timer)) { alarm_cancel(btm_cb.ble_ctr_cb.observer_timer); return BTM_CMD_STARTED; } } BTM_TRACE_ERROR("%s Observe Already Active", __func__); return status; } Loading
system/stack/include/btm_ble_api.h +3 −0 Original line number Diff line number Diff line Loading @@ -160,6 +160,9 @@ extern void BTM_BleTrackAdvertiser(tBTM_BLE_TRACK_ADV_CBACK* p_track_cback, * events from a broadcast device. * * Parameters start: start or stop observe. * duration: how long the scan should last, in seconds. 0 means * scan without timeout. Starting the scan second time without * timeout will disable the timer. * * Returns void * Loading