• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright 2003-2012 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /******************************************************************************
20  *
21  *  This is the private interface file for the BTA device manager.
22  *
23  ******************************************************************************/
24 #ifndef BTA_DM_INT_H
25 #define BTA_DM_INT_H
26 
27 #include <base/strings/stringprintf.h>
28 
29 #include <memory>
30 #include <string>
31 
32 #include "bt_target.h"  // Must be first to define build configuration
33 #include "bta/include/bta_api.h"
34 #include "bta/include/bta_gatt_api.h"
35 #include "bta/sys/bta_sys.h"
36 #include "main/shim/dumpsys.h"
37 #include "stack/include/bt_hdr.h"
38 #include "stack/include/bt_octets.h"
39 #include "types/bluetooth/uuid.h"
40 #include "types/raw_address.h"
41 
42 #ifndef CASE_RETURN_TEXT
43 #define CASE_RETURN_TEXT(code) \
44   case code:                   \
45     return #code
46 #endif
47 
48 /*****************************************************************************
49  *  Constants and data types
50  ****************************************************************************/
51 
52 #define BTA_COPY_DEVICE_CLASS(coddst, codsrc)          \
53   {                                                    \
54     ((uint8_t*)(coddst))[0] = ((uint8_t*)(codsrc))[0]; \
55     ((uint8_t*)(coddst))[1] = ((uint8_t*)(codsrc))[1]; \
56     ((uint8_t*)(coddst))[2] = ((uint8_t*)(codsrc))[2]; \
57   }
58 
59 #define BTA_DM_MSG_LEN 50
60 
61 #define BTA_SERVICE_ID_TO_SERVICE_MASK(id) (1 << (id))
62 
63 /* DM search events */
64 typedef enum : uint16_t {
65   /* DM search API events */
66   BTA_DM_API_SEARCH_EVT = BTA_SYS_EVT_START(BTA_ID_DM_SEARCH),
67   BTA_DM_API_DISCOVER_EVT,
68   BTA_DM_INQUIRY_CMPL_EVT,
69   BTA_DM_REMT_NAME_EVT,
70   BTA_DM_SDP_RESULT_EVT,
71   BTA_DM_SEARCH_CMPL_EVT,
72   BTA_DM_DISCOVERY_RESULT_EVT,
73   BTA_DM_DISC_CLOSE_TOUT_EVT,
74 } tBTA_DM_EVT;
75 
bta_dm_event_text(const tBTA_DM_EVT & event)76 inline std::string bta_dm_event_text(const tBTA_DM_EVT& event) {
77   switch (event) {
78     CASE_RETURN_TEXT(BTA_DM_API_SEARCH_EVT);
79     CASE_RETURN_TEXT(BTA_DM_API_DISCOVER_EVT);
80     CASE_RETURN_TEXT(BTA_DM_INQUIRY_CMPL_EVT);
81     CASE_RETURN_TEXT(BTA_DM_REMT_NAME_EVT);
82     CASE_RETURN_TEXT(BTA_DM_SDP_RESULT_EVT);
83     CASE_RETURN_TEXT(BTA_DM_SEARCH_CMPL_EVT);
84     CASE_RETURN_TEXT(BTA_DM_DISCOVERY_RESULT_EVT);
85     CASE_RETURN_TEXT(BTA_DM_DISC_CLOSE_TOUT_EVT);
86     default:
87       return base::StringPrintf("UNKNOWN[0x%04x]", event);
88   }
89 }
90 
91 /* data type for BTA_DM_API_SEARCH_EVT */
92 typedef struct {
93   BT_HDR_RIGID hdr;
94   tBTA_SERVICE_MASK services;
95   tBTA_DM_SEARCH_CBACK* p_cback;
96 } tBTA_DM_API_SEARCH;
97 
98 /* data type for BTA_DM_API_DISCOVER_EVT */
99 typedef struct {
100   BT_HDR_RIGID hdr;
101   RawAddress bd_addr;
102   tBTA_DM_SEARCH_CBACK* p_cback;
103   tBT_TRANSPORT transport;
104 } tBTA_DM_API_DISCOVER;
105 
106 typedef struct {
107   RawAddress bd_addr;
108   bool accept;
109   uint8_t pin_len;
110   uint8_t p_pin[PIN_CODE_LEN];
111 } tBTA_DM_API_PIN_REPLY;
112 
113 typedef struct {
114   BT_HDR_RIGID hdr;
115   RawAddress bd_addr;
116   tBTM_IO_CAP io_cap;
117   tBTM_OOB_DATA oob_data;
118   tBTM_AUTH_REQ auth_req;
119 } tBTA_DM_CI_IO_REQ;
120 
121 typedef struct {
122   RawAddress bd_addr;
123   Octet16 c;
124   Octet16 r;
125   bool accept;
126 } tBTA_DM_CI_RMT_OOB;
127 
128 /* data type for BTA_DM_REMT_NAME_EVT */
129 typedef struct {
130   BT_HDR_RIGID hdr;
131   tBTA_DM_SEARCH result;
132 } tBTA_DM_REM_NAME;
133 
134 /* data type for tBTA_DM_DISC_RESULT */
135 typedef struct {
136   BT_HDR_RIGID hdr;
137   tBTA_DM_SEARCH result;
138 } tBTA_DM_DISC_RESULT;
139 
140 /* data type for BTA_DM_INQUIRY_CMPL_EVT */
141 typedef struct {
142   BT_HDR_RIGID hdr;
143   uint8_t num;
144 } tBTA_DM_INQUIRY_CMPL;
145 
146 /* data type for BTA_DM_SDP_RESULT_EVT */
147 typedef struct {
148   BT_HDR_RIGID hdr;
149   tSDP_RESULT sdp_result;
150 } tBTA_DM_SDP_RESULT;
151 
152 typedef struct {
153   RawAddress bd_addr;
154   DEV_CLASS dc;
155   LinkKey link_key;
156   uint8_t key_type;
157   bool link_key_known;
158   bool dc_known;
159   BD_NAME bd_name;
160   uint8_t pin_length;
161 } tBTA_DM_API_ADD_DEVICE;
162 
163 typedef struct {
164   BT_HDR_RIGID hdr;
165   bool enable;
166 } tBTA_DM_API_BLE_FEATURE;
167 
168 /* union of all data types */
169 typedef union {
170   /* GKI event buffer header */
171   BT_HDR_RIGID hdr;
172 
173   tBTA_DM_API_SEARCH search;
174 
175   tBTA_DM_API_DISCOVER discover;
176 
177   tBTA_DM_REM_NAME rem_name;
178 
179   tBTA_DM_DISC_RESULT disc_result;
180 
181   tBTA_DM_INQUIRY_CMPL inq_cmpl;
182 
183   tBTA_DM_SDP_RESULT sdp_event;
184 
185 } tBTA_DM_MSG;
186 
187 #define BTA_DM_NUM_PEER_DEVICE 7
188 
189 typedef enum : uint8_t {
190   BTA_DM_NOT_CONNECTED = 0,
191   BTA_DM_CONNECTED = 1,
192   BTA_DM_UNPAIRING = 2,
193 } tBTA_DM_CONN_STATE;
194 
bta_conn_state_text(tBTA_DM_CONN_STATE state)195 inline std::string bta_conn_state_text(tBTA_DM_CONN_STATE state) {
196   switch (state) {
197     CASE_RETURN_TEXT(BTA_DM_NOT_CONNECTED);
198     CASE_RETURN_TEXT(BTA_DM_CONNECTED);
199     CASE_RETURN_TEXT(BTA_DM_UNPAIRING);
200     default:
201       return std::string("UNKNOWN");
202   }
203 }
204 
205 typedef enum : uint8_t {
206   BTA_DM_DI_NONE = 0x00,      /* nothing special */
207   BTA_DM_DI_SET_SNIFF = 0x01, /* set this bit if call BTM_SetPowerMode(sniff) */
208   BTA_DM_DI_INT_SNIFF = 0x02, /* set this bit if call BTM_SetPowerMode(sniff) &
209                                  enter sniff mode */
210   BTA_DM_DI_ACP_SNIFF = 0x04, /* set this bit if peer init sniff */
211   BTA_DM_DI_UNUSED = 0x08,
212   BTA_DM_DI_USE_SSR = 0x10, /* set this bit if ssr is supported for this link */
213   BTA_DM_DI_AV_ACTIVE = 0x20, /* set this bit if AV is active for this link */
214 } tBTA_DM_DEV_INFO_BITMASK;
215 typedef uint8_t tBTA_DM_DEV_INFO;
216 
device_info_text(tBTA_DM_DEV_INFO info)217 inline std::string device_info_text(tBTA_DM_DEV_INFO info) {
218   const char* const device_info_text[] = {
219       ":set_sniff", ":int_sniff", ":acp_sniff",
220       ":unused",    ":use_ssr",   ":av_active",
221   };
222 
223   std::string s = base::StringPrintf("0x%02x", info);
224   if (info == BTA_DM_DI_NONE) return s + std::string(":none");
225   for (size_t i = 0; i < sizeof(device_info_text) / sizeof(device_info_text[0]);
226        i++) {
227     if (info & (1u << i)) s += std::string(device_info_text[i]);
228   }
229   return s;
230 }
231 
232 /* set power mode request type */
233 #define BTA_DM_PM_RESTART 1
234 #define BTA_DM_PM_NEW_REQ 2
235 #define BTA_DM_PM_EXECUTE 3
236 typedef uint8_t tBTA_DM_PM_REQ;
237 
238 struct tBTA_DM_PEER_DEVICE {
239   RawAddress peer_bdaddr;
240   tBTA_DM_CONN_STATE conn_state;
241   tBTA_PREF_ROLES pref_role;
242   bool in_use;
243 
244  private:
245   friend void bta_dm_acl_up(const RawAddress& bd_addr, tBT_TRANSPORT transport);
246   friend void bta_dm_pm_btm_status(const RawAddress& bd_addr,
247                                    tBTM_PM_STATUS status, uint16_t value,
248                                    tHCI_STATUS hci_status);
249   friend void bta_dm_pm_sniff(struct tBTA_DM_PEER_DEVICE* p_peer_dev,
250                               uint8_t index);
251   friend void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
252                               uint8_t app_id, const RawAddress& peer_addr);
253   friend void handle_remote_features_complete(const RawAddress& bd_addr);
254   tBTA_DM_DEV_INFO info;
255 
256  public:
InfotBTA_DM_PEER_DEVICE257   tBTA_DM_DEV_INFO Info() const { return info; }
258 
259   tBTA_DM_ENCRYPT_CBACK* p_encrypt_cback;
260   tBTM_PM_STATUS prev_low; /* previous low power mode used */
261   tBTA_DM_PM_ACTION pm_mode_attempted;
262   tBTA_DM_PM_ACTION pm_mode_failed;
263   bool remove_dev_pending;
264   tBT_TRANSPORT transport;
265 };
266 
267 /* structure to store list of
268   active connections */
269 typedef struct {
270   tBTA_DM_PEER_DEVICE peer_device[BTA_DM_NUM_PEER_DEVICE];
271   uint8_t count;
272   uint8_t le_count;
273 } tBTA_DM_ACTIVE_LINK;
274 
275 typedef struct {
276   RawAddress peer_bdaddr;
277   tBTA_SYS_ID id;
278   uint8_t app_id;
279   tBTA_SYS_CONN_STATUS state;
280   bool new_request;
281 
ToString__anonfae472671108282   std::string ToString() const {
283     return base::StringPrintf(
284         "peer:%s sys_name:%s app_id:%hhu state:%s new:request:%s",
285         PRIVATE_ADDRESS(peer_bdaddr), BtaIdSysText(id).c_str(), app_id,
286         bta_sys_conn_status_text(state).c_str(), logbool(new_request).c_str());
287   }
288 
289 } tBTA_DM_SRVCS;
290 
291 #ifndef BTA_DM_NUM_CONN_SRVS
292 #define BTA_DM_NUM_CONN_SRVS 30
293 #endif
294 
295 typedef struct {
296   uint8_t count;
297   tBTA_DM_SRVCS conn_srvc[BTA_DM_NUM_CONN_SRVS];
298 
299 } tBTA_DM_CONNECTED_SRVCS;
300 
301 typedef struct {
302 #define BTA_DM_PM_SNIFF_TIMER_IDX 0
303 #define BTA_DM_PM_PARK_TIMER_IDX 1
304 #define BTA_DM_PM_SUSPEND_TIMER_IDX 2
305 #define BTA_DM_PM_MODE_TIMER_MAX 3
306   /*
307    * Keep three different timers for PARK, SNIFF and SUSPEND if TBFC is
308    * supported.
309    */
310   alarm_t* timer[BTA_DM_PM_MODE_TIMER_MAX];
311 
312   uint8_t srvc_id[BTA_DM_PM_MODE_TIMER_MAX];
313   uint8_t pm_action[BTA_DM_PM_MODE_TIMER_MAX];
314   uint8_t active; /* number of active timer */
315 
316   RawAddress peer_bdaddr;
317   bool in_use;
318 } tBTA_PM_TIMER;
319 
320 extern tBTA_DM_CONNECTED_SRVCS bta_dm_conn_srvcs;
321 
322 #define BTA_DM_NUM_PM_TIMER 7
323 
324 /* DM control block */
325 typedef struct {
326   tBTA_DM_ACTIVE_LINK device_list;
327   tBTA_DM_SEC_CBACK* p_sec_cback;
328   tBTA_BLE_ENERGY_INFO_CBACK* p_energy_info_cback;
329   bool disabling;
330   alarm_t* disable_timer;
331   uint8_t pm_id;
332   tBTA_PM_TIMER pm_timer[BTA_DM_NUM_PM_TIMER];
333   uint8_t cur_av_count;   /* current AV connecions */
334 
335   /* Storage for pin code request parameters */
336   RawAddress pin_bd_addr;
337   DEV_CLASS pin_dev_class;
338   tBTA_DM_SEC_EVT pin_evt;
339   tBTM_IO_CAP loc_io_caps;    /* IO Capabilities of local device */
340   tBTM_IO_CAP rmt_io_caps;    /* IO Capabilities of remote device */
341   tBTM_AUTH_REQ loc_auth_req; /* Authentication required for local device */
342   tBTM_AUTH_REQ rmt_auth_req;
343   uint32_t num_val; /* the numeric value for comparison. If just_works, do not
344                        show this number to UI */
345   bool just_works;  /* true, if "Just Works" association model */
346 #if (BTA_EIR_CANNED_UUID_LIST != TRUE)
347   /* store UUID list for EIR */
348   uint32_t eir_uuid[BTM_EIR_SERVICE_ARRAY_SIZE];
349 #if (BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
350   tBTA_CUSTOM_UUID bta_custom_uuid[BTA_EIR_SERVER_NUM_CUSTOM_UUID];
351 #endif
352 
353 #endif
354 
355   tBTA_DM_ENCRYPT_CBACK* p_encrypt_cback;
356   alarm_t* switch_delay_timer;
357 } tBTA_DM_CB;
358 
359 /* DM search control block */
360 typedef struct {
361   tBTA_DM_SEARCH_CBACK* p_search_cback;
362   tBTM_INQ_INFO* p_btm_inq_info;
363   tBTA_SERVICE_MASK services;
364   tBTA_SERVICE_MASK services_to_search;
365   tBTA_SERVICE_MASK services_found;
366   tSDP_DISCOVERY_DB* p_sdp_db;
367   uint16_t state;
368   RawAddress peer_bdaddr;
369   bool name_discover_done;
370   BD_NAME peer_name;
371   alarm_t* search_timer;
372   uint8_t service_index;
373   tBTA_DM_MSG* p_pending_search;
374   fixed_queue_t* pending_discovery_queue;
375   bool wait_disc;
376   bool sdp_results;
377   bluetooth::Uuid uuid;
378   uint8_t peer_scn;
379   tBT_TRANSPORT transport;
380   tBTA_DM_SEARCH_CBACK* p_scan_cback;
381   tBTA_DM_SEARCH_CBACK* p_csis_scan_cback;
382   tGATT_IF client_if;
383   uint8_t uuid_to_search;
384   bool gatt_disc_active;
385   uint16_t conn_id;
386   alarm_t* gatt_close_timer; /* GATT channel close delay timer */
387   RawAddress pending_close_bda; /* pending GATT channel remote device address */
388 
389 } tBTA_DM_SEARCH_CB;
390 
391 /* DI control block */
392 typedef struct {
393   uint8_t di_num;                     /* total local DI record number */
394   uint32_t di_handle[BTA_DI_NUM_MAX]; /* local DI record handle, the first one
395                                          is primary record */
396 } tBTA_DM_DI_CB;
397 
398 /* DM search state */
399 typedef enum {
400 
401   BTA_DM_SEARCH_IDLE,
402   BTA_DM_SEARCH_ACTIVE,
403   BTA_DM_SEARCH_CANCELLING,
404   BTA_DM_DISCOVER_ACTIVE
405 
406 } tBTA_DM_STATE;
407 
bta_dm_state_text(const tBTA_DM_STATE & state)408 inline std::string bta_dm_state_text(const tBTA_DM_STATE& state) {
409   switch (state) {
410     CASE_RETURN_TEXT(BTA_DM_SEARCH_IDLE);
411     CASE_RETURN_TEXT(BTA_DM_SEARCH_ACTIVE);
412     CASE_RETURN_TEXT(BTA_DM_SEARCH_CANCELLING);
413     CASE_RETURN_TEXT(BTA_DM_DISCOVER_ACTIVE);
414     default:
415       return base::StringPrintf("UNKNOWN[%d]", state);
416   }
417 }
418 
419 typedef struct {
420   uint16_t page_timeout; /* timeout for page in slots */
421   bool avoid_scatter; /* true to avoid scatternet when av is streaming (be the
422                          central) */
423 
424 } tBTA_DM_CFG;
425 
426 extern const uint32_t bta_service_id_to_btm_srv_id_lkup_tbl[];
427 
428 typedef struct {
429   uint8_t id;
430   uint8_t app_id;
431   uint8_t cfg;
432 
433 } tBTA_DM_RM;
434 
435 extern const tBTA_DM_CFG* p_bta_dm_cfg;
436 extern const tBTA_DM_RM* p_bta_dm_rm_cfg;
437 
438 typedef struct {
439   uint8_t id;
440   uint8_t app_id;
441   uint8_t spec_idx; /* index of spec table to use */
442 
443 } tBTA_DM_PM_CFG;
444 
445 typedef struct {
446   tBTA_DM_PM_ACTION power_mode;
447   uint16_t timeout;
448 
449 } tBTA_DM_PM_ACTN;
450 
451 typedef struct {
452   uint8_t allow_mask; /* mask of sniff/hold/park modes to allow */
453   uint8_t ssr; /* set SSR on conn open/unpark */
454   tBTA_DM_PM_ACTN actn_tbl[BTA_DM_PM_NUM_EVTS][2];
455 
456 } tBTA_DM_PM_SPEC;
457 
458 typedef struct {
459   uint16_t max_lat;
460   uint16_t min_rmt_to;
461   uint16_t min_loc_to;
462   const char* name{nullptr};
463 } tBTA_DM_SSR_SPEC;
464 
465 typedef struct {
466   uint16_t manufacturer;
467   uint16_t lmp_sub_version;
468   uint8_t lmp_version;
469 } tBTA_DM_LMP_VER_INFO;
470 
471 extern const uint16_t bta_service_id_to_uuid_lkup_tbl[];
472 
473 /* For Insight, PM cfg lookup tables are runtime configurable (to allow tweaking
474  * of params for power consumption measurements) */
475 #ifndef BTE_SIM_APP
476 #define tBTA_DM_PM_TYPE_QUALIFIER const
477 #else
478 #define tBTA_DM_PM_TYPE_QUALIFIER
479 #endif
480 
481 extern const tBTA_DM_PM_CFG* p_bta_dm_pm_cfg;
482 tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_SPEC* get_bta_dm_pm_spec();
483 extern const tBTM_PM_PWR_MD* p_bta_dm_pm_md;
484 extern tBTA_DM_SSR_SPEC* p_bta_dm_ssr_spec;
485 
486 /* update dynamic BRCM Aware EIR data */
487 extern const tBTA_DM_EIR_CONF bta_dm_eir_cfg;
488 extern const tBTA_DM_EIR_CONF* p_bta_dm_eir_cfg;
489 
490 /* DM control block */
491 extern tBTA_DM_CB bta_dm_cb;
492 
493 /* DM search control block */
494 extern tBTA_DM_SEARCH_CB bta_dm_search_cb;
495 
496 /* DI control block */
497 extern tBTA_DM_DI_CB bta_dm_di_cb;
498 
499 extern bool bta_dm_search_sm_execute(BT_HDR_RIGID* p_msg);
500 extern void bta_dm_search_sm_disable(void);
501 
502 extern void bta_dm_enable(tBTA_DM_SEC_CBACK*);
503 extern void bta_dm_disable();
504 extern void bta_dm_init_cb(void);
505 extern void bta_dm_deinit_cb(void);
506 extern void bta_dm_set_dev_name(const std::vector<uint8_t>&);
507 extern void bta_dm_set_visibility(tBTA_DM_DISC, tBTA_DM_CONN);
508 extern void bta_dm_set_scan_config(tBTA_DM_MSG* p_data);
509 extern void bta_dm_vendor_spec_command(tBTA_DM_MSG* p_data);
510 extern void bta_dm_bond(const RawAddress&, tBLE_ADDR_TYPE, tBT_TRANSPORT,
511                         tBT_DEVICE_TYPE);
512 extern void bta_dm_bond_cancel(const RawAddress&);
513 extern void bta_dm_pin_reply(std::unique_ptr<tBTA_DM_API_PIN_REPLY> msg);
514 extern void bta_dm_add_device(std::unique_ptr<tBTA_DM_API_ADD_DEVICE> msg);
515 extern void bta_dm_remove_device(const RawAddress& bd_addr);
516 extern void bta_dm_close_acl(const RawAddress&, bool, tBT_TRANSPORT);
517 
518 extern void bta_dm_pm_btm_status(const RawAddress&, tBTM_PM_STATUS, uint16_t,
519                                  tHCI_STATUS);
520 extern void bta_dm_pm_timer(const RawAddress&, tBTA_DM_PM_ACTION);
521 extern void bta_dm_add_ampkey(tBTA_DM_MSG* p_data);
522 
523 extern void bta_dm_add_blekey(const RawAddress& bd_addr,
524                               tBTA_LE_KEY_VALUE blekey,
525                               tBTM_LE_KEY_TYPE key_type);
526 extern void bta_dm_add_ble_device(const RawAddress& bd_addr,
527                                   tBLE_ADDR_TYPE addr_type,
528                                   tBT_DEVICE_TYPE dev_type);
529 extern void bta_dm_ble_passkey_reply(const RawAddress& bd_addr, bool accept,
530                                      uint32_t passkey);
531 extern void bta_dm_ble_confirm_reply(const RawAddress&, bool);
532 extern void bta_dm_ble_set_conn_params(const RawAddress&, uint16_t, uint16_t,
533                                        uint16_t, uint16_t);
534 extern void bta_dm_close_gatt_conn(tBTA_DM_MSG* p_data);
535 extern void bta_dm_ble_observe(bool, uint8_t, tBTA_DM_SEARCH_CBACK*);
536 extern void bta_dm_ble_scan(bool, uint8_t);
537 extern void bta_dm_ble_csis_observe(bool, tBTA_DM_SEARCH_CBACK*);
538 extern void bta_dm_ble_update_conn_params(const RawAddress&, uint16_t, uint16_t,
539                                           uint16_t, uint16_t, uint16_t,
540                                           uint16_t);
541 extern void bta_dm_ble_config_local_privacy(bool);
542 
543 extern void bta_dm_ble_set_data_length(const RawAddress& bd_addr);
544 
545 extern void bta_dm_ble_get_energy_info(tBTA_BLE_ENERGY_INFO_CBACK*);
546 
547 extern void bta_dm_set_encryption(const RawAddress&, tBT_TRANSPORT,
548                                   tBTA_DM_ENCRYPT_CBACK*, tBTM_BLE_SEC_ACT);
549 extern void bta_dm_confirm(const RawAddress&, bool);
550 
551 extern void bta_dm_ci_rmt_oob_act(std::unique_ptr<tBTA_DM_CI_RMT_OOB> msg);
552 
553 extern void bta_dm_init_pm(void);
554 extern void bta_dm_disable_pm(void);
555 
556 extern uint8_t bta_dm_get_av_count(void);
557 extern void bta_dm_search_start(tBTA_DM_MSG* p_data);
558 extern void bta_dm_search_cancel();
559 extern void bta_dm_discover(tBTA_DM_MSG* p_data);
560 extern void bta_dm_inq_cmpl(uint8_t num);
561 extern void bta_dm_rmt_name(tBTA_DM_MSG* p_data);
562 extern void bta_dm_sdp_result(tBTA_DM_MSG* p_data);
563 extern void bta_dm_search_cmpl();
564 extern void bta_dm_free_sdp_db();
565 extern void bta_dm_disc_result(tBTA_DM_MSG* p_data);
566 extern void bta_dm_search_result(tBTA_DM_MSG* p_data);
567 extern void bta_dm_discovery_cmpl(tBTA_DM_MSG* p_data);
568 extern void bta_dm_queue_search(tBTA_DM_MSG* p_data);
569 extern void bta_dm_queue_disc(tBTA_DM_MSG* p_data);
570 extern void bta_dm_execute_queued_request();
571 extern bool bta_dm_is_search_request_queued();
572 extern void bta_dm_search_clear_queue();
573 extern void bta_dm_search_cancel_notify();
574 extern void bta_dm_disc_rmt_name(tBTA_DM_MSG* p_data);
575 extern tBTA_DM_PEER_DEVICE* bta_dm_find_peer_device(
576     const RawAddress& peer_addr);
577 
578 extern void bta_dm_clear_event_filter(void);
579 
580 extern void bta_dm_ble_reset_id(void);
581 
582 uint8_t bta_dm_search_get_state();
583 void bta_dm_search_set_state(uint8_t state);
584 
585 void bta_dm_eir_update_uuid(uint16_t uuid16, bool adding);
586 void bta_dm_eir_update_cust_uuid(const tBTA_CUSTOM_UUID &curr, bool adding);
587 
588 #undef CASE_RETURN_TEXT
589 #endif /* BTA_DM_INT_H */
590