• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include "bta/dm/bta_dm_device_search_int.h"
20 #include "bta/include/bta_api.h"  // tBTA_DM_SEARCH_CBACK
21 #include "stack/btm/neighbor_inquiry.h"
22 #include "stack/include/bt_hdr.h"
23 #include "stack/include/rnr_interface.h"
24 #include "types/bt_transport.h"
25 #include "types/raw_address.h"
26 
27 // Bta module start and stop entry points
28 void bta_dm_search_stop();
29 
30 // Bta device discovery start and stop entry points
31 void bta_dm_disc_start_device_discovery(tBTA_DM_SEARCH_CBACK*);
32 void bta_dm_disc_stop_device_discovery();
33 
34 void bta_dm_disc_disable_search();
35 
36 // LE observe and scan interface
37 void bta_dm_ble_scan(bool start, uint8_t duration_sec);
38 void bta_dm_ble_csis_observe(bool observe, tBTA_DM_SEARCH_CBACK* p_cback);
39 
40 // Checks if there is a device discovery request queued
41 bool bta_dm_is_search_request_queued();
42 
43 // Provide data for the dumpsys procedure
44 void DumpsysBtaDmSearch(int fd);
45 
46 namespace bluetooth::legacy::testing {
47 
48 void bta_dm_disc_init_search_cb(tBTA_DM_SEARCH_CB& bta_dm_search_cb);
49 bool bta_dm_read_remote_device_name(const RawAddress& bd_addr, tBT_TRANSPORT transport);
50 tBTA_DM_SEARCH_CB& bta_dm_disc_search_cb();
51 void bta_dm_discover_next_device();
52 void bta_dm_inq_cmpl();
53 void bta_dm_inq_cmpl_cb(void* p_result);
54 void bta_dm_observe_cmpl_cb(void* p_result);
55 void bta_dm_observe_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir, uint16_t eir_len);
56 void bta_dm_opportunistic_observe_results_cb(tBTM_INQ_RESULTS* p_inq, const uint8_t* p_eir,
57                                              uint16_t eir_len);
58 void bta_dm_queue_search(tBTA_DM_API_SEARCH& search);
59 void bta_dm_remname_cback(const tBTM_REMOTE_DEV_NAME* p);
60 void bta_dm_start_scan(uint8_t duration_sec);
61 
62 }  // namespace bluetooth::legacy::testing
63