blob: e2a0115016b7c2b263be475264525a14469c81fd [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
Satya Callojic4e25962014-05-10 23:46:24 -07003 * Copyright (C) 2003-2014 Broadcom Corporation
The Android Open Source Project5738f832012-12-12 16:00:35 -08004 *
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 public interface file for BTA, Broadcom's Bluetooth
22 * application layer for mobile phones.
23 *
24 ******************************************************************************/
25#ifndef BTA_API_H
26#define BTA_API_H
27
The Android Open Source Project5738f832012-12-12 16:00:35 -080028#include "bt_target.h"
29#include "bt_types.h"
30#include "btm_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080031#include "btm_ble_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080032
Bryce Lee3d6accf2016-05-10 17:10:09 -070033#ifdef __cplusplus
34extern "C" {
35#endif
36
The Android Open Source Project5738f832012-12-12 16:00:35 -080037/*****************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -080038 * Constants and data types
39 ****************************************************************************/
The Android Open Source Project5738f832012-12-12 16:00:35 -080040
41/* Status Return Value */
Myles Watsoncd1fd072016-11-09 13:17:43 -080042#define BTA_SUCCESS 0 /* Successful operation. */
43#define BTA_FAILURE 1 /* Generic failure. */
44#define BTA_PENDING 2 /* API cannot be completed right now */
45#define BTA_BUSY 3
46#define BTA_NO_RESOURCES 4
47#define BTA_WRONG_MODE 5
The Android Open Source Project5738f832012-12-12 16:00:35 -080048
Marie Janssene9e58ce2016-06-17 14:12:17 -070049typedef uint8_t tBTA_STATUS;
The Android Open Source Project5738f832012-12-12 16:00:35 -080050
51/*
52 * Service ID
53 *
Myles Watsoncd1fd072016-11-09 13:17:43 -080054 * NOTES: When you add a new Service ID for BTA AND require to change the value
55 * of BTA_MAX_SERVICE_ID,
56 * make sure that the correct security ID of the new service from
57 * Security service definitions (btm_api.h)
58 * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in
59 * bta_dm_act.c.
The Android Open Source Project5738f832012-12-12 16:00:35 -080060 */
61
Myles Watsoncd1fd072016-11-09 13:17:43 -080062#define BTA_RES_SERVICE_ID 0 /* Reserved */
63#define BTA_SPP_SERVICE_ID 1 /* Serial port profile. */
64#define BTA_DUN_SERVICE_ID 2 /* Dial-up networking profile. */
65#define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */
66#define BTA_LAP_SERVICE_ID 4 /* LAN access profile. */
67#define BTA_HSP_SERVICE_ID 5 /* Headset profile. */
68#define BTA_HFP_SERVICE_ID 6 /* Hands-free profile. */
69#define BTA_OPP_SERVICE_ID 7 /* Object push */
70#define BTA_FTP_SERVICE_ID 8 /* File transfer */
71#define BTA_CTP_SERVICE_ID 9 /* Cordless Terminal */
72#define BTA_ICP_SERVICE_ID 10 /* Intercom Terminal */
73#define BTA_SYNC_SERVICE_ID 11 /* Synchronization */
74#define BTA_BPP_SERVICE_ID 12 /* Basic printing profile */
75#define BTA_BIP_SERVICE_ID 13 /* Basic Imaging profile */
76#define BTA_PANU_SERVICE_ID 14 /* PAN User */
77#define BTA_NAP_SERVICE_ID 15 /* PAN Network access point */
78#define BTA_GN_SERVICE_ID 16 /* PAN Group Ad-hoc networks */
79#define BTA_SAP_SERVICE_ID 17 /* SIM Access profile */
80#define BTA_A2DP_SINK_SERVICE_ID 18 /* A2DP Sink */
81#define BTA_AVRCP_SERVICE_ID 19 /* A/V remote control */
82#define BTA_HID_SERVICE_ID 20 /* HID */
83#define BTA_VDP_SERVICE_ID 21 /* Video distribution */
84#define BTA_PBAP_SERVICE_ID 22 /* PhoneBook Access Server*/
85#define BTA_HSP_HS_SERVICE_ID 23 /* HFP HS role */
86#define BTA_HFP_HS_SERVICE_ID 24 /* HSP HS role */
87#define BTA_MAP_SERVICE_ID 25 /* Message Access Profile */
88#define BTA_MN_SERVICE_ID 26 /* Message Notification Service */
89#define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */
90#define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/
91#define BTA_SDP_SERVICE_ID 29 /* SDP Search*/
Myles Watson84baa7f2016-11-14 12:05:37 -080092#if (BTA_GATT_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080093/* BLE profile service ID */
Myles Watsoncd1fd072016-11-09 13:17:43 -080094#define BTA_BLE_SERVICE_ID 30 /* GATT profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -080095
Myles Watsoncd1fd072016-11-09 13:17:43 -080096#define BTA_USER_SERVICE_ID 31 /* User requested UUID */
The Android Open Source Project5738f832012-12-12 16:00:35 -080097
Myles Watsoncd1fd072016-11-09 13:17:43 -080098#define BTA_MAX_SERVICE_ID 32
The Android Open Source Project5738f832012-12-12 16:00:35 -080099#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800100#define BTA_USER_SERVICE_ID 30 /* User requested UUID */
101#define BTA_MAX_SERVICE_ID 31
The Android Open Source Project5738f832012-12-12 16:00:35 -0800102#endif
103/* service IDs (BTM_SEC_SERVICE_FIRST_EMPTY + 1) to (BTM_SEC_MAX_SERVICES - 1)
104 * are used by BTA JV */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800105#define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1)
106#define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800107
Marie Janssene9e58ce2016-06-17 14:12:17 -0700108typedef uint8_t tBTA_SERVICE_ID;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800109
110/* Service ID Mask */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800111#define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */
112#define BTA_SPP_SERVICE_MASK 0x00000002 /* Serial port profile. */
113#define BTA_DUN_SERVICE_MASK 0x00000004 /* Dial-up networking profile. */
114#define BTA_FAX_SERVICE_MASK 0x00000008 /* Fax profile. */
115#define BTA_LAP_SERVICE_MASK 0x00000010 /* LAN access profile. */
116#define BTA_HSP_SERVICE_MASK 0x00000020 /* HSP AG role. */
117#define BTA_HFP_SERVICE_MASK 0x00000040 /* HFP AG role */
118#define BTA_OPP_SERVICE_MASK 0x00000080 /* Object push */
119#define BTA_FTP_SERVICE_MASK 0x00000100 /* File transfer */
120#define BTA_CTP_SERVICE_MASK 0x00000200 /* Cordless Terminal */
121#define BTA_ICP_SERVICE_MASK 0x00000400 /* Intercom Terminal */
122#define BTA_SYNC_SERVICE_MASK 0x00000800 /* Synchronization */
123#define BTA_BPP_SERVICE_MASK 0x00001000 /* Print server */
124#define BTA_BIP_SERVICE_MASK 0x00002000 /* Basic Imaging */
125#define BTA_PANU_SERVICE_MASK 0x00004000 /* PAN User */
126#define BTA_NAP_SERVICE_MASK 0x00008000 /* PAN Network access point */
127#define BTA_GN_SERVICE_MASK 0x00010000 /* PAN Group Ad-hoc networks */
128#define BTA_SAP_SERVICE_MASK 0x00020000 /* PAN Group Ad-hoc networks */
129#define BTA_A2DP_SERVICE_MASK 0x00040000 /* Advanced audio distribution */
130#define BTA_AVRCP_SERVICE_MASK 0x00080000 /* A/V remote control */
131#define BTA_HID_SERVICE_MASK 0x00100000 /* HID */
132#define BTA_VDP_SERVICE_MASK 0x00200000 /* Video distribution */
133#define BTA_PBAP_SERVICE_MASK 0x00400000 /* Phone Book Server */
134#define BTA_HSP_HS_SERVICE_MASK 0x00800000 /* HFP HS role */
135#define BTA_HFP_HS_SERVICE_MASK 0x01000000 /* HSP HS role */
136#define BTA_MAS_SERVICE_MASK 0x02000000 /* Message Access Profile */
137#define BTA_MN_SERVICE_MASK 0x04000000 /* Message Notification Profile */
138#define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */
139#define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800140
Myles Watson84baa7f2016-11-14 12:05:37 -0800141#if (BTA_GATT_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800142#define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */
143#define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800144#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800145#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800146#endif
147
Myles Watson84baa7f2016-11-14 12:05:37 -0800148#if (BTA_GATT_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800149#define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800150#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800151#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800152#endif
153
Marie Janssene9e58ce2016-06-17 14:12:17 -0700154typedef uint32_t tBTA_SERVICE_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800155
156/* extended service mask, including mask with one or more GATT UUID */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800157typedef struct {
158 tBTA_SERVICE_MASK srvc_mask;
159 uint8_t num_uuid;
160 tBT_UUID* p_uuid;
161} tBTA_SERVICE_MASK_EXT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800162
163/* Security Setting Mask */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800164#define BTA_SEC_NONE BTM_SEC_NONE /* No security. */
165#define BTA_SEC_AUTHORIZE \
166 (BTM_SEC_IN_AUTHORIZE) /* Authorization required (only needed for out \
167 going connection )*/
168#define BTA_SEC_AUTHENTICATE \
169 (BTM_SEC_IN_AUTHENTICATE | \
170 BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */
171#define BTA_SEC_ENCRYPT \
172 (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */
173#define BTA_SEC_MODE4_LEVEL4 \
174 (BTM_SEC_MODE4_LEVEL4) /* Mode 4 level 4 service, i.e. incoming/outgoing \
175 MITM and P-256 encryption */
176#define BTA_SEC_MITM \
177 (BTM_SEC_IN_MITM | BTM_SEC_OUT_MITM) /* Man-In-The_Middle protection */
178#define BTA_SEC_IN_16_DIGITS \
179 (BTM_SEC_IN_MIN_16_DIGIT_PIN) /* Min 16 digit for pin code */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800180
Marie Janssene9e58ce2016-06-17 14:12:17 -0700181typedef uint16_t tBTA_SEC;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800182
Myles Watsoncd1fd072016-11-09 13:17:43 -0800183/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only
184 * device modes */
185#define BTA_DM_IGNORE 0x00FF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800186
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -0700187/* Ignore for Discoverable, Connectable only for LE modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800188#define BTA_DM_LE_IGNORE 0xFF00
The Android Open Source Project5738f832012-12-12 16:00:35 -0800189
Myles Watsoncd1fd072016-11-09 13:17:43 -0800190#define BTA_APP_ID_PAN_MULTI 0xFE /* app id for pan multiple connection */
191#define BTA_ALL_APP_ID 0xFF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800192
193/* Discoverable Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800194#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
195#define BTA_DM_GENERAL_DISC \
196 BTM_GENERAL_DISCOVERABLE /* General discoverable. \
197 */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800198#define BTA_DM_BLE_NON_DISCOVERABLE \
199 BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
200#define BTA_DM_BLE_GENERAL_DISCOVERABLE \
201 BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
202#define BTA_DM_BLE_LIMITED_DISCOVERABLE \
203 BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800204typedef uint16_t
205 tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and
206 LE mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800207
208/* Connectable Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800209#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
210#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800211#define BTA_DM_BLE_NON_CONNECTABLE \
212 BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
213#define BTA_DM_BLE_CONNECTABLE \
214 BTM_BLE_CONNECTABLE /* Device is LE connectable. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800215
Marie Janssene9e58ce2016-06-17 14:12:17 -0700216typedef uint16_t tBTA_DM_CONN;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700217
Myles Watsoncd1fd072016-11-09 13:17:43 -0800218#define BTA_TRANSPORT_UNKNOWN 0
219#define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR
220#define BTA_TRANSPORT_LE BT_TRANSPORT_LE
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700221typedef tBT_TRANSPORT tBTA_TRANSPORT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800222
223/* Pairable Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800224#define BTA_DM_PAIRABLE 1
225#define BTA_DM_NON_PAIRABLE 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800226
227/* Connectable Paired Only Mode */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800228#define BTA_DM_CONN_ALL 0
229#define BTA_DM_CONN_PAIRED 1
The Android Open Source Project5738f832012-12-12 16:00:35 -0800230
231/* Inquiry Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800232#define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */
233#define BTA_DM_GENERAL_INQUIRY \
234 BTM_GENERAL_INQUIRY /* Perform general inquiry. */
235#define BTA_DM_LIMITED_INQUIRY \
236 BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800237
Myles Watsoncd1fd072016-11-09 13:17:43 -0800238#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
239#define BTA_BLE_GENERAL_INQUIRY \
240 BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
241#define BTA_BLE_LIMITED_INQUIRY \
242 BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700243typedef uint8_t tBTA_DM_INQ_MODE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800244
245/* Inquiry Filter Type */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800246#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
247#define BTA_DM_INQ_DEV_CLASS \
248 BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
249#define BTA_DM_INQ_BD_ADDR \
250 BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800251
Marie Janssene9e58ce2016-06-17 14:12:17 -0700252typedef uint8_t tBTA_DM_INQ_FILT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800253
254/* Authorize Response */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800255#define BTA_DM_AUTH_PERM \
256 0 /* Authorized for future connections to the service */
257#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
258#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800259
Marie Janssene9e58ce2016-06-17 14:12:17 -0700260typedef uint8_t tBTA_AUTH_RESP;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800261
262/* M/S preferred roles */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800263#define BTA_ANY_ROLE 0x00
264#define BTA_MASTER_ROLE_PREF 0x01
265#define BTA_MASTER_ROLE_ONLY 0x02
266#define BTA_SLAVE_ROLE_ONLY \
267 0x03 /* Used for PANU only, skip role switch to master */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800268
Marie Janssene9e58ce2016-06-17 14:12:17 -0700269typedef uint8_t tBTA_PREF_ROLES;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800270
Myles Watsoncd1fd072016-11-09 13:17:43 -0800271enum {
The Android Open Source Project5738f832012-12-12 16:00:35 -0800272
Myles Watsoncd1fd072016-11-09 13:17:43 -0800273 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
274 support "role switch during connection" for
275 an incoming connection, when it already has
276 another connection in master role */
277 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
278 simulateous connection in Master and Slave roles
279 for short period of time */
280 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
281 and slave roles */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800282
283};
284
The Android Open Source Project5738f832012-12-12 16:00:35 -0800285/* Inquiry filter device class condition */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800286typedef struct {
287 DEV_CLASS dev_class; /* device class of interest */
288 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of
289 interest */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800290} tBTA_DM_COD_COND;
291
The Android Open Source Project5738f832012-12-12 16:00:35 -0800292/* Inquiry Filter Condition */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800293typedef union {
294 BD_ADDR bd_addr; /* BD address of device to filter. */
295 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800296} tBTA_DM_INQ_COND;
297
298/* Inquiry Parameters */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800299typedef struct {
300 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
301 uint8_t duration; /* Inquiry duration in 1.28 sec units. */
302 uint8_t max_resps; /* Maximum inquiry responses. Set to zero for unlimited
303 responses. */
304 bool report_dup; /* report duplicated inquiry response with higher RSSI value
305 */
306 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
307 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700308#if (BTA_HOST_INTERLEAVE_SEARCH == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800309 uint8_t intl_duration
310 [4]; /*duration array storing the interleave scan's time portions*/
Matthew Xie7f3e4292013-09-30 12:44:10 -0700311#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800312} tBTA_DM_INQ;
313
Myles Watsoncd1fd072016-11-09 13:17:43 -0800314typedef struct {
315 uint8_t bta_dm_eir_min_name_len; /* minimum length of local name when it is
316 shortened */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800317#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800318 uint8_t bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
319 uint8_t* bta_dm_eir_uuid16; /* 16-bit UUIDs */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800320#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800321 uint32_t uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800322#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800323 int8_t* bta_dm_eir_inq_tx_power; /* Inquiry TX power */
324 uint8_t bta_dm_eir_flag_len; /* length of flags in bytes */
325 uint8_t* bta_dm_eir_flags; /* flags for EIR */
326 uint8_t bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in
327 bytes */
328 uint8_t* bta_dm_eir_manufac_spec; /* manufacturer specific */
329 uint8_t bta_dm_eir_additional_len; /* length of additional data in bytes */
330 uint8_t* bta_dm_eir_additional; /* additional data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800331} tBTA_DM_EIR_CONF;
332
Wei Wanga6ce7752014-05-20 06:30:32 +0000333/* advertising filter policy */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800334typedef tBTM_BLE_AFP tBTA_BLE_AFP;
Wei Wanga6ce7752014-05-20 06:30:32 +0000335
Myles Watsoncd1fd072016-11-09 13:17:43 -0800336enum {
337 BTA_BLE_BATCH_SCAN_MODE_PASS = 1,
338 BTA_BLE_BATCH_SCAN_MODE_ACTI = 2,
339 BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3
Satya Callojic4e25962014-05-10 23:46:24 -0700340};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700341typedef uint8_t tBTA_BLE_BATCH_SCAN_MODE;
Satya Callojic4e25962014-05-10 23:46:24 -0700342
Myles Watsoncd1fd072016-11-09 13:17:43 -0800343enum { BTA_BLE_DISCARD_OLD_ITEMS = 0, BTA_BLE_DISCARD_LOWER_RSSI_ITEMS = 1 };
Marie Janssene9e58ce2016-06-17 14:12:17 -0700344typedef uint8_t tBTA_BLE_DISCARD_RULE;
Satya Callojic4e25962014-05-10 23:46:24 -0700345
Myles Watsoncd1fd072016-11-09 13:17:43 -0800346enum { BTA_BLE_ADV_SEEN_FIRST_TIME = 0, BTA_BLE_ADV_TRACKING_TIMEOUT = 1 };
Marie Janssene9e58ce2016-06-17 14:12:17 -0700347typedef uint8_t tBTA_BLE_ADV_CHANGE_REASON;
Satya Callojic4e25962014-05-10 23:46:24 -0700348
Myles Watsoncd1fd072016-11-09 13:17:43 -0800349enum {
350 BTA_BLE_BATCH_SCAN_ENB_EVT = 1,
351 BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2,
352 BTA_BLE_BATCH_SCAN_DATA_EVT = 3,
353 BTA_BLE_BATCH_SCAN_THRES_EVT = 4,
354 BTA_BLE_BATCH_SCAN_PARAM_EVT = 5,
355 BTA_BLE_BATCH_SCAN_DIS_EVT = 6
Satya Callojic4e25962014-05-10 23:46:24 -0700356};
357typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
358
359typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800360
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800361/* BLE customer specific feature function type definitions */
362/* data type used on customer specific feature for RSSI monitoring */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800363#define BTA_BLE_RSSI_ALERT_HI 0
364#define BTA_BLE_RSSI_ALERT_RANGE 1
365#define BTA_BLE_RSSI_ALERT_LO 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700366typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800367
Myles Watsoncd1fd072016-11-09 13:17:43 -0800368#define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */
369#define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */
370#define BTA_BLE_RSSI_ALERT_RANGE_BIT \
371 BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */
372#define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */
373typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_MASK;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800374
Myles Watsoncd1fd072016-11-09 13:17:43 -0800375typedef void(tBTA_DM_BLE_RSSI_CBACK)(BD_ADDR bd_addr,
376 tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type,
377 int8_t rssi);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800378
379/* max number of filter spot for different filter type */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800380#define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */
381#define BTA_DM_BLE_MAX_ADDR_FILTER BTM_BLE_MAX_ADDR_FILTER /* 8 */
382#define BTA_DM_BLE_PF_STR_COND_MAX \
383 BTM_BLE_PF_STR_COND_MAX /* 4 apply to manu data , or local name */
384#define BTA_DM_BLE_PF_STR_LEN_MAX \
385 BTM_BLE_PF_STR_LEN_MAX /* match for first 20 bytes */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800386
Myles Watsoncd1fd072016-11-09 13:17:43 -0800387#define BTA_DM_BLE_PF_LOGIC_OR 0
388#define BTA_DM_BLE_PF_LOGIC_AND 1
Marie Janssene9e58ce2016-06-17 14:12:17 -0700389typedef uint8_t tBTA_DM_BLE_PF_LOGIC_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800390
Myles Watsoncd1fd072016-11-09 13:17:43 -0800391enum {
392 BTA_DM_BLE_SCAN_COND_ADD,
393 BTA_DM_BLE_SCAN_COND_DELETE,
394 BTA_DM_BLE_SCAN_COND_CLEAR = 2
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800395};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700396typedef uint8_t tBTA_DM_BLE_SCAN_COND_OP;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800397
Satya Calloji1a9247a2014-06-05 13:15:15 -0700398/* ADV payload filtering vendor specific call event */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800399enum { BTA_BLE_SCAN_PF_ENABLE_EVT = 7, BTA_BLE_SCAN_PF_COND_EVT };
Satya Calloji1a9247a2014-06-05 13:15:15 -0700400
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800401/* filter selection bit index */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800402#define BTA_DM_BLE_PF_ADDR_FILTER BTM_BLE_PF_ADDR_FILTER
403#define BTA_DM_BLE_PF_SRVC_DATA BTM_BLE_PF_SRVC_DATA
404#define BTA_DM_BLE_PF_SRVC_UUID BTM_BLE_PF_SRVC_UUID
405#define BTA_DM_BLE_PF_SRVC_SOL_UUID BTM_BLE_PF_SRVC_SOL_UUID
406#define BTA_DM_BLE_PF_LOCAL_NAME BTM_BLE_PF_LOCAL_NAME
407#define BTA_DM_BLE_PF_MANU_DATA BTM_BLE_PF_MANU_DATA
408#define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN
409#define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL
410#define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX
411typedef uint8_t tBTA_DM_BLE_PF_COND_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800412
Myles Watsoncd1fd072016-11-09 13:17:43 -0800413typedef union {
414 uint16_t uuid16_mask;
415 uint32_t uuid32_mask;
416 uint8_t uuid128_mask[LEN_UUID_128];
417} tBTA_DM_BLE_PF_COND_MASK;
Andre Eisenbachb203d472013-11-20 17:23:06 -0800418
Myles Watsoncd1fd072016-11-09 13:17:43 -0800419typedef struct {
420 tBLE_BD_ADDR*
421 p_target_addr; /* target address, if NULL, generic UUID filter */
422 tBT_UUID uuid; /* UUID condition */
423 tBTA_DM_BLE_PF_LOGIC_TYPE cond_logic; /* AND/OR */
424 tBTA_DM_BLE_PF_COND_MASK*
425 p_uuid_mask; /* UUID condition mask, if NULL, match exact as UUID
426 condition */
427} tBTA_DM_BLE_PF_UUID_COND;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800428
Myles Watsoncd1fd072016-11-09 13:17:43 -0800429typedef struct {
430 uint8_t data_len; /* <= 20 bytes */
431 uint8_t* p_data;
432} tBTA_DM_BLE_PF_LOCAL_NAME_COND;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800433
Myles Watsoncd1fd072016-11-09 13:17:43 -0800434typedef struct {
435 uint16_t company_id; /* company ID */
436 uint8_t data_len; /* <= 20 bytes */
437 uint8_t* p_pattern;
438 uint16_t company_id_mask; /* UUID value mask */
439 uint8_t*
440 p_pattern_mask; /* Manufacturer data matching mask, same length
441 as data pattern, set to all 0xff, match exact data */
442} tBTA_DM_BLE_PF_MANU_COND;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800443
Myles Watsoncd1fd072016-11-09 13:17:43 -0800444typedef struct {
445 uint16_t uuid; /* service ID */
446 uint8_t data_len; /* <= 20 bytes */
447 uint8_t* p_pattern;
448 uint8_t*
449 p_pattern_mask; /* Service data matching mask, same length
450 as data pattern, set to all 0xff, match exact data */
451} tBTA_DM_BLE_PF_SRVC_PATTERN_COND;
Andre Eisenbachb203d472013-11-20 17:23:06 -0800452
Myles Watsoncd1fd072016-11-09 13:17:43 -0800453typedef union {
454 tBLE_BD_ADDR target_addr;
455 tBTA_DM_BLE_PF_LOCAL_NAME_COND local_name; /* lcoal name filtering */
456 tBTA_DM_BLE_PF_MANU_COND manu_data; /* manufactuer data filtering */
457 tBTA_DM_BLE_PF_UUID_COND srvc_uuid; /* service UUID filtering */
458 tBTA_DM_BLE_PF_UUID_COND
459 solicitate_uuid; /* solicitated service UUID filtering */
460 tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */
461} tBTA_DM_BLE_PF_COND_PARAM;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800462
Marie Janssene9e58ce2016-06-17 14:12:17 -0700463typedef uint8_t tBTA_DM_BLE_PF_FILT_INDEX;
464typedef uint8_t tBTA_DM_BLE_PF_AVBL_SPACE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700465
Marie Janssene9e58ce2016-06-17 14:12:17 -0700466typedef int8_t tBTA_DM_RSSI_VALUE;
467typedef uint8_t tBTA_DM_LINK_QUALITY_VALUE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800468
Marie Janssene9e58ce2016-06-17 14:12:17 -0700469typedef uint8_t tBTA_SIG_STRENGTH_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800470
The Android Open Source Project5738f832012-12-12 16:00:35 -0800471/* Security Callback Events */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800472#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
473#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
474#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
475#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
476#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
477#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
478#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
479#define BTA_DM_SIG_STRENGTH_EVT \
480 7 /* Signal strength for bluetooth connection \
481 */
482#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
483#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
484#define BTA_DM_SP_CFM_REQ_EVT \
485 10 /* Simple Pairing User Confirmation request. \
486 */
487#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
488#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
489#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
490#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
491#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
492#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
493#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
494#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
495#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
496#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
497#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
498#define BTA_DM_BLE_NC_REQ_EVT 22 /* SMP Numeric Comparison request event */
499#define BTA_DM_SP_RMT_OOB_EXT_EVT \
500 23 /* Simple Pairing Remote OOB Extended Data request. */
501#define BTA_DM_BLE_AUTH_CMPL_EVT 24 /* BLE Auth complete */
502#define BTA_DM_DEV_UNPAIRED_EVT 25
503#define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */
504#define BTA_DM_LE_FEATURES_READ \
505 27 /* Cotroller specific LE features are read \
506 */
507#define BTA_DM_ENER_INFO_READ 28 /* Energy info read */
508#define BTA_DM_BLE_SC_OOB_REQ_EVT 29 /* SMP SC OOB request event */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700509typedef uint8_t tBTA_DM_SEC_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800510
511/* Structure associated with BTA_DM_ENABLE_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800512typedef struct { tBTA_STATUS status; } tBTA_DM_ENABLE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800513
514/* Structure associated with BTA_DM_PIN_REQ_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800515typedef struct {
516 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
517 * order */
518 BD_ADDR bd_addr; /* BD address peer device. */
519 DEV_CLASS dev_class; /* Class of Device */
520 BD_NAME bd_name; /* Name of peer device. */
521 bool min_16_digit; /* true if the pin returned must be at least 16 digits */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800522} tBTA_DM_PIN_REQ;
523
524/* BLE related definition */
525
Myles Watsoncd1fd072016-11-09 13:17:43 -0800526#define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10)
Jacky Cheung07c78922016-07-06 15:11:30 -0700527
Myles Watsoncd1fd072016-11-09 13:17:43 -0800528/* Converts SMP error codes defined in smp_api.h to SMP auth fail reasons below.
529 */
530#define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x))
Jacky Cheung07c78922016-07-06 15:11:30 -0700531
Myles Watsoncd1fd072016-11-09 13:17:43 -0800532#define BTA_DM_AUTH_SMP_PASSKEY_FAIL \
533 (BTA_DM_AUTH_FAIL_BASE + SMP_PASSKEY_ENTRY_FAIL)
534#define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL)
535#define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL \
536 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL)
537#define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL \
538 (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR)
539#define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT \
540 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT)
541#define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE)
542#define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD)
543#define BTA_DM_AUTH_SMP_UNKNOWN_ERR \
544 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN)
545#define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT \
546 (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS)
547#define BTA_DM_AUTH_SMP_INVALID_PARAMETERS \
548 (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_PARAMETERS)
549#define BTA_DM_AUTH_SMP_INTERNAL_ERR \
550 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR)
551#define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP)
552#define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL)
553#define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL)
554#define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY)
555#define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL)
556#define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT)
557#define BTA_DM_AUTH_SMP_CONN_TOUT (BTA_DM_AUTH_FAIL_BASE + SMP_CONN_TOUT)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800558
559/* connection parameter boundary value and dummy value */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800560#define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN
561#define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX
562#define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN
563#define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX
564#define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN
565#define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX
566#define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX
567#define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN
568#define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX
569#define BTA_DM_BLE_CONN_PARAM_UNDEF \
570 BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be \
571 overwritten */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800572
Myles Watsoncd1fd072016-11-09 13:17:43 -0800573#define BTA_LE_KEY_PENC \
574 BTM_LE_KEY_PENC /* encryption information of peer device */
575#define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */
576#define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */
577#define BTA_LE_KEY_LENC \
578 BTM_LE_KEY_LENC /* master role security information:div */
579#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
580#define BTA_LE_KEY_LCSRK \
581 BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700582typedef uint8_t tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800583
Myles Watsoncd1fd072016-11-09 13:17:43 -0800584typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800585typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS;
Myles Watsoncd1fd072016-11-09 13:17:43 -0800586typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS;
587typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS;
588typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800589
Myles Watsoncd1fd072016-11-09 13:17:43 -0800590typedef union {
591 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */
592 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */
593 tBTA_LE_PID_KEYS pid_key; /* peer device ID key */
594 tBTA_LE_LENC_KEYS
595 lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/
596 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/
597 tBTA_LE_PID_KEYS lid_key; /* local device ID key for the particular remote */
598} tBTA_LE_KEY_VALUE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800599
Myles Watsoncd1fd072016-11-09 13:17:43 -0800600#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
601#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700602typedef uint8_t tBTA_DM_BLE_LOCAL_KEY_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800603
Myles Watsoncd1fd072016-11-09 13:17:43 -0800604typedef struct {
605 BT_OCTET16 ir;
606 BT_OCTET16 irk;
607 BT_OCTET16 dhk;
608} tBTA_BLE_LOCAL_ID_KEYS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800609
Myles Watsoncd1fd072016-11-09 13:17:43 -0800610#define BTA_DM_SEC_GRANTED BTA_SUCCESS
611#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
612#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
Marie Janssene9e58ce2016-06-17 14:12:17 -0700613typedef uint8_t tBTA_DM_BLE_SEC_GRANT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800614
Myles Watsoncd1fd072016-11-09 13:17:43 -0800615#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
616#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
617#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
Marie Janssene9e58ce2016-06-17 14:12:17 -0700618typedef uint8_t tBTA_DM_BLE_CONN_TYPE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800619
Myles Watsoncd1fd072016-11-09 13:17:43 -0800620typedef bool(tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, uint8_t* p_remote_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800621
622/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800623typedef struct {
624 BD_ADDR bd_addr; /* peer address */
625 BD_NAME bd_name; /* peer device name */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800626} tBTA_DM_BLE_SEC_REQ;
627
Myles Watsoncd1fd072016-11-09 13:17:43 -0800628typedef struct {
629 BD_ADDR bd_addr; /* peer address */
630 tBTM_LE_KEY_TYPE key_type;
631 tBTM_LE_KEY_VALUE* p_key_value;
632} tBTA_DM_BLE_KEY;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800633
634/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800635typedef struct {
636 BD_ADDR bd_addr; /* BD address peer device. */
637 BD_NAME bd_name; /* Name of peer device. */
638 bool key_present; /* Valid link key value in key element */
639 LINK_KEY key; /* Link key associated with peer device. */
640 uint8_t key_type; /* The type of Link Key */
641 bool success; /* true of authentication succeeded, false if failed. */
642 uint8_t fail_reason; /* The HCI reason/error code for when success=false */
643 tBLE_ADDR_TYPE addr_type; /* Peer device address type */
644 tBT_DEVICE_TYPE dev_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800645} tBTA_DM_AUTH_CMPL;
646
The Android Open Source Project5738f832012-12-12 16:00:35 -0800647/* Structure associated with BTA_DM_AUTHORIZE_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800648typedef struct {
649 BD_ADDR bd_addr; /* BD address peer device. */
650 BD_NAME bd_name; /* Name of peer device. */
651 tBTA_SERVICE_ID service; /* Service ID to authorize. */
652 DEV_CLASS dev_class;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800653} tBTA_DM_AUTHORIZE;
654
655/* Structure associated with BTA_DM_LINK_UP_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800656typedef struct {
657 BD_ADDR bd_addr; /* BD address peer device. */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800658 tBTA_TRANSPORT link_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800659} tBTA_DM_LINK_UP;
660
661/* Structure associated with BTA_DM_LINK_DOWN_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800662typedef struct {
663 BD_ADDR bd_addr; /* BD address peer device. */
664 uint8_t status; /* connection open/closed */
665 bool is_removed; /* true if device is removed when link is down */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800666 tBTA_TRANSPORT link_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800667} tBTA_DM_LINK_DOWN;
668
669/* Structure associated with BTA_DM_ROLE_CHG_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800670typedef struct {
671 BD_ADDR bd_addr; /* BD address peer device. */
672 uint8_t new_role; /* the new connection role */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800673} tBTA_DM_ROLE_CHG;
674
The Android Open Source Project5738f832012-12-12 16:00:35 -0800675/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800676typedef struct {
677 uint8_t level; /* when paging or inquiring, level is 10.
678 Otherwise, the number of ACL links */
679 uint8_t level_flags; /* indicates individual flags */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800680} tBTA_DM_BUSY_LEVEL;
681
Myles Watson2e8e9f42016-11-14 16:45:15 -0800682#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
683#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
684#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
685#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800686#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800687typedef tBTM_IO_CAP tBTA_IO_CAP;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800688
Myles Watsoncd1fd072016-11-09 13:17:43 -0800689#define BTA_AUTH_SP_NO \
690 BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single \
691 Profile/non-bonding \
692 Numeric comparison with automatic accept allowed */
693#define BTA_AUTH_SP_YES \
694 BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding \
695 Use IO Capabilities to determine authentication procedure \
696 */
697#define BTA_AUTH_AP_NO \
698 BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated \
699 bonding \
700 Numeric comparison with automatic accept allowed */
701#define BTA_AUTH_AP_YES \
702 BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated \
703 bonding \
704 Use IO Capabilities to determine authentication procedure \
705 */
706#define BTA_AUTH_SPGB_NO \
707 BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general \
708 bonding \
709 Numeric comparison with automatic accept allowed */
710#define BTA_AUTH_SPGB_YES \
711 BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general \
712 bonding \
713 Use IO Capabilities to determine authentication \
714 procedure */
715typedef tBTM_AUTH_REQ tBTA_AUTH_REQ;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800716
Myles Watsoncd1fd072016-11-09 13:17:43 -0800717#define BTA_AUTH_DD_BOND \
718 BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */
719#define BTA_AUTH_GEN_BOND \
720 BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */
721#define BTA_AUTH_BONDS \
722 BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800723
Myles Watsoncd1fd072016-11-09 13:17:43 -0800724#define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/
725#define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */
726#define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */
Satya Calloji444a8da2015-03-06 10:38:22 -0800727
Myles Watsoncd1fd072016-11-09 13:17:43 -0800728#define BTA_LE_AUTH_REQ_SC_ONLY BTM_LE_AUTH_REQ_SC_ONLY /* 1 << 3 */
729#define BTA_LE_AUTH_REQ_SC_BOND BTM_LE_AUTH_REQ_SC_BOND /* 1001 */
730#define BTA_LE_AUTH_REQ_SC_MITM BTM_LE_AUTH_REQ_SC_MITM /* 1100 */
731#define BTA_LE_AUTH_REQ_SC_MITM_BOND BTM_LE_AUTH_REQ_SC_MITM_BOND /* 1101 */
732typedef tBTM_LE_AUTH_REQ
733 tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800734
Myles Watsoncd1fd072016-11-09 13:17:43 -0800735#define BTA_OOB_NONE BTM_OOB_NONE
736#define BTA_OOB_PRESENT BTM_OOB_PRESENT
737#define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN
Jakub Pawlowski175da702015-11-12 15:00:58 -0800738
Myles Watsoncd1fd072016-11-09 13:17:43 -0800739typedef tBTM_OOB_DATA tBTA_OOB_DATA;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800740
741/* Structure associated with BTA_DM_SP_CFM_REQ_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800742typedef struct {
743 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
744 * order */
745 BD_ADDR bd_addr; /* peer address */
746 DEV_CLASS dev_class; /* peer CoD */
747 BD_NAME bd_name; /* peer device name */
748 uint32_t num_val; /* the numeric value for comparison. If just_works, do not
749 show this number to UI */
750 bool just_works; /* true, if "Just Works" association model */
751 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
752 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
753 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
754 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800755} tBTA_DM_SP_CFM_REQ;
756
Myles Watsoncd1fd072016-11-09 13:17:43 -0800757enum {
758 BTA_SP_KEY_STARTED, /* passkey entry started */
759 BTA_SP_KEY_ENTERED, /* passkey digit entered */
760 BTA_SP_KEY_ERASED, /* passkey digit erased */
761 BTA_SP_KEY_CLEARED, /* passkey cleared */
762 BTA_SP_KEY_COMPLT /* passkey entry completed */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800763};
Myles Watsoncd1fd072016-11-09 13:17:43 -0800764typedef uint8_t tBTA_SP_KEY_TYPE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800765
766/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800767typedef struct {
768 BD_ADDR bd_addr; /* peer address */
769 tBTA_SP_KEY_TYPE notif_type;
770} tBTA_DM_SP_KEY_PRESS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800771
772/* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800773typedef struct {
774 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
775 * order */
776 BD_ADDR bd_addr; /* peer address */
777 DEV_CLASS dev_class; /* peer CoD */
778 BD_NAME bd_name; /* peer device name */
779 uint32_t passkey; /* the numeric value for comparison. If just_works, do not
780 show this number to UI */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800781} tBTA_DM_SP_KEY_NOTIF;
782
783/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800784typedef struct {
785 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
786 * order */
787 BD_ADDR bd_addr; /* peer address */
788 DEV_CLASS dev_class; /* peer CoD */
789 BD_NAME bd_name; /* peer device name */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800790} tBTA_DM_SP_RMT_OOB;
791
792/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800793typedef struct {
794 tBTA_STATUS result; /* true of bond cancel succeeded, false if failed. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800795} tBTA_DM_BOND_CANCEL_CMPL;
796
797/* Union of all security callback structures */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800798typedef union {
799 tBTA_DM_ENABLE enable; /* BTA enabled */
800 tBTA_DM_PIN_REQ pin_req; /* PIN request. */
801 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */
802 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */
803 tBTA_DM_LINK_UP link_up; /* ACL connection down event */
804 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
805 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
806 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */
807 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */
808 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */
809 tBTA_DM_BOND_CANCEL_CMPL
810 bond_cancel_cmpl; /* Bond Cancel Complete indication */
811 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */
812 tBTA_DM_ROLE_CHG role_chg; /* role change event */
813 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */
814 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */
815 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */
816 BT_OCTET16 ble_er; /* ER event data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800817} tBTA_DM_SEC;
818
819/* Security callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800820typedef void(tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800821
Marie Janssene9e58ce2016-06-17 14:12:17 -0700822typedef uint32_t tBTA_DM_BLE_REF_VALUE;
Wei Wanga6ce7752014-05-20 06:30:32 +0000823
Myles Watsoncd1fd072016-11-09 13:17:43 -0800824#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
825#define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG
Marie Janssene9e58ce2016-06-17 14:12:17 -0700826typedef uint8_t tBTA_DM_BLE_PF_EVT;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700827
Myles Watsoncd1fd072016-11-09 13:17:43 -0800828#define BTA_DM_BLE_PF_ENABLE 1
829#define BTA_DM_BLE_PF_CONFIG 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700830typedef uint8_t tBTA_DM_BLE_PF_ACTION;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700831
Satya Calloji1a9247a2014-06-05 13:15:15 -0700832/* Config callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800833typedef void(tBTA_DM_BLE_PF_CFG_CBACK)(tBTA_DM_BLE_PF_ACTION action,
834 tBTA_DM_BLE_PF_COND_TYPE cfg_cond,
835 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
836 tBTA_STATUS status,
837 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700838/* Param callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800839typedef void(tBTA_DM_BLE_PF_PARAM_CBACK)(uint8_t action_type,
840 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
841 tBTA_DM_BLE_REF_VALUE ref_value,
842 tBTA_STATUS status);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700843
844/* Status callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800845typedef void(tBTA_DM_BLE_PF_STATUS_CBACK)(uint8_t action, tBTA_STATUS status,
846 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700847
Myles Watsoncd1fd072016-11-09 13:17:43 -0800848#define BTA_DM_BLE_PF_BRDCAST_ADDR_FILT 1
Satya Calloji1a9247a2014-06-05 13:15:15 -0700849#define BTA_DM_BLE_PF_SERV_DATA_CHG_FILT 2
Myles Watsoncd1fd072016-11-09 13:17:43 -0800850#define BTA_DM_BLE_PF_SERV_UUID 4
851#define BTA_DM_BLE_PF_SERV_SOLC_UUID 8
852#define BTA_DM_BLE_PF_LOC_NAME_CHECK 16
853#define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32
854#define BTA_DM_BLE_PF_SERV_DATA_CHECK 64
Marie Janssene9e58ce2016-06-17 14:12:17 -0700855typedef uint16_t tBTA_DM_BLE_PF_FEAT_SEL;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700856
Myles Watsoncd1fd072016-11-09 13:17:43 -0800857#define BTA_DM_BLE_PF_LIST_LOGIC_OR 1
858#define BTA_DM_BLE_PF_LIST_LOGIC_AND 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700859typedef uint16_t tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700860
Myles Watsoncd1fd072016-11-09 13:17:43 -0800861#define BTA_DM_BLE_PF_FILT_LOGIC_OR 0
862#define BTA_DM_BLE_PF_FILT_LOGIC_AND 1
Marie Janssene9e58ce2016-06-17 14:12:17 -0700863typedef uint16_t tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700864
Myles Watsoncd1fd072016-11-09 13:17:43 -0800865typedef uint8_t tBTA_DM_BLE_PF_RSSI_THRESHOLD;
866typedef uint8_t tBTA_DM_BLE_PF_DELIVERY_MODE;
Marie Janssene9e58ce2016-06-17 14:12:17 -0700867typedef uint16_t tBTA_DM_BLE_PF_TIMEOUT;
Myles Watsoncd1fd072016-11-09 13:17:43 -0800868typedef uint8_t tBTA_DM_BLE_PF_TIMEOUT_CNT;
Marie Janssene9e58ce2016-06-17 14:12:17 -0700869typedef uint16_t tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700870
Myles Watsoncd1fd072016-11-09 13:17:43 -0800871typedef struct {
872 tBTA_DM_BLE_PF_FEAT_SEL feat_seln;
873 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE list_logic_type;
874 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE filt_logic_type;
875 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_high_thres;
876 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_low_thres;
877 tBTA_DM_BLE_PF_DELIVERY_MODE dely_mode;
878 tBTA_DM_BLE_PF_TIMEOUT found_timeout;
879 tBTA_DM_BLE_PF_TIMEOUT lost_timeout;
880 tBTA_DM_BLE_PF_TIMEOUT_CNT found_timeout_cnt;
881 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES num_of_tracking_entries;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700882} tBTA_DM_BLE_PF_FILT_PARAMS;
883
The Android Open Source Project5738f832012-12-12 16:00:35 -0800884/* Search callback events */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800885#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
886#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
887#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
888#define BTA_DM_DISC_BLE_RES_EVT \
889 3 /* Discovery result for BLE GATT based servoce on a peer device. */
890#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
891#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
892#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800893
Marie Janssene9e58ce2016-06-17 14:12:17 -0700894typedef uint8_t tBTA_DM_SEARCH_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800895
Myles Watsoncd1fd072016-11-09 13:17:43 -0800896#define BTA_DM_INQ_RES_IGNORE_RSSI \
897 BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800898
899/* Structure associated with BTA_DM_INQ_RES_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800900typedef struct {
901 BD_ADDR bd_addr; /* BD address peer device. */
902 DEV_CLASS dev_class; /* Device class of peer device. */
903 bool remt_name_not_required; /* Application sets this flag if it already knows
904 the name of the device */
905 /* If the device name is known to application BTA skips the remote name
906 * request */
907 bool is_limited; /* true, if the limited inquiry bit is set in the CoD */
908 int8_t rssi; /* The rssi value */
909 uint8_t* p_eir; /* received EIR */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800910 uint8_t inq_result_type;
911 uint8_t ble_addr_type;
912 tBTM_BLE_EVT_TYPE ble_evt_type;
913 tBT_DEVICE_TYPE device_type;
914 uint8_t flag;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800915} tBTA_DM_INQ_RES;
916
917/* Structure associated with BTA_DM_INQ_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800918typedef struct {
919 uint8_t num_resps; /* Number of inquiry responses. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800920} tBTA_DM_INQ_CMPL;
921
922/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800923typedef struct {
924 BD_ADDR bd_addr; /* BD address peer device. */
925 uint8_t num_record; /* Number of DI record */
926 tBTA_STATUS result;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800927} tBTA_DM_DI_DISC_CMPL;
928
929/* Structure associated with BTA_DM_DISC_RES_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800930typedef struct {
931 BD_ADDR bd_addr; /* BD address peer device. */
932 BD_NAME bd_name; /* Name of peer device. */
933 tBTA_SERVICE_MASK services; /* Services found on peer device. */
934 uint8_t* p_raw_data; /* Raw data for discovery DB */
935 uint32_t raw_data_size; /* size of raw data */
936 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
937 uint32_t num_uuids;
938 uint8_t* p_uuid_list;
939 tBTA_STATUS result;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800940} tBTA_DM_DISC_RES;
941
942/* Structure associated with tBTA_DM_DISC_BLE_RES */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800943typedef struct {
944 BD_ADDR bd_addr; /* BD address peer device. */
945 BD_NAME bd_name; /* Name of peer device. */
946 tBT_UUID service; /* GATT based Services UUID found on peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800947} tBTA_DM_DISC_BLE_RES;
948
The Android Open Source Project5738f832012-12-12 16:00:35 -0800949/* Union of all search callback structures */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800950typedef union {
951 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
952 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
953 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
954 tBTA_DM_DISC_BLE_RES
955 disc_ble_res; /* discovery result for GATT based service */
956 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800957
958} tBTA_DM_SEARCH;
959
960/* Search callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800961typedef void(tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event,
962 tBTA_DM_SEARCH* p_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800963
964/* Execute call back */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800965typedef void(tBTA_DM_EXEC_CBACK)(void* p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800966
967/* Encryption callback*/
Myles Watsoncd1fd072016-11-09 13:17:43 -0800968typedef void(tBTA_DM_ENCRYPT_CBACK)(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
969 tBTA_STATUS result);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800970
Myles Watsoncd1fd072016-11-09 13:17:43 -0800971#define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE
972#define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT
973#define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM
974#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
975typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
Satya Callojic4e25962014-05-10 23:46:24 -0700976
Myles Watsoncd1fd072016-11-09 13:17:43 -0800977typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
978typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
979typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
980typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED;
Satya Callojie5ba8842014-07-03 17:18:02 -0700981
Myles Watsoncd1fd072016-11-09 13:17:43 -0800982#define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */
983#define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */
984#define BTA_DM_CONTRL_SCAN \
985 2 /* Scan state - paging/inquiry/trying to \
986 connect*/
987#define BTA_DM_CONTRL_IDLE \
988 3 /* Idle state - page scan, LE advt, inquiry scan \
989 */
Satya Callojie5ba8842014-07-03 17:18:02 -0700990
Marie Janssene9e58ce2016-06-17 14:12:17 -0700991typedef uint8_t tBTA_DM_CONTRL_STATE;
Satya Callojie5ba8842014-07-03 17:18:02 -0700992
Marie Janssene9e58ce2016-06-17 14:12:17 -0700993typedef uint8_t tBTA_DM_BLE_ADV_STATE;
994typedef uint8_t tBTA_DM_BLE_ADV_INFO_PRESENT;
995typedef uint8_t tBTA_DM_BLE_RSSI_VALUE;
996typedef uint16_t tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
Satya Callojif5387072015-02-09 17:40:52 -0800997
998typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA;
Satya Callojie5ba8842014-07-03 17:18:02 -0700999
Myles Watsoncd1fd072016-11-09 13:17:43 -08001000typedef void(tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojie5ba8842014-07-03 17:18:02 -07001001
Myles Watsoncd1fd072016-11-09 13:17:43 -08001002typedef void(tBTA_BLE_SCAN_REP_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value,
1003 uint8_t report_format,
1004 uint8_t num_records, uint16_t data_len,
1005 uint8_t* p_rep_data, tBTA_STATUS status);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001006
Myles Watsoncd1fd072016-11-09 13:17:43 -08001007typedef void(tBTA_BLE_SCAN_SETUP_CBACK)(tBTA_BLE_BATCH_SCAN_EVT evt,
1008 tBTA_DM_BLE_REF_VALUE ref_value,
1009 tBTA_STATUS status);
Satya Callojic4e25962014-05-10 23:46:24 -07001010
Myles Watsoncd1fd072016-11-09 13:17:43 -08001011typedef void(tBTA_BLE_TRACK_ADV_CMPL_CBACK)(
1012 int action, tBTA_STATUS status, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
1013 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001014
Myles Watsoncd1fd072016-11-09 13:17:43 -08001015typedef void(tBTA_BLE_TRACK_ADV_CBACK)(tBTA_DM_BLE_TRACK_ADV_DATA* p_adv_data);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001016
Myles Watsoncd1fd072016-11-09 13:17:43 -08001017typedef void(tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
1018 tBTA_DM_BLE_RX_TIME_MS rx_time,
1019 tBTA_DM_BLE_IDLE_TIME_MS idle_time,
1020 tBTA_DM_BLE_ENERGY_USED energy_used,
1021 tBTA_DM_CONTRL_STATE ctrl_state,
1022 tBTA_STATUS status);
Satya Callojie5ba8842014-07-03 17:18:02 -07001023
The Android Open Source Project5738f832012-12-12 16:00:35 -08001024/* Maximum service name length */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001025#define BTA_SERVICE_NAME_LEN 35
1026#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
1027#define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN
The Android Open Source Project5738f832012-12-12 16:00:35 -08001028
1029/* link policy masks */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001030#define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH
1031#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
1032#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
1033#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
Marie Janssene9e58ce2016-06-17 14:12:17 -07001034typedef uint16_t tBTA_DM_LP_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001035
1036/* power mode actions */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001037#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
1038#define BTA_DM_PM_PARK 0x10 /* prefers park mode */
1039#define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */
1040#define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */
1041#define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */
1042#define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */
1043#define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */
1044#define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */
1045#define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */
1046#define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */
1047#define BTA_DM_PM_SNIFF_USER0 \
1048 0x28 /* prefers user-defined sniff0 mode (testtool only) */
1049#define BTA_DM_PM_SNIFF_USER1 \
1050 0x29 /* prefers user-defined sniff1 mode (testtool only) */
1051#define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */
1052#define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */
1053#define BTA_DM_PM_SUSPEND 0x04 /* prefers suspend mode */
1054#define BTA_DM_PM_NO_PREF \
1055 0x01 /* service has no prefernce on power mode setting. eg. connection to \
1056 service got closed */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001057
Marie Janssene9e58ce2016-06-17 14:12:17 -07001058typedef uint8_t tBTA_DM_PM_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001059
1060/* index to bta_dm_ssr_spec */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001061#define BTA_DM_PM_SSR0 0
1062#define BTA_DM_PM_SSR1 \
1063 1 /* BTA_DM_PM_SSR1 will be dedicated for \
1064 HH SSR setting entry, no other profile can use it */
1065#define BTA_DM_PM_SSR2 2
1066#define BTA_DM_PM_SSR3 3
1067#define BTA_DM_PM_SSR4 4
1068#define BTA_DM_PM_SSR5 5
1069#define BTA_DM_PM_SSR6 6
The Android Open Source Project5738f832012-12-12 16:00:35 -08001070
Myles Watsoncd1fd072016-11-09 13:17:43 -08001071#define BTA_DM_PM_NUM_EVTS 9
The Android Open Source Project5738f832012-12-12 16:00:35 -08001072
1073#ifndef BTA_DM_PM_PARK_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001074#define BTA_DM_PM_PARK_IDX \
1075 5 /* the actual index to bta_dm_pm_md[] for PARK mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001076#endif
1077
Adam Hampson63399d92014-05-19 16:23:45 -07001078#ifndef BTA_DM_PM_SNIFF_A2DP_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001079#define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF
Adam Hampson63399d92014-05-19 16:23:45 -07001080#endif
1081
1082#ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001083#define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF2
Adam Hampson63399d92014-05-19 16:23:45 -07001084#endif
1085
1086#ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001087#define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3
Adam Hampson63399d92014-05-19 16:23:45 -07001088#endif
1089
1090#ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX
1091#define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF4
1092#endif
1093
1094#ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX
1095#define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF2
1096#endif
1097
1098#ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX
1099#define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF2
1100#endif
1101
1102#ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX
1103#define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF2
1104#endif
1105
Adam Hampson63399d92014-05-19 16:23:45 -07001106#ifndef BTA_DM_PM_HH_OPEN_DELAY
1107#define BTA_DM_PM_HH_OPEN_DELAY 30000
1108#endif
1109
1110#ifndef BTA_DM_PM_HH_ACTIVE_DELAY
1111#define BTA_DM_PM_HH_ACTIVE_DELAY 30000
1112#endif
1113
1114#ifndef BTA_DM_PM_HH_IDLE_DELAY
1115#define BTA_DM_PM_HH_IDLE_DELAY 30000
1116#endif
1117
1118/* The Sniff Parameters defined below must be ordered from highest
1119 * latency (biggest interval) to lowest latency. If there is a conflict
1120 * among the connected services the setting with the lowest latency will
1121 * be selected. If a device should override a sniff parameter then it
1122 * must insure that order is maintained.
1123 */
1124#ifndef BTA_DM_PM_SNIFF_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001125#define BTA_DM_PM_SNIFF_MAX 800
1126#define BTA_DM_PM_SNIFF_MIN 400
1127#define BTA_DM_PM_SNIFF_ATTEMPT 4
1128#define BTA_DM_PM_SNIFF_TIMEOUT 1
Adam Hampson63399d92014-05-19 16:23:45 -07001129#endif
1130
1131#ifndef BTA_DM_PM_SNIFF1_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001132#define BTA_DM_PM_SNIFF1_MAX 400
1133#define BTA_DM_PM_SNIFF1_MIN 200
Adam Hampson63399d92014-05-19 16:23:45 -07001134#define BTA_DM_PM_SNIFF1_ATTEMPT 4
1135#define BTA_DM_PM_SNIFF1_TIMEOUT 1
1136#endif
1137
1138#ifndef BTA_DM_PM_SNIFF2_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001139#define BTA_DM_PM_SNIFF2_MAX 180
1140#define BTA_DM_PM_SNIFF2_MIN 150
Adam Hampson63399d92014-05-19 16:23:45 -07001141#define BTA_DM_PM_SNIFF2_ATTEMPT 4
1142#define BTA_DM_PM_SNIFF2_TIMEOUT 1
1143#endif
1144
1145#ifndef BTA_DM_PM_SNIFF3_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001146#define BTA_DM_PM_SNIFF3_MAX 150
1147#define BTA_DM_PM_SNIFF3_MIN 50
Adam Hampson63399d92014-05-19 16:23:45 -07001148#define BTA_DM_PM_SNIFF3_ATTEMPT 4
1149#define BTA_DM_PM_SNIFF3_TIMEOUT 1
1150#endif
1151
1152#ifndef BTA_DM_PM_SNIFF4_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001153#define BTA_DM_PM_SNIFF4_MAX 54
1154#define BTA_DM_PM_SNIFF4_MIN 30
Adam Hampson63399d92014-05-19 16:23:45 -07001155#define BTA_DM_PM_SNIFF4_ATTEMPT 4
1156#define BTA_DM_PM_SNIFF4_TIMEOUT 1
1157#endif
1158
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -07001159#ifndef BTA_DM_PM_SNIFF5_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001160#define BTA_DM_PM_SNIFF5_MAX 36
1161#define BTA_DM_PM_SNIFF5_MIN 30
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -07001162#define BTA_DM_PM_SNIFF5_ATTEMPT 2
1163#define BTA_DM_PM_SNIFF5_TIMEOUT 0
1164#endif
1165
Adam Hampson63399d92014-05-19 16:23:45 -07001166#ifndef BTA_DM_PM_PARK_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001167#define BTA_DM_PM_PARK_MAX 800
1168#define BTA_DM_PM_PARK_MIN 400
1169#define BTA_DM_PM_PARK_ATTEMPT 0
1170#define BTA_DM_PM_PARK_TIMEOUT 0
Adam Hampson63399d92014-05-19 16:23:45 -07001171#endif
1172
The Android Open Source Project5738f832012-12-12 16:00:35 -08001173/* Switch callback events */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001174#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001175
Marie Janssene9e58ce2016-06-17 14:12:17 -07001176typedef uint8_t tBTA_DM_SWITCH_EVT;
Myles Watsoncd1fd072016-11-09 13:17:43 -08001177typedef void(tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event,
1178 tBTA_STATUS status);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001179
1180/* Audio routing out configuration */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001181#define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */
1182#define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */
1183#define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */
1184#define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */
1185#define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */
1186#define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */
1187#define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */
1188#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
1189#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001190
Marie Janssene9e58ce2016-06-17 14:12:17 -07001191typedef uint8_t tBTA_DM_ROUTE_PATH;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001192
The Android Open Source Project5738f832012-12-12 16:00:35 -08001193/* Device Identification (DI) data structure
1194*/
1195/* Used to set the DI record */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001196typedef tSDP_DI_RECORD tBTA_DI_RECORD;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001197/* Used to get the DI record */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001198typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001199/* SDP discovery database */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001200typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001201
Myles Watsoncd1fd072016-11-09 13:17:43 -08001202#ifndef BTA_DI_NUM_MAX
1203#define BTA_DI_NUM_MAX 3
The Android Open Source Project5738f832012-12-12 16:00:35 -08001204#endif
1205
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001206/* Device features mask definitions */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001207#define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE
1208#define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001209/* ACL type
1210*/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001211#define BTA_DM_LINK_TYPE_BR_EDR 0x01
1212#define BTA_DM_LINK_TYPE_LE 0x02
1213#define BTA_DM_LINK_TYPE_ALL 0xFF
Marie Janssene9e58ce2016-06-17 14:12:17 -07001214typedef uint8_t tBTA_DM_LINK_TYPE;
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001215
Myles Watsoncd1fd072016-11-09 13:17:43 -08001216#define IMMEDIATE_DELY_MODE 0x00
1217#define ONFOUND_DELY_MODE 0x01
1218#define BATCH_DELY_MODE 0x02
1219#define ALLOW_ALL_FILTER 0x00
1220#define LOWEST_RSSI_VALUE 129
Satya Calloji6e2d9db2014-07-08 16:18:58 -07001221
The Android Open Source Project5738f832012-12-12 16:00:35 -08001222/*****************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001223 * External Function Declarations
1224 ****************************************************************************/
The Android Open Source Project5738f832012-12-12 16:00:35 -08001225
1226/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001227 *
1228 * Function BTA_EnableBluetooth
1229 *
1230 * Description This function initializes BTA and prepares BTA and the
1231 * Bluetooth protocol stack for use. This function is
1232 * typically called at startup or when Bluetooth services
1233 * are required by the phone. This function must be called
1234 * before calling any other API function.
1235 *
1236 *
1237 * Returns BTA_SUCCESS if successful.
1238 * BTA_FAIL if internal failure.
1239 *
1240 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001241extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK* p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001242
1243/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001244 *
1245 * Function BTA_DisableBluetooth
1246 *
1247 * Description This function disables BTA and the Bluetooth protocol
1248 * stack. It is called when BTA is no longer being used
1249 * by any application in the system.
1250 *
1251 *
1252 * Returns void
1253 *
1254 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001255extern tBTA_STATUS BTA_DisableBluetooth(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001256
1257/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001258 *
1259 * Function BTA_EnableTestMode
1260 *
1261 * Description Enables bluetooth device under test mode
1262 *
1263 *
1264 * Returns tBTA_STATUS
1265 *
1266 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001267extern tBTA_STATUS BTA_EnableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001268
1269/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001270 *
1271 * Function BTA_DisableTestMode
1272 *
1273 * Description Disable bluetooth device under test mode
1274 *
1275 *
1276 * Returns None
1277 *
1278 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001279extern void BTA_DisableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001280
1281/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001282 *
1283 * Function BTA_DmSetDeviceName
1284 *
1285 * Description This function sets the Bluetooth name of the local device.
1286 *
1287 *
1288 * Returns void
1289 *
1290 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001291extern void BTA_DmSetDeviceName(char* p_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001292
1293/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001294 *
1295 * Function BTA_DmSetVisibility
1296 *
1297 * Description This function sets the Bluetooth connectable,discoverable,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001298 * pairable and conn paired only modesmodes of the local
Myles Watson1baaae32016-11-09 14:25:23 -08001299 * device.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001300 * This controls whether other Bluetooth devices can find and
Myles Watson1baaae32016-11-09 14:25:23 -08001301 * connect to the local device.
Myles Watson8af480e2016-11-09 10:40:23 -08001302 *
1303 *
1304 * Returns void
1305 *
1306 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001307extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode,
1308 uint8_t pairable_mode, uint8_t conn_filter);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001309
1310/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001311 *
1312 * Function BTA_DmSearch
1313 *
1314 * Description This function searches for peer Bluetooth devices. It
1315 * first performs an inquiry; for each device found from the
1316 * inquiry it gets the remote name of the device. If
1317 * parameter services is nonzero, service discovery will be
1318 * performed on each device for the services specified.
1319 *
1320 *
1321 * Returns void
1322 *
1323 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001324extern void BTA_DmSearch(tBTA_DM_INQ* p_dm_inq, tBTA_SERVICE_MASK services,
1325 tBTA_DM_SEARCH_CBACK* p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001326
1327/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001328 *
1329 * Function BTA_DmSearchCancel
1330 *
1331 * Description This function cancels a search that has been initiated
1332 * by calling BTA_DmSearch().
1333 *
1334 *
1335 * Returns void
1336 *
1337 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001338extern void BTA_DmSearchCancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001339
1340/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001341 *
1342 * Function BTA_DmDiscover
1343 *
1344 * Description This function performs service discovery for the services
1345 * of a particular peer device.
1346 *
1347 *
1348 * Returns void
1349 *
1350 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001351extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001352 tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001353
The Android Open Source Project5738f832012-12-12 16:00:35 -08001354/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001355 *
1356 * Function BTA_DmDiscoverUUID
1357 *
1358 * Description This function performs service discovery for the services
1359 * of a particular peer device.
1360 *
1361 *
1362 * Returns void
1363 *
1364 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001365extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID* uuid,
1366 tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001367
1368/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001369 *
1370 * Function BTA_DmGetCachedRemoteName
1371 *
1372 * Description Retieve cached remote name if available
1373 *
1374 * Returns BTA_SUCCESS if cached name was retrieved
1375 * BTA_FAILURE if cached name is not available
1376 *
1377 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001378tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device,
1379 uint8_t** pp_cached_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001380
1381/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001382 *
1383 * Function BTA_DmBond
1384 *
1385 * Description This function initiates a bonding procedure with a peer
1386 * device. The bonding procedure enables authentication
1387 * and optionally encryption on the Bluetooth link.
1388 *
1389 *
1390 * Returns void
1391 *
1392 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001393extern void BTA_DmBond(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001394
1395/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001396 *
1397 * Function BTA_DmBondByTransport
1398 *
1399 * Description This function initiates a bonding procedure with a peer
Myles Watsoncd1fd072016-11-09 13:17:43 -08001400 * device by designated transport. The bonding procedure
Myles Watson1baaae32016-11-09 14:25:23 -08001401 * enables authentication and optionally encryption on the
1402 * Bluetooth link.
Myles Watson8af480e2016-11-09 10:40:23 -08001403 *
1404 *
1405 * Returns void
1406 *
1407 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001408extern void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001409
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001410/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001411 *
1412 * Function BTA_DmBondCancel
1413 *
1414 * Description This function cancels a bonding procedure with a peer
1415 * device.
1416 *
1417 *
1418 * Returns void
1419 *
1420 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001421extern void BTA_DmBondCancel(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001422
1423/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001424 *
1425 * Function BTA_DmPinReply
1426 *
1427 * Description This function provides a PIN when one is requested by DM
1428 * during a bonding procedure. The application should call
1429 * this function after the security callback is called with
1430 * a BTA_DM_PIN_REQ_EVT.
1431 *
1432 *
1433 * Returns void
1434 *
1435 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001436extern void BTA_DmPinReply(BD_ADDR bd_addr, bool accept, uint8_t pin_len,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001437 uint8_t* p_pin);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001438
The Android Open Source Project5738f832012-12-12 16:00:35 -08001439/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001440 *
1441 * Function BTA_DmLocalOob
1442 *
1443 * Description This function retrieves the OOB data from local controller.
1444 * The result is reported by bta_dm_co_loc_oob().
1445 *
1446 * Returns void
1447 *
1448 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001449extern void BTA_DmLocalOob(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001450
1451/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001452 *
1453 * Function BTA_DmConfirm
1454 *
1455 * Description This function accepts or rejects the numerical value of the
1456 * Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT
1457 *
1458 * Returns void
1459 *
1460 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001461extern void BTA_DmConfirm(BD_ADDR bd_addr, bool accept);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001462
1463/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001464 *
1465 * Function BTA_DmAddDevice
1466 *
1467 * Description This function adds a device to the security database list
1468 * of peer devices. This function would typically be called
1469 * at system startup to initialize the security database with
1470 * known peer devices. This is a direct execution function
1471 * that may lock task scheduling on some platforms.
1472 *
1473 * Returns void
1474 *
1475 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001476extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class,
1477 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001478 bool is_trusted, uint8_t key_type,
1479 tBTA_IO_CAP io_cap, uint8_t pin_length);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001480
1481/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001482 *
1483 * Function BTA_DmRemoveDevice
1484 *
1485 * Description This function removes a device from the security database.
1486 * This is a direct execution function that may lock task
1487 * scheduling on some platforms.
1488 *
1489 *
1490 * Returns BTA_SUCCESS if successful.
1491 * BTA_FAIL if operation failed.
1492 *
1493 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001494extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001495
1496/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001497 *
1498 * Function BTA_GetEirService
1499 *
1500 * Description This function is called to get BTA service mask from EIR.
1501 *
1502 * Parameters p_eir - pointer of EIR significant part
1503 * p_services - return the BTA service mask
1504 *
1505 * Returns None
1506 *
1507 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001508extern void BTA_GetEirService(uint8_t* p_eir, tBTA_SERVICE_MASK* p_services);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001509
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001510/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001511 *
1512 * Function BTA_DmGetConnectionState
1513 *
1514 * Description Returns whether the remote device is currently connected.
1515 *
1516 * Returns 0 if the device is NOT connected.
1517 *
1518 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001519extern uint16_t BTA_DmGetConnectionState(const BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001520
1521/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001522 *
1523 * Function BTA_DmSetLocalDiRecord
1524 *
1525 * Description This function adds a DI record to the local SDP database.
1526 *
1527 * Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1528 *
1529 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001530extern tBTA_STATUS BTA_DmSetLocalDiRecord(tBTA_DI_RECORD* p_device_info,
1531 uint32_t* p_handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001532
1533/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001534 *
1535 *
1536 * Function BTA_DmCloseACL
1537 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001538 * Description This function force to close an ACL connection and remove
1539 the
Myles Watson8af480e2016-11-09 10:40:23 -08001540 * device from the security database list of known devices.
1541 *
1542 * Parameters: bd_addr - Address of the peer device
1543 * remove_dev - remove device or not after link down
1544 * transport - which transport to close
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001545
Myles Watson8af480e2016-11-09 10:40:23 -08001546 *
1547 * Returns void.
1548 *
1549 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001550extern void BTA_DmCloseACL(BD_ADDR bd_addr, bool remove_dev,
1551 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001552
1553/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001554 *
1555 * Function bta_dmexecutecallback
1556 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001557 * Description This function will request BTA to execute a call back in the
Myles Watson1baaae32016-11-09 14:25:23 -08001558 * context of BTU task.
Myles Watson8af480e2016-11-09 10:40:23 -08001559 * This API was named in lower case because it is only intended
1560 * for the internal customers(like BTIF).
1561 *
1562 * Returns void
1563 *
1564 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001565extern void bta_dmexecutecallback(tBTA_DM_EXEC_CBACK* p_callback,
1566 void* p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001567
1568#if (BTM_SCO_HCI_INCLUDED == TRUE)
1569/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001570 *
1571 * Function BTA_DmPcmInitSamples
1572 *
1573 * Description initialize the down sample converter.
1574 *
1575 * src_sps: original samples per second (source audio data)
1576 * (ex. 44100, 48000)
1577 * bits: number of bits per pcm sample (16)
1578 * n_channels: number of channels (i.e. mono(1), stereo(2)...)
1579 *
1580 * Returns none
1581 *
1582 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001583extern void BTA_DmPcmInitSamples(uint32_t src_sps, uint32_t bits,
1584 uint32_t n_channels);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001585
1586/**************************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001587 * Function BTA_DmPcmResample
1588 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001589 * Description Down sampling utility to convert higher sampling rate into
Myles Watson1baaae32016-11-09 14:25:23 -08001590 * 8K/16bits
Myles Watson8af480e2016-11-09 10:40:23 -08001591 * PCM samples.
1592 *
1593 * Parameters p_src: pointer to the buffer where the original sampling PCM
1594 * are stored.
1595 * in_bytes: Length of the input PCM sample buffer in byte.
Myles Watson1baaae32016-11-09 14:25:23 -08001596 * p_dst: pointer to the buffer which is to be used to store
1597 * the converted PCM samples.
Myles Watson8af480e2016-11-09 10:40:23 -08001598 *
1599 *
1600 * Returns int32_t: number of samples converted.
1601 *
1602 *************************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001603extern int32_t BTA_DmPcmResample(void* p_src, uint32_t in_bytes, void* p_dst);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001604#endif
1605
The Android Open Source Project5738f832012-12-12 16:00:35 -08001606/* BLE related API functions */
1607/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001608 *
1609 * Function BTA_DmBleSecurityGrant
1610 *
1611 * Description Grant security request access.
1612 *
1613 * Parameters: bd_addr - BD address of the peer
1614 * res - security grant status.
1615 *
1616 * Returns void
1617 *
1618 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001619extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001620
The Android Open Source Project5738f832012-12-12 16:00:35 -08001621/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001622 *
1623 * Function BTA_DmBleSetBgConnType
1624 *
1625 * Description This function is called to set BLE connectable mode for a
1626 * peripheral device.
1627 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001628 * Parameters bg_conn_type: it can be auto connection, or selective
Myles Watson1baaae32016-11-09 14:25:23 -08001629 * connection.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001630 * p_select_cback: callback function when selective connection
Myles Watson1baaae32016-11-09 14:25:23 -08001631 * procedure is being used.
Myles Watson8af480e2016-11-09 10:40:23 -08001632 *
1633 * Returns void
1634 *
1635 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001636extern void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type,
1637 tBTA_DM_BLE_SEL_CBACK* p_select_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001638
1639/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001640 *
1641 * Function BTA_DmBlePasskeyReply
1642 *
1643 * Description Send BLE SMP passkey reply.
1644 *
1645 * Parameters: bd_addr - BD address of the peer
1646 * accept - passkey entry sucessful or declined.
1647 * passkey - passkey value, must be a 6 digit number,
1648 * can be lead by 0.
1649 *
1650 * Returns void
1651 *
1652 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001653extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept,
1654 uint32_t passkey);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001655
1656/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001657 *
1658 * Function BTA_DmBleConfirmReply
1659 *
1660 * Description Send BLE SMP SC user confirmation reply.
1661 *
1662 * Parameters: bd_addr - BD address of the peer
Myles Watsoncd1fd072016-11-09 13:17:43 -08001663 * accept - numbers to compare are the same or
Myles Watson1baaae32016-11-09 14:25:23 -08001664 * different.
Myles Watson8af480e2016-11-09 10:40:23 -08001665 *
1666 * Returns void
1667 *
1668 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001669extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept);
Satya Calloji444a8da2015-03-06 10:38:22 -08001670
1671/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001672 *
1673 * Function BTA_DmAddBleDevice
1674 *
1675 * Description Add a BLE device. This function will be normally called
1676 * during host startup to restore all required information
1677 * for a LE device stored in the NVRAM.
1678 *
1679 * Parameters: bd_addr - BD address of the peer
1680 * dev_type - Remote device's device type.
1681 * addr_type - LE device address type.
1682 *
1683 * Returns void
1684 *
1685 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001686extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
1687 tBT_DEVICE_TYPE dev_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001688
The Android Open Source Project5738f832012-12-12 16:00:35 -08001689/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001690 *
1691 * Function BTA_DmAddBleKey
1692 *
1693 * Description Add/modify LE device information. This function will be
1694 * normally called during host startup to restore all required
1695 * information stored in the NVRAM.
1696 *
1697 * Parameters: bd_addr - BD address of the peer
1698 * p_le_key - LE key values.
1699 * key_type - LE SMP key type.
1700 *
1701 * Returns void
1702 *
1703 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001704extern void BTA_DmAddBleKey(BD_ADDR bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
1705 tBTA_LE_KEY_TYPE key_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001706
1707/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001708 *
1709 * Function BTA_DmSetBlePrefConnParams
1710 *
1711 * Description This function is called to set the preferred connection
1712 * parameters when default connection parameter is not desired.
1713 *
1714 * Parameters: bd_addr - BD address of the peripheral
1715 * min_conn_int - minimum preferred connection interval
1716 * max_conn_int - maximum preferred connection interval
1717 * slave_latency - preferred slave latency
1718 * supervision_tout - preferred supervision timeout
1719 *
1720 *
1721 * Returns void
1722 *
1723 ******************************************************************************/
Jakub Pawlowski063ca022016-04-25 10:43:02 -07001724extern void BTA_DmSetBlePrefConnParams(const BD_ADDR bd_addr,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001725 uint16_t min_conn_int,
1726 uint16_t max_conn_int,
1727 uint16_t slave_latency,
1728 uint16_t supervision_tout);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001729
1730/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001731 *
1732 * Function BTA_DmSetBleConnScanParams
1733 *
1734 * Description This function is called to set scan parameters used in
1735 * BLE connection request
1736 *
1737 * Parameters: scan_interval - scan interval
1738 * scan_window - scan window
1739 *
1740 * Returns void
1741 *
1742 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001743extern void BTA_DmSetBleConnScanParams(uint32_t scan_interval,
1744 uint32_t scan_window);
Satya Calloji5725fc62015-03-31 13:24:32 -07001745
1746/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001747 *
1748 * Function BTA_DmSetBleScanParams
1749 *
1750 * Description This function is called to set scan parameters
1751 *
1752 * Parameters: client_if - Client IF
1753 * scan_interval - scan interval
1754 * scan_window - scan window
1755 * scan_mode - scan mode
Myles Watsoncd1fd072016-11-09 13:17:43 -08001756 * scan_param_setup_status_cback - Set scan param status
Myles Watson1baaae32016-11-09 14:25:23 -08001757 * callback
Myles Watson8af480e2016-11-09 10:40:23 -08001758 *
1759 * Returns void
1760 *
1761 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001762extern void BTA_DmSetBleScanParams(
1763 tGATT_IF client_if, uint32_t scan_interval, uint32_t scan_window,
1764 tBLE_SCAN_MODE scan_mode,
1765 tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_status_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001766
1767/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001768 *
1769 * Function BTA_DmSetBleAdvParams
1770 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001771 * Description This function sets the advertising parameters BLE
Myles Watson1baaae32016-11-09 14:25:23 -08001772 * functionality.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001773 * It is to be called when device act in peripheral or
Myles Watson1baaae32016-11-09 14:25:23 -08001774 * broadcaster role.
Myles Watson8af480e2016-11-09 10:40:23 -08001775 *
1776 * Parameters: adv_int_min - adv interval minimum
1777 * adv_int_max - adv interval max
1778 * p_dir_bda - directed adv initator address
1779 *
1780 * Returns void
1781 *
1782 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001783extern void BTA_DmSetBleAdvParams(uint16_t adv_int_min, uint16_t adv_int_max,
1784 tBLE_BD_ADDR* p_dir_bda);
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001785/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001786 *
1787 * Function BTA_DmSearchExt
1788 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001789 * Description This function searches for peer Bluetooth devices. It
Myles Watson1baaae32016-11-09 14:25:23 -08001790 * performs an inquiry and gets the remote name for devices.
1791 * Service discovery is done if services is non zero
Myles Watson8af480e2016-11-09 10:40:23 -08001792 *
1793 * Parameters p_dm_inq: inquiry conditions
Myles Watsoncd1fd072016-11-09 13:17:43 -08001794 * services: if service is not empty, service discovery will be
Myles Watson1baaae32016-11-09 14:25:23 -08001795 * done.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001796 * for all GATT based service condition, put
Myles Watson1baaae32016-11-09 14:25:23 -08001797 * num_uuid, and p_uuid is the pointer to the list of
1798 * UUID values.
Myles Watson8af480e2016-11-09 10:40:23 -08001799 * p_cback: callback functino when search is completed.
1800 *
1801 *
1802 *
1803 * Returns void
1804 *
1805 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001806extern void BTA_DmSearchExt(tBTA_DM_INQ* p_dm_inq,
1807 tBTA_SERVICE_MASK_EXT* p_services,
1808 tBTA_DM_SEARCH_CBACK* p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001809
1810/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001811 *
1812 * Function BTA_DmDiscoverExt
1813 *
1814 * Description This function does service discovery for services of a
1815 * peer device. When services.num_uuid is 0, it indicates all
1816 * GATT based services are to be searched; other wise a list of
1817 * UUID of interested services should be provided through
1818 * services.p_uuid.
1819 *
1820 *
1821 *
1822 * Returns void
1823 *
1824 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001825extern void BTA_DmDiscoverExt(BD_ADDR bd_addr,
1826 tBTA_SERVICE_MASK_EXT* p_services,
1827 tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001828
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001829/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001830 *
1831 * Function BTA_DmDiscoverByTransport
1832 *
1833 * Description This function does service discovery on particular transport
1834 * for services of a
1835 * peer device. When services.num_uuid is 0, it indicates all
1836 * GATT based services are to be searched; other wise a list of
1837 * UUID of interested services should be provided through
1838 * p_services->p_uuid.
1839 *
1840 *
1841 *
1842 * Returns void
1843 *
1844 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001845extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr,
1846 tBTA_SERVICE_MASK_EXT* p_services,
1847 tBTA_DM_SEARCH_CBACK* p_cback,
1848 bool sdp_search,
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001849 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001850
1851/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001852 *
1853 * Function BTA_DmSetEncryption
1854 *
1855 * Description This function is called to ensure that connection is
1856 * encrypted. Should be called only on an open connection.
1857 * Typically only needed for connections that first want to
1858 * bring up unencrypted links, then later encrypt them.
1859 *
1860 * Parameters: bd_addr - Address of the peer device
1861 * transport - transport of the link to be encruypted
1862 * p_callback - Pointer to callback function to indicat the
1863 * link encryption status
1864 * sec_act - This is the security action to indicate
Myles Watson1baaae32016-11-09 14:25:23 -08001865 * what kind of BLE security level is required
1866 * for the BLE link if BLE is supported
1867 * Note: This parameter is ignored for
1868 * BR/EDR or if BLE is not supported.
Myles Watson8af480e2016-11-09 10:40:23 -08001869 *
1870 * Returns void
1871 *
1872 *
1873 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001874extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001875 tBTA_DM_ENCRYPT_CBACK* p_callback,
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001876 tBTA_DM_BLE_SEC_ACT sec_act);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001877
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001878/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001879 *
1880 * Function BTA_DmBleObserve
1881 *
1882 * Description This procedure keep the device listening for advertising
1883 * events from a broadcast device.
1884 *
1885 * Parameters start: start or stop observe.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001886 * duration : Duration of the scan. Continuous scan if 0 is
Myles Watson1baaae32016-11-09 14:25:23 -08001887 * passed
Myles Watson8af480e2016-11-09 10:40:23 -08001888 * p_results_cb: Callback to be called with scan results
1889 *
1890 * Returns void
1891 *
1892 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001893extern void BTA_DmBleObserve(bool start, uint8_t duration,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001894 tBTA_DM_SEARCH_CBACK* p_results_cb);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001895
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001896/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001897 *
1898 * Function BTA_DmBleConfigLocalPrivacy
1899 *
1900 * Description Enable/disable privacy on the local device
1901 *
1902 * Parameters: privacy_enable - enable/disabe privacy on remote device.
1903 *
1904 * Returns void
1905 *
1906 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001907extern void BTA_DmBleConfigLocalPrivacy(bool privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001908
1909/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001910 *
1911 * Function BTA_DmBleEnableRemotePrivacy
1912 *
1913 * Description Enable/disable privacy on a remote device
1914 *
1915 * Parameters: bd_addr - BD address of the peer
1916 * privacy_enable - enable/disabe privacy on remote device.
1917 *
1918 * Returns void
1919 *
1920 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001921extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, bool privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001922
Jakub Pawlowski6a966612016-08-16 03:25:45 -07001923/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001924 *
1925 * Function BTA_DmBleUpdateConnectionParams
1926 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001927 * Description Update connection parameters, can only be used when
Myles Watson1baaae32016-11-09 14:25:23 -08001928 * connection is up.
Myles Watson8af480e2016-11-09 10:40:23 -08001929 *
1930 * Parameters: bd_addr - BD address of the peer
Myles Watson1baaae32016-11-09 14:25:23 -08001931 * min_int - minimum connection interval, [0x0004 ~ 0x4000]
1932 * max_int - maximum connection interval, [0x0004 ~ 0x4000]
1933 * latency - slave latency [0 ~ 500]
1934 * timeout - supervision timeout [0x000a ~ 0xc80]
Myles Watson8af480e2016-11-09 10:40:23 -08001935 *
1936 * Returns void
1937 *
1938 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001939extern void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr,
1940 uint16_t min_int, uint16_t max_int,
1941 uint16_t latency, uint16_t timeout);
Satya Callojic4e25962014-05-10 23:46:24 -07001942
1943/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001944 *
1945 * Function BTA_DmBleSetDataLength
1946 *
1947 * Description This function is to set maximum LE data packet size
1948 *
1949 * Returns void
1950 *
1951 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001952extern void BTA_DmBleSetDataLength(BD_ADDR remote_device,
1953 uint16_t tx_data_length);
Priti Aghera636d6712014-12-18 13:55:48 -08001954
1955/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001956 *
1957 * Function BTA_DmBleSetStorageParams
1958 *
1959 * Description This function is called to set the storage parameters
1960 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001961 * Parameters batch_scan_full_max -Max storage space (in %) allocated to
Myles Watson1baaae32016-11-09 14:25:23 -08001962 * full scanning
Myles Watsoncd1fd072016-11-09 13:17:43 -08001963 * batch_scan_trunc_max -Max storage space (in %) allocated to
Myles Watson1baaae32016-11-09 14:25:23 -08001964 * truncated scanning
Myles Watsoncd1fd072016-11-09 13:17:43 -08001965 * batch_scan_notify_threshold - Setup notification level based
Myles Watson1baaae32016-11-09 14:25:23 -08001966 * on total space consumed by
1967 * both pools. Setting it to 0
1968 * will disable threshold
1969 * notification
Myles Watson8af480e2016-11-09 10:40:23 -08001970 * p_setup_cback - Setup callback
1971 * p_thres_cback - Threshold callback
1972 * p_rep_cback - Reports callback
1973 * ref_value - Reference value
1974 *
1975 * Returns None
1976 *
1977 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001978extern void BTA_DmBleSetStorageParams(
1979 uint8_t batch_scan_full_max, uint8_t batch_scan_trunc_max,
1980 uint8_t batch_scan_notify_threshold,
1981 tBTA_BLE_SCAN_SETUP_CBACK* p_setup_cback,
1982 tBTA_BLE_SCAN_THRESHOLD_CBACK* p_thres_cback,
1983 tBTA_BLE_SCAN_REP_CBACK* p_rep_cback, tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07001984
1985/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001986 *
1987 * Function BTA_DmBleEnableBatchScan
1988 *
1989 * Description This function is called to enable the batch scan
1990 *
1991 * Parameters scan_mode -Batch scan mode
1992 * scan_interval - Scan interval
1993 * scan_window - Scan window
1994 * discard_rule -Discard rules
1995 * addr_type - Address type
1996 * ref_value - Reference value
1997 *
1998 * Returns None
1999 *
2000 ******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002001extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002002 uint32_t scan_interval,
2003 uint32_t scan_window,
2004 tBTA_BLE_DISCARD_RULE discard_rule,
2005 tBLE_ADDR_TYPE addr_type,
2006 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002007
2008/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002009 *
2010 * Function BTA_DmBleReadScanReports
2011 *
2012 * Description This function is called to read the batch scan reports
2013 *
2014 * Parameters scan_mode -Batch scan mode
2015 * ref_value - Reference value
2016 *
2017 * Returns None
2018 *
2019 ******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002020extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002021 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002022
2023/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002024 *
2025 * Function BTA_DmBleDisableBatchScan
2026 *
2027 * Description This function is called to disable the batch scanning
2028 *
2029 * Parameters ref_value - Reference value
2030 *
2031 * Returns None
2032 *
2033 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002034extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002035
Satya Calloji1a9247a2014-06-05 13:15:15 -07002036/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002037 *
2038 * Function BTA_DmEnableScanFilter
2039 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002040 * Description This function is called to enable the adv data payload
Myles Watson1baaae32016-11-09 14:25:23 -08002041 * filter
Myles Watson8af480e2016-11-09 10:40:23 -08002042 *
2043 * Parameters action - enable or disable the APCF feature
2044 * p_cmpl_cback - Command completed callback
2045 * ref_value - Reference value
2046 *
2047 * Returns void
2048 *
2049 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002050extern void BTA_DmEnableScanFilter(uint8_t action,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002051 tBTA_DM_BLE_PF_STATUS_CBACK* p_cmpl_cback,
2052 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -07002053
2054/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002055 *
2056 * Function BTA_DmBleScanFilterSetup
2057 *
2058 * Description This function is called to setup the filter params
2059 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002060 * Parameters p_target: enable the filter condition on a target device; if
Myles Watson1baaae32016-11-09 14:25:23 -08002061 * NULL
Myles Watson8af480e2016-11-09 10:40:23 -08002062 * filt_index - Filter index
2063 * p_filt_params -Filter parameters
2064 * ref_value - Reference value
2065 * action - Add, delete or clear
2066 * p_cmpl_back - Command completed callback
2067 *
2068 * Returns void
2069 *
2070 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002071extern void BTA_DmBleScanFilterSetup(uint8_t action,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002072 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2073 tBTA_DM_BLE_PF_FILT_PARAMS* p_filt_params,
2074 tBLE_BD_ADDR* p_target,
2075 tBTA_DM_BLE_PF_PARAM_CBACK* p_cmpl_cback,
2076 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -07002077
2078/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002079 *
2080 * Function BTA_DmBleCfgFilterCondition
2081 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002082 * Description This function is called to configure the adv data payload
Myles Watson1baaae32016-11-09 14:25:23 -08002083 * filter condition.
Myles Watson8af480e2016-11-09 10:40:23 -08002084 *
2085 * Parameters action: to read/write/clear
2086 * cond_type: filter condition type
2087 * filt_index - Filter index
2088 * p_cond: filter condition parameter
2089 * p_cmpl_back - Command completed callback
2090 * ref_value - Reference value
2091 *
2092 * Returns void
2093 *
2094 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002095extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002096 tBTA_DM_BLE_PF_COND_TYPE cond_type,
2097 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2098 tBTA_DM_BLE_PF_COND_PARAM* p_cond,
2099 tBTA_DM_BLE_PF_CFG_CBACK* p_cmpl_cback,
2100 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07002101
2102/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002103 *
2104 * Function BTA_DmBleTrackAdvertiser
2105 *
2106 * Description This function is called to track the advertiser
2107 *
2108 * Parameters ref_value - Reference value
2109 * p_track_adv_cback - ADV callback
2110 *
2111 * Returns None
2112 *
2113 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002114extern void BTA_DmBleTrackAdvertiser(
2115 tBTA_DM_BLE_REF_VALUE ref_value,
2116 tBTA_BLE_TRACK_ADV_CBACK* p_track_adv_cback);
Satya Calloji1acb61c2014-06-14 23:16:18 -07002117
Satya Callojie5ba8842014-07-03 17:18:02 -07002118/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002119 *
2120 * Function BTA_DmBleGetEnergyInfo
2121 *
2122 * Description This function is called to obtain the energy info
2123 *
2124 * Parameters p_cmpl_cback - Command complete callback
2125 *
2126 * Returns void
2127 *
2128 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002129extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback);
Satya Callojie5ba8842014-07-03 17:18:02 -07002130
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002131/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002132 *
2133 * Function BTA_BrcmInit
2134 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002135 * Description This function initializes Broadcom specific VS handler in
Myles Watson1baaae32016-11-09 14:25:23 -08002136 * BTA
Myles Watson8af480e2016-11-09 10:40:23 -08002137 *
2138 * Returns void
2139 *
2140 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002141extern void BTA_VendorInit(void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002142
2143/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002144 *
2145 * Function BTA_BrcmCleanup
2146 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002147 * Description This function frees up Broadcom specific VS specific dynamic
Myles Watson1baaae32016-11-09 14:25:23 -08002148 * memory
Myles Watson8af480e2016-11-09 10:40:23 -08002149 *
2150 * Returns void
2151 *
2152 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002153extern void BTA_VendorCleanup(void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002154
The Android Open Source Project5738f832012-12-12 16:00:35 -08002155#ifdef __cplusplus
2156}
2157#endif
2158
2159#endif /* BTA_API_H */