• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 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 "bt_target.h"
28 
29 #if (BLE_INCLUDED == TRUE && (defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
30     #include "bta_gatt_api.h"
31 #endif
32 
33 
34 
35 /*****************************************************************************
36 **  Constants and data types
37 *****************************************************************************/
38 
39 
40 #define BTA_COPY_DEVICE_CLASS(coddst, codsrc)   {((UINT8 *)(coddst))[0] = ((UINT8 *)(codsrc))[0]; \
41                                                  ((UINT8 *)(coddst))[1] = ((UINT8 *)(codsrc))[1];  \
42                                                  ((UINT8 *)(coddst))[2] = ((UINT8 *)(codsrc))[2];}
43 
44 
45 #define BTA_DM_MSG_LEN 50
46 
47 #define BTA_SERVICE_ID_TO_SERVICE_MASK(id)       (1 << (id))
48 
49 /* DM events */
50 enum
51 {
52     /* device manager local device API events */
53     BTA_DM_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_DM),
54     BTA_DM_API_DISABLE_EVT,
55     BTA_DM_API_SET_NAME_EVT,
56     BTA_DM_API_SET_VISIBILITY_EVT,
57 
58     BTA_DM_ACL_CHANGE_EVT,
59     BTA_DM_API_ADD_DEVICE_EVT,
60     BTA_DM_API_REMOVE_ACL_EVT,
61 
62     /* security API events */
63     BTA_DM_API_BOND_EVT,
64     BTA_DM_API_BOND_CANCEL_EVT,
65     BTA_DM_API_PIN_REPLY_EVT,
66 
67     /* power manger events */
68     BTA_DM_PM_BTM_STATUS_EVT,
69     BTA_DM_PM_TIMER_EVT,
70 
71     /* simple pairing events */
72     BTA_DM_API_CONFIRM_EVT,
73 
74     BTA_DM_API_SET_ENCRYPTION_EVT,
75 
76     BTA_DM_API_LOC_OOB_EVT,
77     BTA_DM_CI_IO_REQ_EVT,
78     BTA_DM_CI_RMT_OOB_EVT,
79 
80 
81 #if BLE_INCLUDED == TRUE
82     BTA_DM_API_ADD_BLEKEY_EVT,
83     BTA_DM_API_ADD_BLEDEVICE_EVT,
84     BTA_DM_API_BLE_PASSKEY_REPLY_EVT,
85     BTA_DM_API_BLE_CONFIRM_REPLY_EVT,
86     BTA_DM_API_BLE_SEC_GRANT_EVT,
87     BTA_DM_API_BLE_SET_BG_CONN_TYPE,
88     BTA_DM_API_BLE_CONN_PARAM_EVT,
89     BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT,
90     BTA_DM_API_BLE_SCAN_PARAM_EVT,
91     BTA_DM_API_BLE_OBSERVE_EVT,
92     BTA_DM_API_UPDATE_CONN_PARAM_EVT,
93 #if BLE_PRIVACY_SPT == TRUE
94     BTA_DM_API_LOCAL_PRIVACY_EVT,
95 #endif
96     BTA_DM_API_BLE_ADV_PARAM_EVT,
97     BTA_DM_API_BLE_SET_ADV_CONFIG_EVT,
98     BTA_DM_API_BLE_SET_SCAN_RSP_EVT,
99     BTA_DM_API_BLE_BROADCAST_EVT,
100     BTA_DM_API_SET_DATA_LENGTH_EVT,
101 
102 #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
103     BTA_DM_API_CFG_FILTER_COND_EVT,
104     BTA_DM_API_SCAN_FILTER_SETUP_EVT,
105     BTA_DM_API_SCAN_FILTER_ENABLE_EVT,
106 #endif
107     BTA_DM_API_BLE_MULTI_ADV_ENB_EVT,
108     BTA_DM_API_BLE_MULTI_ADV_PARAM_UPD_EVT,
109     BTA_DM_API_BLE_MULTI_ADV_DATA_EVT,
110     BTA_DM_API_BLE_MULTI_ADV_DISABLE_EVT,
111     BTA_DM_API_BLE_SETUP_STORAGE_EVT,
112     BTA_DM_API_BLE_ENABLE_BATCH_SCAN_EVT,
113     BTA_DM_API_BLE_DISABLE_BATCH_SCAN_EVT,
114     BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT,
115     BTA_DM_API_BLE_TRACK_ADVERTISER_EVT,
116     BTA_DM_API_BLE_ENERGY_INFO_EVT,
117 
118 #endif
119 
120     BTA_DM_API_ENABLE_TEST_MODE_EVT,
121     BTA_DM_API_DISABLE_TEST_MODE_EVT,
122     BTA_DM_API_EXECUTE_CBACK_EVT,
123     BTA_DM_API_REMOVE_ALL_ACL_EVT,
124     BTA_DM_API_REMOVE_DEVICE_EVT,
125     BTA_DM_MAX_EVT
126 };
127 
128 
129 /* DM search events */
130 enum
131 {
132     /* DM search API events */
133     BTA_DM_API_SEARCH_EVT = BTA_SYS_EVT_START(BTA_ID_DM_SEARCH),
134     BTA_DM_API_SEARCH_CANCEL_EVT,
135     BTA_DM_API_DISCOVER_EVT,
136     BTA_DM_INQUIRY_CMPL_EVT,
137     BTA_DM_REMT_NAME_EVT,
138     BTA_DM_SDP_RESULT_EVT,
139     BTA_DM_SEARCH_CMPL_EVT,
140     BTA_DM_DISCOVERY_RESULT_EVT,
141     BTA_DM_API_DI_DISCOVER_EVT,
142     BTA_DM_DISC_CLOSE_TOUT_EVT
143 
144 };
145 
146 /* data type for BTA_DM_API_ENABLE_EVT */
147 typedef struct
148 {
149     BT_HDR              hdr;
150     tBTA_DM_SEC_CBACK *p_sec_cback;
151 } tBTA_DM_API_ENABLE;
152 
153 /* data type for BTA_DM_API_SET_NAME_EVT */
154 typedef struct
155 {
156     BT_HDR              hdr;
157     BD_NAME             name; /* max 248 bytes name, plus must be Null terminated */
158 } tBTA_DM_API_SET_NAME;
159 
160 /* data type for BTA_DM_API_SET_VISIBILITY_EVT */
161 typedef struct
162 {
163     BT_HDR              hdr;
164     tBTA_DM_DISC    disc_mode;
165     tBTA_DM_CONN    conn_mode;
166     UINT8           pair_mode;
167     UINT8           conn_paired_only;
168 } tBTA_DM_API_SET_VISIBILITY;
169 
170 enum
171 {
172     BTA_DM_RS_NONE,     /* straight API call */
173     BTA_DM_RS_OK,       /* the role switch result - successful */
174     BTA_DM_RS_FAIL      /* the role switch result - failed */
175 };
176 typedef UINT8 tBTA_DM_RS_RES;
177 
178 /* data type for BTA_DM_API_SEARCH_EVT */
179 typedef struct
180 {
181     BT_HDR      hdr;
182     tBTA_DM_INQ inq_params;
183     tBTA_SERVICE_MASK services;
184     tBTA_DM_SEARCH_CBACK * p_cback;
185     tBTA_DM_RS_RES  rs_res;
186 #if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
187     UINT8           num_uuid;
188     tBT_UUID        *p_uuid;
189 #endif
190 } tBTA_DM_API_SEARCH;
191 
192 /* data type for BTA_DM_API_DISCOVER_EVT */
193 typedef struct
194 {
195     BT_HDR      hdr;
196     BD_ADDR bd_addr;
197     tBTA_SERVICE_MASK services;
198     tBTA_DM_SEARCH_CBACK * p_cback;
199     BOOLEAN         sdp_search;
200     tBTA_TRANSPORT  transport;
201 #if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
202     UINT8           num_uuid;
203     tBT_UUID        *p_uuid;
204 #endif
205     tSDP_UUID    uuid;
206 } tBTA_DM_API_DISCOVER;
207 
208 /* data type for BTA_DM_API_DI_DISC_EVT */
209 typedef struct
210 {
211     BT_HDR              hdr;
212     BD_ADDR             bd_addr;
213     tBTA_DISCOVERY_DB   *p_sdp_db;
214     UINT32              len;
215     tBTA_DM_SEARCH_CBACK * p_cback;
216 }tBTA_DM_API_DI_DISC;
217 
218 /* data type for BTA_DM_API_BOND_EVT */
219 typedef struct
220 {
221     BT_HDR      hdr;
222     BD_ADDR bd_addr;
223     tBTA_TRANSPORT transport;
224 } tBTA_DM_API_BOND;
225 
226 /* data type for BTA_DM_API_BOND_CANCEL_EVT */
227 typedef struct
228 {
229     BT_HDR          hdr;
230     BD_ADDR         bd_addr;
231     tBTA_TRANSPORT  transport;
232 } tBTA_DM_API_BOND_CANCEL;
233 
234 /* data type for BTA_DM_API_PIN_REPLY_EVT */
235 typedef struct
236 {
237     BT_HDR      hdr;
238     BD_ADDR bd_addr;
239     BOOLEAN accept;
240     UINT8 pin_len;
241     UINT8 p_pin[PIN_CODE_LEN];
242 } tBTA_DM_API_PIN_REPLY;
243 
244 /* data type for BTA_DM_API_LOC_OOB_EVT */
245 typedef struct
246 {
247     BT_HDR      hdr;
248 } tBTA_DM_API_LOC_OOB;
249 
250 /* data type for BTA_DM_API_CONFIRM_EVT */
251 typedef struct
252 {
253     BT_HDR      hdr;
254     BD_ADDR     bd_addr;
255     BOOLEAN     accept;
256 } tBTA_DM_API_CONFIRM;
257 
258 /* data type for BTA_DM_CI_IO_REQ_EVT */
259 typedef struct
260 {
261     BT_HDR          hdr;
262     BD_ADDR         bd_addr;
263     tBTA_IO_CAP     io_cap;
264     tBTA_OOB_DATA   oob_data;
265     tBTA_AUTH_REQ   auth_req;
266 } tBTA_DM_CI_IO_REQ;
267 
268 /* data type for BTA_DM_CI_RMT_OOB_EVT */
269 typedef struct
270 {
271     BT_HDR      hdr;
272     BD_ADDR     bd_addr;
273     BT_OCTET16  c;
274     BT_OCTET16  r;
275     BOOLEAN     accept;
276 } tBTA_DM_CI_RMT_OOB;
277 
278 /* data type for BTA_DM_REMT_NAME_EVT */
279 typedef struct
280 {
281     BT_HDR      hdr;
282     tBTA_DM_SEARCH  result;
283 } tBTA_DM_REM_NAME;
284 
285 /* data type for tBTA_DM_DISC_RESULT */
286 typedef struct
287 {
288     BT_HDR      hdr;
289     tBTA_DM_SEARCH  result;
290 } tBTA_DM_DISC_RESULT;
291 
292 
293 /* data type for BTA_DM_INQUIRY_CMPL_EVT */
294 typedef struct
295 {
296     BT_HDR      hdr;
297     UINT8       num;
298 } tBTA_DM_INQUIRY_CMPL;
299 
300 /* data type for BTA_DM_SDP_RESULT_EVT */
301 typedef struct
302 {
303     BT_HDR      hdr;
304     UINT16 sdp_result;
305 } tBTA_DM_SDP_RESULT;
306 
307 /* data type for BTA_DM_ACL_CHANGE_EVT */
308 typedef struct
309 {
310     BT_HDR          hdr;
311     tBTM_BL_EVENT   event;
312     UINT8           busy_level;
313     UINT8           busy_level_flags;
314     BOOLEAN         is_new;
315     UINT8           new_role;
316     BD_ADDR         bd_addr;
317     UINT8           hci_status;
318 #if BLE_INCLUDED == TRUE
319     UINT16          handle;
320     tBT_TRANSPORT   transport;
321 #endif
322 } tBTA_DM_ACL_CHANGE;
323 
324 /* data type for BTA_DM_PM_BTM_STATUS_EVT */
325 typedef struct
326 {
327 
328     BT_HDR          hdr;
329     BD_ADDR         bd_addr;
330     tBTM_PM_STATUS  status;
331     UINT16          value;
332     UINT8           hci_status;
333 
334 } tBTA_DM_PM_BTM_STATUS;
335 
336 /* data type for BTA_DM_PM_TIMER_EVT */
337 typedef struct
338 {
339     BT_HDR          hdr;
340     BD_ADDR         bd_addr;
341     tBTA_DM_PM_ACTION  pm_request;
342 } tBTA_DM_PM_TIMER;
343 
344 
345 /* data type for BTA_DM_API_ADD_DEVICE_EVT */
346 typedef struct
347 {
348     BT_HDR              hdr;
349     BD_ADDR             bd_addr;
350     DEV_CLASS           dc;
351     LINK_KEY            link_key;
352     tBTA_SERVICE_MASK   tm;
353     BOOLEAN             is_trusted;
354     UINT8               key_type;
355     tBTA_IO_CAP         io_cap;
356     BOOLEAN             link_key_known;
357     BOOLEAN             dc_known;
358     BD_NAME             bd_name;
359     UINT8               features[BTA_FEATURE_BYTES_PER_PAGE * (BTA_EXT_FEATURES_PAGE_MAX + 1)];
360     UINT8               pin_length;
361 } tBTA_DM_API_ADD_DEVICE;
362 
363 /* data type for BTA_DM_API_REMOVE_ACL_EVT */
364 typedef struct
365 {
366     BT_HDR              hdr;
367     BD_ADDR             bd_addr;
368 } tBTA_DM_API_REMOVE_DEVICE;
369 
370 /* data type for BTA_DM_API_EXECUTE_CBACK_EVT */
371 typedef struct
372 {
373     BT_HDR               hdr;
374     void *               p_param;
375     tBTA_DM_EXEC_CBACK  *p_exec_cback;
376 } tBTA_DM_API_EXECUTE_CBACK;
377 
378 /* data type for tBTA_DM_API_SET_ENCRYPTION */
379 typedef struct
380 {
381     BT_HDR                    hdr;
382     tBTA_TRANSPORT            transport;
383     tBTA_DM_ENCRYPT_CBACK     *p_callback;
384     tBTA_DM_BLE_SEC_ACT       sec_act;
385     BD_ADDR                   bd_addr;
386 } tBTA_DM_API_SET_ENCRYPTION;
387 
388 #if BLE_INCLUDED == TRUE
389 typedef struct
390 {
391     BT_HDR                  hdr;
392     BD_ADDR                 bd_addr;
393     tBTA_LE_KEY_VALUE       blekey;
394     tBTA_LE_KEY_TYPE        key_type;
395 
396 }tBTA_DM_API_ADD_BLEKEY;
397 
398 typedef struct
399 {
400     BT_HDR                  hdr;
401     BD_ADDR                 bd_addr;
402     tBT_DEVICE_TYPE         dev_type ;
403     tBLE_ADDR_TYPE          addr_type;
404 
405 }tBTA_DM_API_ADD_BLE_DEVICE;
406 
407 typedef struct
408 {
409     BT_HDR                  hdr;
410     BD_ADDR                 bd_addr;
411     BOOLEAN                 accept;
412     UINT32                  passkey;
413 }tBTA_DM_API_PASSKEY_REPLY;
414 
415 typedef struct
416 {
417     BT_HDR                  hdr;
418     BD_ADDR                 bd_addr;
419     tBTA_DM_BLE_SEC_GRANT   res;
420 }tBTA_DM_API_BLE_SEC_GRANT;
421 
422 
423 typedef struct
424 {
425     BT_HDR                  hdr;
426     tBTA_DM_BLE_CONN_TYPE   bg_conn_type;
427     tBTA_DM_BLE_SEL_CBACK   *p_select_cback;
428 }tBTA_DM_API_BLE_SET_BG_CONN_TYPE;
429 
430 /* set prefered BLE connection parameters for a device */
431 typedef struct
432 {
433     BT_HDR                  hdr;
434     BD_ADDR                 peer_bda;
435     UINT16                  conn_int_min;
436     UINT16                  conn_int_max;
437     UINT16                  supervision_tout;
438     UINT16                  slave_latency;
439 
440 }tBTA_DM_API_BLE_CONN_PARAMS;
441 
442 typedef struct
443 {
444     BT_HDR                  hdr;
445     BD_ADDR                 peer_bda;
446     BOOLEAN                 privacy_enable;
447 
448 }tBTA_DM_API_ENABLE_PRIVACY;
449 
450 typedef struct
451 {
452     BT_HDR                  hdr;
453     BOOLEAN                 privacy_enable;
454 }tBTA_DM_API_LOCAL_PRIVACY;
455 
456 /* set scan parameter for BLE connections */
457 typedef struct
458 {
459     BT_HDR hdr;
460     tBTA_GATTC_IF client_if;
461     UINT32 scan_int;
462     UINT32 scan_window;
463     tBLE_SCAN_MODE scan_mode;
464     tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback;
465 }tBTA_DM_API_BLE_SCAN_PARAMS;
466 
467 /* set scan parameter for BLE connections */
468 typedef struct
469 {
470     BT_HDR                  hdr;
471     UINT16                  scan_int;
472     UINT16                  scan_window;
473 } tBTA_DM_API_BLE_CONN_SCAN_PARAMS;
474 
475 /* Data type for start/stop observe */
476 typedef struct
477 {
478     BT_HDR                  hdr;
479     BOOLEAN                 start;
480     UINT16                  duration;
481     tBTA_DM_SEARCH_CBACK * p_cback;
482 }tBTA_DM_API_BLE_OBSERVE;
483 
484 typedef struct
485 {
486     BT_HDR      hdr;
487     BD_ADDR     remote_bda;
488     UINT16      tx_data_length;
489 }tBTA_DM_API_BLE_SET_DATA_LENGTH;
490 
491 /* set adv parameter for BLE advertising */
492 typedef struct
493 {
494     BT_HDR                  hdr;
495     UINT16                  adv_int_min;
496     UINT16                  adv_int_max;
497     tBLE_BD_ADDR            *p_dir_bda;
498 }tBTA_DM_API_BLE_ADV_PARAMS;
499 
500 typedef struct
501 {
502     BT_HDR                  hdr;
503     BOOLEAN                 enable;
504 
505 }tBTA_DM_API_BLE_FEATURE;
506 
507 /* multi adv data structure */
508 typedef struct
509 {
510     BT_HDR                      hdr;
511     tBTA_BLE_MULTI_ADV_CBACK    *p_cback;
512     void                        *p_ref;
513     tBTA_BLE_ADV_PARAMS         *p_params;
514 }tBTA_DM_API_BLE_MULTI_ADV_ENB;
515 
516 typedef struct
517 {
518     BT_HDR                      hdr;
519     UINT8                        inst_id;
520     tBTA_BLE_ADV_PARAMS         *p_params;
521 }tBTA_DM_API_BLE_MULTI_ADV_PARAM;
522 
523 typedef struct
524 {
525     BT_HDR                  hdr;
526     UINT8                   inst_id;
527     BOOLEAN                 is_scan_rsp;
528     tBTA_BLE_AD_MASK        data_mask;
529     tBTA_BLE_ADV_DATA       data;
530 }tBTA_DM_API_BLE_MULTI_ADV_DATA;
531 
532 typedef struct
533 {
534     BT_HDR                  hdr;
535     UINT8                   inst_id;
536 }tBTA_DM_API_BLE_MULTI_ADV_DISABLE;
537 
538 typedef struct
539 {
540     BT_HDR                  hdr;
541     UINT32                  data_mask;
542     tBTA_BLE_ADV_DATA       adv_cfg;
543     tBTA_SET_ADV_DATA_CMPL_CBACK    *p_adv_data_cback;
544 }tBTA_DM_API_SET_ADV_CONFIG;
545 
546 typedef struct
547 {
548     BT_HDR                  hdr;
549     UINT8                   batch_scan_full_max;
550     UINT8                   batch_scan_trunc_max;
551     UINT8                   batch_scan_notify_threshold;
552     tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback;
553     tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback;
554     tBTA_BLE_SCAN_REP_CBACK *p_read_rep_cback;
555     tBTA_DM_BLE_REF_VALUE    ref_value;
556 } tBTA_DM_API_SET_STORAGE_CONFIG;
557 
558 typedef struct
559 {
560     BT_HDR                  hdr;
561     tBTA_BLE_BATCH_SCAN_MODE  scan_mode;
562     UINT32                  scan_int;
563     UINT32                  scan_window;
564     tBTA_BLE_DISCARD_RULE   discard_rule;
565     tBLE_ADDR_TYPE          addr_type;
566     tBTA_DM_BLE_REF_VALUE   ref_value;
567 } tBTA_DM_API_ENABLE_SCAN;
568 
569 typedef struct
570 {
571     BT_HDR                  hdr;
572     tBTA_DM_BLE_REF_VALUE    ref_value;
573 } tBTA_DM_API_DISABLE_SCAN;
574 
575 typedef struct
576 {
577     BT_HDR                  hdr;
578     tBTA_BLE_BATCH_SCAN_MODE scan_type;
579     tBTA_DM_BLE_REF_VALUE    ref_value;
580 } tBTA_DM_API_READ_SCAN_REPORTS;
581 
582 typedef struct
583 {
584     BT_HDR                  hdr;
585     tBTA_DM_BLE_REF_VALUE ref_value;
586     tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback;
587 } tBTA_DM_API_TRACK_ADVERTISER;
588 
589 typedef struct
590 {
591     BT_HDR                  hdr;
592     tBTA_BLE_ENERGY_INFO_CBACK *p_energy_info_cback;
593 } tBTA_DM_API_ENERGY_INFO;
594 
595 #endif /* BLE_INCLUDED */
596 
597 /* data type for BTA_DM_API_REMOVE_ACL_EVT */
598 typedef struct
599 {
600     BT_HDR      hdr;
601     BD_ADDR     bd_addr;
602     BOOLEAN     remove_dev;
603     tBTA_TRANSPORT transport;
604 
605 }tBTA_DM_API_REMOVE_ACL;
606 
607 /* data type for BTA_DM_API_REMOVE_ALL_ACL_EVT */
608 typedef struct
609 {
610     BT_HDR      hdr;
611     tBTA_DM_LINK_TYPE link_type;
612 
613 } tBTA_DM_API_REMOVE_ALL_ACL;
614 typedef struct
615 {
616     BT_HDR      hdr;
617     BD_ADDR     bd_addr;
618     UINT16      min_int;
619     UINT16      max_int;
620     UINT16      latency;
621     UINT16      timeout;
622 }tBTA_DM_API_UPDATE_CONN_PARAM;
623 
624 #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
625 typedef struct
626 {
627     BT_HDR                          hdr;
628     tBTA_DM_BLE_SCAN_COND_OP        action;
629     tBTA_DM_BLE_PF_COND_TYPE        cond_type;
630     tBTA_DM_BLE_PF_FILT_INDEX       filt_index;
631     tBTA_DM_BLE_PF_COND_PARAM       *p_cond_param;
632     tBTA_DM_BLE_PF_CFG_CBACK      *p_filt_cfg_cback;
633     tBTA_DM_BLE_REF_VALUE            ref_value;
634 }tBTA_DM_API_CFG_FILTER_COND;
635 
636 typedef struct
637 {
638     BT_HDR                          hdr;
639     UINT8                           action;
640     tBTA_DM_BLE_PF_STATUS_CBACK    *p_filt_status_cback;
641     tBTA_DM_BLE_REF_VALUE            ref_value;
642 }tBTA_DM_API_ENABLE_SCAN_FILTER;
643 
644 typedef struct
645 {
646     BT_HDR                          hdr;
647     UINT8                           action;
648     tBTA_DM_BLE_PF_FILT_INDEX       filt_index;
649     tBTA_DM_BLE_PF_FILT_PARAMS      filt_params;
650     tBLE_BD_ADDR                    *p_target;
651     tBTA_DM_BLE_PF_PARAM_CBACK      *p_filt_param_cback;
652     tBTA_DM_BLE_REF_VALUE            ref_value;
653 }tBTA_DM_API_SCAN_FILTER_PARAM_SETUP;
654 #endif
655 
656 /* union of all data types */
657 typedef union
658 {
659     /* GKI event buffer header */
660     BT_HDR              hdr;
661     tBTA_DM_API_ENABLE  enable;
662 
663     tBTA_DM_API_SET_NAME set_name;
664 
665     tBTA_DM_API_SET_VISIBILITY set_visibility;
666 
667     tBTA_DM_API_ADD_DEVICE  add_dev;
668 
669     tBTA_DM_API_REMOVE_DEVICE remove_dev;
670 
671     tBTA_DM_API_SEARCH search;
672 
673     tBTA_DM_API_DISCOVER discover;
674 
675     tBTA_DM_API_BOND bond;
676 
677     tBTA_DM_API_BOND_CANCEL bond_cancel;
678 
679     tBTA_DM_API_PIN_REPLY pin_reply;
680 
681     tBTA_DM_API_LOC_OOB     loc_oob;
682     tBTA_DM_API_CONFIRM     confirm;
683     tBTA_DM_CI_IO_REQ       ci_io_req;
684     tBTA_DM_CI_RMT_OOB      ci_rmt_oob;
685 
686     tBTA_DM_REM_NAME rem_name;
687 
688     tBTA_DM_DISC_RESULT disc_result;
689 
690     tBTA_DM_INQUIRY_CMPL inq_cmpl;
691 
692     tBTA_DM_SDP_RESULT sdp_event;
693 
694     tBTA_DM_ACL_CHANGE  acl_change;
695 
696     tBTA_DM_PM_BTM_STATUS pm_status;
697 
698     tBTA_DM_PM_TIMER pm_timer;
699 
700     tBTA_DM_API_DI_DISC     di_disc;
701 
702     tBTA_DM_API_EXECUTE_CBACK exec_cback;
703 
704     tBTA_DM_API_SET_ENCRYPTION     set_encryption;
705 
706 #if BLE_INCLUDED == TRUE
707     tBTA_DM_API_ADD_BLEKEY              add_ble_key;
708     tBTA_DM_API_ADD_BLE_DEVICE          add_ble_device;
709     tBTA_DM_API_PASSKEY_REPLY           ble_passkey_reply;
710     tBTA_DM_API_BLE_SEC_GRANT           ble_sec_grant;
711     tBTA_DM_API_BLE_SET_BG_CONN_TYPE    ble_set_bd_conn_type;
712     tBTA_DM_API_BLE_CONN_PARAMS         ble_set_conn_params;
713     tBTA_DM_API_BLE_CONN_SCAN_PARAMS    ble_set_conn_scan_params;
714     tBTA_DM_API_BLE_SCAN_PARAMS         ble_set_scan_params;
715     tBTA_DM_API_BLE_OBSERVE             ble_observe;
716     tBTA_DM_API_ENABLE_PRIVACY          ble_remote_privacy;
717     tBTA_DM_API_LOCAL_PRIVACY           ble_local_privacy;
718     tBTA_DM_API_BLE_ADV_PARAMS          ble_set_adv_params;
719     tBTA_DM_API_SET_ADV_CONFIG          ble_set_adv_data;
720 #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
721     tBTA_DM_API_SCAN_FILTER_PARAM_SETUP ble_scan_filt_param_setup;
722     tBTA_DM_API_CFG_FILTER_COND         ble_cfg_filter_cond;
723     tBTA_DM_API_ENABLE_SCAN_FILTER      ble_enable_scan_filt;
724 #endif
725     tBTA_DM_API_UPDATE_CONN_PARAM       ble_update_conn_params;
726     tBTA_DM_API_BLE_SET_DATA_LENGTH     ble_set_data_length;
727 
728     tBTA_DM_API_BLE_MULTI_ADV_ENB       ble_multi_adv_enb;
729     tBTA_DM_API_BLE_MULTI_ADV_PARAM     ble_multi_adv_param;
730     tBTA_DM_API_BLE_MULTI_ADV_DATA      ble_multi_adv_data;
731     tBTA_DM_API_BLE_MULTI_ADV_DISABLE   ble_multi_adv_disable;
732 
733     tBTA_DM_API_SET_STORAGE_CONFIG      ble_set_storage;
734     tBTA_DM_API_ENABLE_SCAN             ble_enable_scan;
735     tBTA_DM_API_READ_SCAN_REPORTS       ble_read_reports;
736     tBTA_DM_API_DISABLE_SCAN            ble_disable_scan;
737     tBTA_DM_API_TRACK_ADVERTISER        ble_track_advert;
738     tBTA_DM_API_ENERGY_INFO             ble_energy_info;
739 #endif
740 
741     tBTA_DM_API_REMOVE_ACL              remove_acl;
742     tBTA_DM_API_REMOVE_ALL_ACL          remove_all_acl;
743 
744 } tBTA_DM_MSG;
745 
746 
747 #define BTA_DM_NUM_PEER_DEVICE 7
748 
749 #define BTA_DM_NOT_CONNECTED  0
750 #define BTA_DM_CONNECTED      1
751 #define BTA_DM_UNPAIRING      2
752 typedef UINT8 tBTA_DM_CONN_STATE;
753 
754 
755 #define BTA_DM_DI_NONE          0x00       /* nothing special */
756 #define BTA_DM_DI_USE_SSR       0x10       /* set this bit if ssr is supported for this link */
757 #define BTA_DM_DI_AV_ACTIVE     0x20       /* set this bit if AV is active for this link */
758 #define BTA_DM_DI_SET_SNIFF     0x01       /* set this bit if call BTM_SetPowerMode(sniff) */
759 #define BTA_DM_DI_INT_SNIFF     0x02       /* set this bit if call BTM_SetPowerMode(sniff) & enter sniff mode */
760 #define BTA_DM_DI_ACP_SNIFF     0x04       /* set this bit if peer init sniff */
761 typedef UINT8 tBTA_DM_DEV_INFO;
762 
763 /* set power mode request type */
764 #define BTA_DM_PM_RESTART       1
765 #define BTA_DM_PM_NEW_REQ       2
766 #define BTA_DM_PM_EXECUTE       3
767 typedef UINT8   tBTA_DM_PM_REQ;
768 
769 typedef struct
770 {
771     BD_ADDR                     peer_bdaddr;
772     UINT16                      link_policy;
773     tBTA_DM_CONN_STATE          conn_state;
774     tBTA_PREF_ROLES             pref_role;
775     BOOLEAN                     in_use;
776     tBTA_DM_DEV_INFO            info;
777     tBTA_DM_ENCRYPT_CBACK      *p_encrypt_cback;
778 #if (BTM_SSR_INCLUDED == TRUE)
779     tBTM_PM_STATUS              prev_low;   /* previous low power mode used */
780 #endif
781     tBTA_DM_PM_ACTION           pm_mode_attempted;
782     tBTA_DM_PM_ACTION           pm_mode_failed;
783     BOOLEAN                     remove_dev_pending;
784 #if BLE_INCLUDED == TRUE
785     UINT16                      conn_handle;
786     tBT_TRANSPORT               transport;
787 #endif
788 } tBTA_DM_PEER_DEVICE;
789 
790 
791 
792 /* structure to store list of
793   active connections */
794 typedef struct
795 {
796     tBTA_DM_PEER_DEVICE    peer_device[BTA_DM_NUM_PEER_DEVICE];
797     UINT8                  count;
798 #if BLE_INCLUDED == TRUE
799     UINT8                  le_count;
800 #endif
801 } tBTA_DM_ACTIVE_LINK;
802 
803 
804 typedef struct
805 {
806     BD_ADDR                 peer_bdaddr;
807     tBTA_SYS_ID             id;
808     UINT8                   app_id;
809     tBTA_SYS_CONN_STATUS    state;
810     BOOLEAN                 new_request;
811 
812 } tBTA_DM_SRVCS;
813 
814 #ifndef BTA_DM_NUM_CONN_SRVS
815 #define BTA_DM_NUM_CONN_SRVS   10
816 #endif
817 
818 typedef struct
819 {
820 
821     UINT8 count;
822     tBTA_DM_SRVCS  conn_srvc[BTA_DM_NUM_CONN_SRVS];
823 
824 }  tBTA_DM_CONNECTED_SRVCS;
825 
826 typedef struct
827 {
828 #define BTA_DM_PM_SNIFF_TIMER_IDX   0
829 #define BTA_DM_PM_PARK_TIMER_IDX    1
830 #define BTA_DM_PM_SUSPEND_TIMER_IDX 2
831 #define BTA_DM_PM_MODE_TIMER_MAX    3
832     /*
833      * Keep three different timers for PARK, SNIFF and SUSPEND if TBFC is
834      * supported.
835      */
836     alarm_t *               timer[BTA_DM_PM_MODE_TIMER_MAX];
837 
838     UINT8                   srvc_id[BTA_DM_PM_MODE_TIMER_MAX];
839     UINT8                   pm_action[BTA_DM_PM_MODE_TIMER_MAX];
840     UINT8                   active;     /* number of active timer */
841 
842     BD_ADDR                 peer_bdaddr;
843     BOOLEAN                 in_use;
844 } tBTA_PM_TIMER;
845 
846 extern tBTA_DM_CONNECTED_SRVCS bta_dm_conn_srvcs;
847 
848 #define BTA_DM_NUM_PM_TIMER 7
849 
850 /* DM control block */
851 typedef struct
852 {
853     BOOLEAN                     is_bta_dm_active;
854     tBTA_DM_ACTIVE_LINK         device_list;
855     tBTA_DM_SEC_CBACK           *p_sec_cback;
856 #if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
857     tBTA_BLE_SCAN_SETUP_CBACK   *p_setup_cback;
858     tBTA_DM_BLE_PF_CFG_CBACK     *p_scan_filt_cfg_cback;
859     tBTA_DM_BLE_PF_STATUS_CBACK  *p_scan_filt_status_cback;
860     tBTA_DM_BLE_PF_PARAM_CBACK   *p_scan_filt_param_cback;
861     tBTA_BLE_MULTI_ADV_CBACK     *p_multi_adv_cback;
862     tBTA_BLE_ENERGY_INFO_CBACK   *p_energy_info_cback;
863 #endif
864     UINT16                      state;
865     BOOLEAN                     disabling;
866     alarm_t                     *disable_timer;
867     UINT32                      wbt_sdp_handle;          /* WIDCOMM Extensions SDP record handle */
868     UINT8                       wbt_scn;                 /* WIDCOMM Extensions SCN */
869     UINT8                       num_master_only;
870     UINT8                       pm_id;
871     tBTA_PM_TIMER               pm_timer[BTA_DM_NUM_PM_TIMER];
872     UINT32                      role_policy_mask;   /* the bits set indicates the modules that wants to remove role switch from the default link policy */
873     UINT16                      cur_policy;         /* current default link policy */
874     UINT16                      rs_event;           /* the event waiting for role switch */
875     UINT8                       cur_av_count;       /* current AV connecions */
876     BOOLEAN                     disable_pair_mode;          /* disable pair mode or not */
877     BOOLEAN                     conn_paired_only;   /* allow connectable to paired device only or not */
878     tBTA_DM_API_SEARCH          search_msg;
879     UINT16                      page_scan_interval;
880     UINT16                      page_scan_window;
881     UINT16                      inquiry_scan_interval;
882     UINT16                      inquiry_scan_window;
883 
884     /* Storage for pin code request parameters */
885     BD_ADDR                     pin_bd_addr;
886     DEV_CLASS                   pin_dev_class;
887     tBTA_DM_SEC_EVT             pin_evt;
888     UINT32          num_val;        /* the numeric value for comparison. If just_works, do not show this number to UI */
889     BOOLEAN         just_works;     /* TRUE, if "Just Works" association model */
890 #if ( BTA_EIR_CANNED_UUID_LIST != TRUE )
891     /* store UUID list for EIR */
892     UINT32                      eir_uuid[BTM_EIR_SERVICE_ARRAY_SIZE];
893 #if (BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
894     tBT_UUID                    custom_uuid[BTA_EIR_SERVER_NUM_CUSTOM_UUID];
895 #endif
896 
897 #endif
898 
899 
900     tBTA_DM_ENCRYPT_CBACK      *p_encrypt_cback;
901     alarm_t                    *switch_delay_timer;
902 
903 } tBTA_DM_CB;
904 
905 /* DM search control block */
906 typedef struct
907 {
908 
909     tBTA_DM_SEARCH_CBACK * p_search_cback;
910     tBTM_INQ_INFO        * p_btm_inq_info;
911     tBTA_SERVICE_MASK      services;
912     tBTA_SERVICE_MASK      services_to_search;
913     tBTA_SERVICE_MASK      services_found;
914     tSDP_DISCOVERY_DB    * p_sdp_db;
915     UINT16                 state;
916     BD_ADDR                peer_bdaddr;
917     BOOLEAN                name_discover_done;
918     BD_NAME                peer_name;
919     alarm_t              * search_timer;
920     UINT8                  service_index;
921     tBTA_DM_MSG          * p_search_queue;   /* search or discover commands during search cancel stored here */
922     BOOLEAN                wait_disc;
923     BOOLEAN                sdp_results;
924     tSDP_UUID              uuid;
925     UINT8                  peer_scn;
926     BOOLEAN                sdp_search;
927     BOOLEAN                cancel_pending; /* inquiry cancel is pending */
928     tBTA_TRANSPORT         transport;
929 #if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
930     tBTA_DM_SEARCH_CBACK * p_scan_cback;
931 #if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
932     tBTA_GATTC_IF          client_if;
933     UINT8                  num_uuid;
934     tBT_UUID               *p_srvc_uuid;
935     UINT8                  uuid_to_search;
936     BOOLEAN                gatt_disc_active;
937     UINT16                 conn_id;
938     UINT8 *                 p_ble_rawdata;
939     UINT32                 ble_raw_size;
940     UINT32                 ble_raw_used;
941     alarm_t              * gatt_close_timer; /* GATT channel close delay timer */
942     BD_ADDR                pending_close_bda; /* pending GATT channel remote device address */
943 #endif
944 #endif
945 
946 
947 } tBTA_DM_SEARCH_CB;
948 
949 /* DI control block */
950 typedef struct
951 {
952     tSDP_DISCOVERY_DB    * p_di_db;     /* pointer to the DI discovery database */
953     UINT8               di_num;         /* total local DI record number */
954     UINT32              di_handle[BTA_DI_NUM_MAX];  /* local DI record handle, the first one is primary record */
955 }tBTA_DM_DI_CB;
956 
957 /* DM search state */
958 enum
959 {
960 
961     BTA_DM_SEARCH_IDLE,
962     BTA_DM_SEARCH_ACTIVE,
963     BTA_DM_SEARCH_CANCELLING,
964     BTA_DM_DISCOVER_ACTIVE
965 
966 };
967 
968 
969 
970 typedef struct
971 {
972     DEV_CLASS      dev_class;          /* local device class */
973     UINT16         policy_settings;    /* link policy setting hold, sniff, park, MS switch */
974     UINT16         page_timeout;       /* timeout for page in slots */
975     UINT16         link_timeout;       /* link supervision timeout in slots */
976     BOOLEAN        avoid_scatter;      /* TRUE to avoid scatternet when av is streaming (be the master) */
977 
978 } tBTA_DM_CFG;
979 
980 extern const UINT32 bta_service_id_to_btm_srv_id_lkup_tbl[];
981 
982 
983 typedef struct
984 {
985     UINT8   id;
986     UINT8   app_id;
987     UINT8   cfg;
988 
989 } tBTA_DM_RM ;
990 
991 extern tBTA_DM_CFG *p_bta_dm_cfg;
992 extern tBTA_DM_RM *p_bta_dm_rm_cfg;
993 
994 typedef struct
995 {
996 
997   UINT8  id;
998   UINT8  app_id;
999   UINT8  spec_idx;  /* index of spec table to use */
1000 
1001 } tBTA_DM_PM_CFG;
1002 
1003 
1004 typedef struct
1005 {
1006 
1007   tBTA_DM_PM_ACTION   power_mode;
1008   UINT16              timeout;
1009 
1010 } tBTA_DM_PM_ACTN;
1011 
1012 typedef struct
1013 {
1014 
1015   UINT8  allow_mask;         /* mask of sniff/hold/park modes to allow */
1016 #if (BTM_SSR_INCLUDED == TRUE)
1017   UINT8  ssr;                /* set SSR on conn open/unpark */
1018 #endif
1019   tBTA_DM_PM_ACTN actn_tbl [BTA_DM_PM_NUM_EVTS][2];
1020 
1021 } tBTA_DM_PM_SPEC;
1022 
1023 typedef struct
1024 {
1025     UINT16      max_lat;
1026     UINT16      min_rmt_to;
1027     UINT16      min_loc_to;
1028 } tBTA_DM_SSR_SPEC;
1029 
1030 typedef struct
1031 {
1032    UINT16 manufacturer;
1033    UINT16 lmp_sub_version;
1034    UINT8 lmp_version;
1035 }tBTA_DM_LMP_VER_INFO;
1036 
1037 extern tBTA_DM_PM_CFG *p_bta_dm_pm_cfg;
1038 extern tBTA_DM_PM_SPEC *p_bta_dm_pm_spec;
1039 extern tBTM_PM_PWR_MD *p_bta_dm_pm_md;
1040 #if (BTM_SSR_INCLUDED == TRUE)
1041 extern tBTA_DM_SSR_SPEC *p_bta_dm_ssr_spec;
1042 #endif
1043 
1044 /* update dynamic BRCM Aware EIR data */
1045 extern const tBTA_DM_EIR_CONF bta_dm_eir_cfg;
1046 extern tBTA_DM_EIR_CONF *p_bta_dm_eir_cfg;
1047 
1048 /* DM control block */
1049 #if BTA_DYNAMIC_MEMORY == FALSE
1050 extern tBTA_DM_CB  bta_dm_cb;
1051 #else
1052 extern tBTA_DM_CB *bta_dm_cb_ptr;
1053 #define bta_dm_cb (*bta_dm_cb_ptr)
1054 #endif
1055 
1056 /* DM search control block */
1057 #if BTA_DYNAMIC_MEMORY == FALSE
1058 extern tBTA_DM_SEARCH_CB  bta_dm_search_cb;
1059 #else
1060 extern tBTA_DM_SEARCH_CB *bta_dm_search_cb_ptr;
1061 #define bta_dm_search_cb (*bta_dm_search_cb_ptr)
1062 #endif
1063 
1064 /* DI control block */
1065 #if BTA_DYNAMIC_MEMORY == FALSE
1066 extern tBTA_DM_DI_CB  bta_dm_di_cb;
1067 #else
1068 extern tBTA_DM_DI_CB *bta_dm_di_cb_ptr;
1069 #define bta_dm_di_cb (*bta_dm_di_cb_ptr)
1070 #endif
1071 
1072 extern BOOLEAN bta_dm_sm_execute(BT_HDR *p_msg);
1073 extern void bta_dm_sm_disable( void );
1074 extern BOOLEAN bta_dm_search_sm_execute(BT_HDR *p_msg);
1075 extern void bta_dm_search_sm_disable( void );
1076 
1077 
1078 extern void bta_dm_enable (tBTA_DM_MSG *p_data);
1079 extern void bta_dm_disable (tBTA_DM_MSG *p_data);
1080 extern void bta_dm_init_cb(void);
1081 extern void bta_dm_set_dev_name (tBTA_DM_MSG *p_data);
1082 extern void bta_dm_set_visibility (tBTA_DM_MSG *p_data);
1083 
1084 extern void bta_dm_set_scan_config(tBTA_DM_MSG *p_data);
1085 extern void bta_dm_vendor_spec_command(tBTA_DM_MSG *p_data);
1086 extern void bta_dm_bond (tBTA_DM_MSG *p_data);
1087 extern void bta_dm_bond_cancel (tBTA_DM_MSG *p_data);
1088 extern void bta_dm_pin_reply (tBTA_DM_MSG *p_data);
1089 extern void bta_dm_acl_change(tBTA_DM_MSG *p_data);
1090 extern void bta_dm_add_device (tBTA_DM_MSG *p_data);
1091 extern void bta_dm_remove_device (tBTA_DM_MSG *p_data);
1092 extern void bta_dm_close_acl(tBTA_DM_MSG *p_data);
1093 
1094 
1095 extern void bta_dm_pm_btm_status(tBTA_DM_MSG *p_data);
1096 extern void bta_dm_pm_timer(tBTA_DM_MSG *p_data);
1097 extern void bta_dm_add_ampkey (tBTA_DM_MSG *p_data);
1098 
1099 #if BLE_INCLUDED == TRUE
1100 extern void bta_dm_add_blekey (tBTA_DM_MSG *p_data);
1101 extern void bta_dm_add_ble_device (tBTA_DM_MSG *p_data);
1102 extern void bta_dm_ble_passkey_reply (tBTA_DM_MSG *p_data);
1103 extern void bta_dm_ble_confirm_reply (tBTA_DM_MSG *p_data);
1104 extern void bta_dm_security_grant (tBTA_DM_MSG *p_data);
1105 extern void bta_dm_ble_set_bg_conn_type (tBTA_DM_MSG *p_data);
1106 extern void bta_dm_ble_set_conn_params (tBTA_DM_MSG *p_data);
1107 extern void bta_dm_ble_set_scan_params(tBTA_DM_MSG *p_data);
1108 extern void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data);
1109 extern void bta_dm_close_gatt_conn(tBTA_DM_MSG *p_data);
1110 extern void bta_dm_ble_observe (tBTA_DM_MSG *p_data);
1111 extern void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data);
1112 extern void bta_dm_ble_config_local_privacy (tBTA_DM_MSG *p_data);
1113 extern void bta_dm_ble_set_adv_params (tBTA_DM_MSG *p_data);
1114 extern void bta_dm_ble_set_adv_config (tBTA_DM_MSG *p_data);
1115 extern void bta_dm_ble_set_scan_rsp (tBTA_DM_MSG *p_data);
1116 extern void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data);
1117 extern void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data);
1118 
1119 #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
1120 extern void bta_dm_cfg_filter_cond (tBTA_DM_MSG *p_data);
1121 extern void bta_dm_scan_filter_param_setup (tBTA_DM_MSG *p_data);
1122 extern void bta_dm_enable_scan_filter(tBTA_DM_MSG *p_data);
1123 #endif
1124 extern void btm_dm_ble_multi_adv_disable(tBTA_DM_MSG *p_data);
1125 extern void bta_dm_ble_multi_adv_data(tBTA_DM_MSG *p_data);
1126 extern void bta_dm_ble_multi_adv_upd_param(tBTA_DM_MSG *p_data);
1127 extern void bta_dm_ble_multi_adv_enb(tBTA_DM_MSG *p_data);
1128 
1129 extern void bta_dm_ble_setup_storage(tBTA_DM_MSG *p_data);
1130 extern void bta_dm_ble_enable_batch_scan(tBTA_DM_MSG * p_data);
1131 extern void bta_dm_ble_disable_batch_scan(tBTA_DM_MSG * p_data);
1132 extern void bta_dm_ble_read_scan_reports(tBTA_DM_MSG * p_data);
1133 extern void bta_dm_ble_track_advertiser(tBTA_DM_MSG * p_data);
1134 extern void bta_dm_ble_get_energy_info(tBTA_DM_MSG *p_data);
1135 
1136 #endif
1137 extern void bta_dm_set_encryption(tBTA_DM_MSG *p_data);
1138 extern void bta_dm_confirm(tBTA_DM_MSG *p_data);
1139 extern void bta_dm_loc_oob(tBTA_DM_MSG *p_data);
1140 extern void bta_dm_ci_io_req_act(tBTA_DM_MSG *p_data);
1141 extern void bta_dm_ci_rmt_oob_act(tBTA_DM_MSG *p_data);
1142 
1143 extern void bta_dm_init_pm(void);
1144 extern void bta_dm_disable_pm(void);
1145 
1146 extern UINT8 bta_dm_get_av_count(void);
1147 extern void bta_dm_search_start (tBTA_DM_MSG *p_data);
1148 extern void bta_dm_search_cancel (tBTA_DM_MSG *p_data);
1149 extern void bta_dm_discover (tBTA_DM_MSG *p_data);
1150 extern void bta_dm_di_disc (tBTA_DM_MSG *p_data);
1151 extern void bta_dm_inq_cmpl (tBTA_DM_MSG *p_data);
1152 extern void bta_dm_rmt_name (tBTA_DM_MSG *p_data);
1153 extern void bta_dm_sdp_result (tBTA_DM_MSG *p_data);
1154 extern void bta_dm_search_cmpl (tBTA_DM_MSG *p_data);
1155 extern void bta_dm_free_sdp_db (tBTA_DM_MSG *p_data);
1156 extern void bta_dm_disc_result (tBTA_DM_MSG *p_data);
1157 extern void bta_dm_search_result (tBTA_DM_MSG *p_data);
1158 extern void bta_dm_discovery_cmpl (tBTA_DM_MSG *p_data);
1159 extern void bta_dm_queue_search (tBTA_DM_MSG *p_data);
1160 extern void bta_dm_queue_disc (tBTA_DM_MSG *p_data);
1161 extern void bta_dm_search_clear_queue (tBTA_DM_MSG *p_data);
1162 extern void bta_dm_search_cancel_cmpl (tBTA_DM_MSG *p_data);
1163 extern void bta_dm_search_cancel_notify (tBTA_DM_MSG *p_data);
1164 extern void bta_dm_search_cancel_transac_cmpl(tBTA_DM_MSG *p_data);
1165 extern void bta_dm_disc_rmt_name (tBTA_DM_MSG *p_data);
1166 extern tBTA_DM_PEER_DEVICE * bta_dm_find_peer_device(BD_ADDR peer_addr);
1167 
1168 extern void bta_dm_pm_active(BD_ADDR peer_addr);
1169 
1170 void bta_dm_eir_update_uuid(UINT16 uuid16, BOOLEAN adding);
1171 
1172 extern void bta_dm_enable_test_mode(tBTA_DM_MSG *p_data);
1173 extern void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data);
1174 extern void bta_dm_execute_callback(tBTA_DM_MSG *p_data);
1175 
1176 
1177 extern void bta_dm_remove_all_acl(tBTA_DM_MSG *p_data);
1178 #endif /* BTA_DM_INT_H */
1179