blob: 5422c9dfdd0c3ca3cfaf493f1f266fa695d0211d [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
Marie Janssene9e58ce2016-06-17 14:12:17 -070032#if (BLE_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080033#include "btm_ble_api.h"
34#endif
35
Bryce Lee3d6accf2016-05-10 17:10:09 -070036#ifdef __cplusplus
37extern "C" {
38#endif
39
The Android Open Source Project5738f832012-12-12 16:00:35 -080040/*****************************************************************************
41** Constants and data types
42*****************************************************************************/
43
44/* Status Return Value */
45#define BTA_SUCCESS 0 /* Successful operation. */
46#define BTA_FAILURE 1 /* Generic failure. */
47#define BTA_PENDING 2 /* API cannot be completed right now */
48#define BTA_BUSY 3
49#define BTA_NO_RESOURCES 4
50#define BTA_WRONG_MODE 5
51
Marie Janssene9e58ce2016-06-17 14:12:17 -070052typedef uint8_t tBTA_STATUS;
The Android Open Source Project5738f832012-12-12 16:00:35 -080053
54/*
55 * Service ID
56 *
57 * NOTES: When you add a new Service ID for BTA AND require to change the value of BTA_MAX_SERVICE_ID,
58 * make sure that the correct security ID of the new service from Security service definitions (btm_api.h)
59 * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in bta_dm_act.c.
60 */
61
62#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 */
Rakesh Iyer9c8dfac2015-04-08 12:25:37 -070080#define BTA_A2DP_SINK_SERVICE_ID 18 /* A2DP Sink */
The Android Open Source Project5738f832012-12-12 16:00:35 -080081#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*/
Kim Schulz8372aa52015-03-25 10:39:40 +010091#define BTA_SDP_SERVICE_ID 29 /* SDP Search*/
Marie Janssene9e58ce2016-06-17 14:12:17 -070092#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080093/* BLE profile service ID */
Kim Schulz8372aa52015-03-25 10:39:40 +010094#define BTA_BLE_SERVICE_ID 30 /* GATT profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -080095
Kim Schulz8372aa52015-03-25 10:39:40 +010096#define BTA_USER_SERVICE_ID 31 /* User requested UUID */
The Android Open Source Project5738f832012-12-12 16:00:35 -080097
Kim Schulz8372aa52015-03-25 10:39:40 +010098#define BTA_MAX_SERVICE_ID 32
The Android Open Source Project5738f832012-12-12 16:00:35 -080099#else
Kim Schulz8372aa52015-03-25 10:39:40 +0100100#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 */
105#define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1)
106#define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1)
107
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 */
111#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 */
140
Marie Janssene9e58ce2016-06-17 14:12:17 -0700141#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800142#define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800143#define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800144#else
The Android Open Source Project5738f832012-12-12 16:00:35 -0800145#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800146#endif
147
Marie Janssene9e58ce2016-06-17 14:12:17 -0700148#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800149#define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */
150#else
151#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
152#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 */
157typedef struct
158{
159 tBTA_SERVICE_MASK srvc_mask;
Marie Janssene9e58ce2016-06-17 14:12:17 -0700160 uint8_t num_uuid;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800161 tBT_UUID *p_uuid;
162}tBTA_SERVICE_MASK_EXT;
163
164/* Security Setting Mask */
165#define BTA_SEC_NONE BTM_SEC_NONE /* No security. */
166#define BTA_SEC_AUTHORIZE (BTM_SEC_IN_AUTHORIZE ) /* Authorization required (only needed for out going connection )*/
167#define BTA_SEC_AUTHENTICATE (BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */
168#define BTA_SEC_ENCRYPT (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */
Mudumba Ananth899b7712015-01-30 02:33:02 -0800169#define BTA_SEC_MODE4_LEVEL4 (BTM_SEC_MODE4_LEVEL4) /* Mode 4 level 4 service, i.e. incoming/outgoing MITM and P-256 encryption */
Casper Bonde818d0f22015-05-21 11:08:45 +0200170#define BTA_SEC_MITM (BTM_SEC_IN_MITM | BTM_SEC_OUT_MITM) /* Man-In-The_Middle protection */
171#define BTA_SEC_IN_16_DIGITS (BTM_SEC_IN_MIN_16_DIGIT_PIN) /* Min 16 digit for pin code */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800172
Marie Janssene9e58ce2016-06-17 14:12:17 -0700173typedef uint16_t tBTA_SEC;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800174
175/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -0700176#define BTA_DM_IGNORE 0x00FF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800177
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -0700178/* Ignore for Discoverable, Connectable only for LE modes */
179#define BTA_DM_LE_IGNORE 0xFF00
The Android Open Source Project5738f832012-12-12 16:00:35 -0800180
tturneye31d4172015-09-21 10:49:09 -0700181#define BTA_APP_ID_PAN_MULTI 0xFE /* app id for pan multiple connection */
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900182#define BTA_ALL_APP_ID 0xFF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800183
184/* Discoverable Modes */
185#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
186#define BTA_DM_GENERAL_DISC BTM_GENERAL_DISCOVERABLE /* General discoverable. */
187#define BTA_DM_LIMITED_DISC BTM_LIMITED_DISCOVERABLE /* Limited discoverable. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700188#if (BLE_INCLUDED == TRUE)
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800189#define BTA_DM_BLE_NON_DISCOVERABLE BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
190#define BTA_DM_BLE_GENERAL_DISCOVERABLE BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
191#define BTA_DM_BLE_LIMITED_DISCOVERABLE BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
192#endif
Marie Janssene9e58ce2016-06-17 14:12:17 -0700193typedef uint16_t tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and LE mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800194
195/* Connectable Modes */
196#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
197#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700198#if (BLE_INCLUDED == TRUE)
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800199#define BTA_DM_BLE_NON_CONNECTABLE BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
200#define BTA_DM_BLE_CONNECTABLE BTM_BLE_CONNECTABLE /* Device is LE connectable. */
201#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800202
Marie Janssene9e58ce2016-06-17 14:12:17 -0700203typedef uint16_t tBTA_DM_CONN;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700204
205#define BTA_TRANSPORT_UNKNOWN 0
206#define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR
207#define BTA_TRANSPORT_LE BT_TRANSPORT_LE
208typedef tBT_TRANSPORT tBTA_TRANSPORT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800209
210/* Pairable Modes */
211#define BTA_DM_PAIRABLE 1
212#define BTA_DM_NON_PAIRABLE 0
213
214/* Connectable Paired Only Mode */
215#define BTA_DM_CONN_ALL 0
216#define BTA_DM_CONN_PAIRED 1
217
218/* Inquiry Modes */
Kim Schulz8372aa52015-03-25 10:39:40 +0100219#define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800220#define BTA_DM_GENERAL_INQUIRY BTM_GENERAL_INQUIRY /* Perform general inquiry. */
221#define BTA_DM_LIMITED_INQUIRY BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
222
Marie Janssene9e58ce2016-06-17 14:12:17 -0700223#if (BLE_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800224#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
225#define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
226#define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
227#endif
Marie Janssene9e58ce2016-06-17 14:12:17 -0700228typedef uint8_t tBTA_DM_INQ_MODE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800229
230/* Inquiry Filter Type */
231#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
232#define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
233#define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
234
Marie Janssene9e58ce2016-06-17 14:12:17 -0700235typedef uint8_t tBTA_DM_INQ_FILT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800236
237/* Authorize Response */
238#define BTA_DM_AUTH_PERM 0 /* Authorized for future connections to the service */
239#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
240#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
241
Marie Janssene9e58ce2016-06-17 14:12:17 -0700242typedef uint8_t tBTA_AUTH_RESP;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800243
244/* M/S preferred roles */
245#define BTA_ANY_ROLE 0x00
246#define BTA_MASTER_ROLE_PREF 0x01
247#define BTA_MASTER_ROLE_ONLY 0x02
tturneye31d4172015-09-21 10:49:09 -0700248#define BTA_SLAVE_ROLE_ONLY 0x03 /* Used for PANU only, skip role switch to master */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800249
Marie Janssene9e58ce2016-06-17 14:12:17 -0700250typedef uint8_t tBTA_PREF_ROLES;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800251
252enum
253{
254
255 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
256 support "role switch during connection" for
257 an incoming connection, when it already has
258 another connection in master role */
259 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
260 simulateous connection in Master and Slave roles
261 for short period of time */
262 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
263 and slave roles */
264
265};
266
267
268/* Inquiry filter device class condition */
269typedef struct
270{
271 DEV_CLASS dev_class; /* device class of interest */
272 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of interest */
273} tBTA_DM_COD_COND;
274
275
276/* Inquiry Filter Condition */
277typedef union
278{
279 BD_ADDR bd_addr; /* BD address of device to filter. */
280 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
281} tBTA_DM_INQ_COND;
282
283/* Inquiry Parameters */
284typedef struct
285{
286 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700287 uint8_t duration; /* Inquiry duration in 1.28 sec units. */
288 uint8_t max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
289 bool report_dup; /* report duplicated inquiry response with higher RSSI value */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800290 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
291 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700292#if (BTA_HOST_INTERLEAVE_SEARCH == TRUE)
293 uint8_t intl_duration[4];/*duration array storing the interleave scan's time portions*/
Matthew Xie7f3e4292013-09-30 12:44:10 -0700294#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800295} tBTA_DM_INQ;
296
297typedef struct
298{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700299 uint8_t bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800300#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
Marie Janssene9e58ce2016-06-17 14:12:17 -0700301 uint8_t bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
302 uint8_t *bta_dm_eir_uuid16; /* 16-bit UUIDs */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800303#else
Marie Janssene9e58ce2016-06-17 14:12:17 -0700304 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 -0800305#endif
Marie Janssene9e58ce2016-06-17 14:12:17 -0700306 int8_t *bta_dm_eir_inq_tx_power; /* Inquiry TX power */
307 uint8_t bta_dm_eir_flag_len; /* length of flags in bytes */
308 uint8_t *bta_dm_eir_flags; /* flags for EIR */
309 uint8_t bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */
310 uint8_t *bta_dm_eir_manufac_spec; /* manufacturer specific */
311 uint8_t bta_dm_eir_additional_len; /* length of additional data in bytes */
312 uint8_t *bta_dm_eir_additional; /* additional data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800313} tBTA_DM_EIR_CONF;
314
Marie Janssene9e58ce2016-06-17 14:12:17 -0700315#if (BLE_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800316/* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */
317#define BTA_BLE_LIMIT_DISC_FLAG BTM_BLE_LIMIT_DISC_FLAG
318#define BTA_BLE_GEN_DISC_FLAG BTM_BLE_GEN_DISC_FLAG
319#define BTA_BLE_BREDR_NOT_SPT BTM_BLE_BREDR_NOT_SPT
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700320#define BTA_BLE_DMT_CONTROLLER_SPT BTM_BLE_DMT_CONTROLLER_SPT
321#define BTA_BLE_DMT_HOST_SPT BTM_BLE_DMT_HOST_SPT
The Android Open Source Project5738f832012-12-12 16:00:35 -0800322#define BTA_BLE_NON_LIMIT_DISC_FLAG BTM_BLE_NON_LIMIT_DISC_FLAG
323#define BTA_BLE_ADV_FLAG_MASK BTM_BLE_ADV_FLAG_MASK
324#define BTA_BLE_LIMIT_DISC_MASK BTM_BLE_LIMIT_DISC_MASK
325
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800326/* ADV data bit mask */
327#define BTA_BLE_AD_BIT_DEV_NAME BTM_BLE_AD_BIT_DEV_NAME
328#define BTA_BLE_AD_BIT_FLAGS BTM_BLE_AD_BIT_FLAGS
329#define BTA_BLE_AD_BIT_MANU BTM_BLE_AD_BIT_MANU
330#define BTA_BLE_AD_BIT_TX_PWR BTM_BLE_AD_BIT_TX_PWR
331#define BTA_BLE_AD_BIT_INT_RANGE BTM_BLE_AD_BIT_INT_RANGE
332#define BTA_BLE_AD_BIT_SERVICE BTM_BLE_AD_BIT_SERVICE
333#define BTA_BLE_AD_BIT_APPEARANCE BTM_BLE_AD_BIT_APPEARANCE
334#define BTA_BLE_AD_BIT_PROPRIETARY BTM_BLE_AD_BIT_PROPRIETARY
335#define BTA_DM_BLE_AD_BIT_SERVICE_SOL BTM_BLE_AD_BIT_SERVICE_SOL
336#define BTA_DM_BLE_AD_BIT_SERVICE_DATA BTM_BLE_AD_BIT_SERVICE_DATA
337#define BTA_DM_BLE_AD_BIT_SIGN_DATA BTM_BLE_AD_BIT_SIGN_DATA
338#define BTA_DM_BLE_AD_BIT_SERVICE_128SOL BTM_BLE_AD_BIT_SERVICE_128SOL
339#define BTA_DM_BLE_AD_BIT_PUBLIC_ADDR BTM_BLE_AD_BIT_PUBLIC_ADDR
340#define BTA_DM_BLE_AD_BIT_RANDOM_ADDR BTM_BLE_AD_BIT_RANDOM_ADDR
Wei Wanga6ce7752014-05-20 06:30:32 +0000341#define BTA_DM_BLE_AD_BIT_SERVICE_128 BTM_BLE_AD_BIT_SERVICE_128 /*128-bit Service UUIDs*/
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800342
Ian Coolidged4c10362015-08-07 20:36:13 -0700343typedef tBTM_BLE_AD_MASK tBTA_BLE_AD_MASK;
344typedef tBTM_BLE_INT_RANGE tBTA_BLE_INT_RANGE;
345typedef tBTM_BLE_SERVICE tBTA_BLE_SERVICE;
346typedef tBTM_BLE_PROP_ELEM tBTA_BLE_PROP_ELEM;
347typedef tBTM_BLE_PROPRIETARY tBTA_BLE_PROPRIETARY;
348typedef tBTM_BLE_MANU tBTA_BLE_MANU;
349typedef tBTM_BLE_SERVICE_DATA tBTA_BLE_SERVICE_DATA;
Wei Wanga6ce7752014-05-20 06:30:32 +0000350typedef tBTM_BLE_128SERVICE tBTA_BLE_128SERVICE;
351typedef tBTM_BLE_32SERVICE tBTA_BLE_32SERVICE;
352
353typedef struct
354{
355 tBTA_BLE_INT_RANGE int_range; /* slave prefered conn interval range */
Ian Coolidged4c10362015-08-07 20:36:13 -0700356 tBTA_BLE_MANU manu; /* manufacturer data */
357 tBTA_BLE_SERVICE services; /* 16 bits services */
358 tBTA_BLE_128SERVICE services_128b; /* 128 bits service */
359 tBTA_BLE_32SERVICE service_32b; /* 32 bits Service UUID */
360 tBTA_BLE_SERVICE sol_services; /* 16 bits services Solicitation UUIDs */
361 tBTA_BLE_32SERVICE sol_service_32b; /* List of 32 bit Service Solicitation UUIDs */
362 tBTA_BLE_128SERVICE sol_service_128b;/* List of 128 bit Service Solicitation UUIDs */
363 tBTA_BLE_PROPRIETARY proprietary; /* proprietary data */
364 tBTA_BLE_SERVICE_DATA service_data; /* service data */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700365 uint16_t appearance; /* appearance data */
366 uint8_t flag;
367 uint8_t tx_power;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800368}tBTA_BLE_ADV_DATA;
369
Wei Wanga6ce7752014-05-20 06:30:32 +0000370typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status);
371
372/* advertising channel map */
373#define BTA_BLE_ADV_CHNL_37 BTM_BLE_ADV_CHNL_37
374#define BTA_BLE_ADV_CHNL_38 BTM_BLE_ADV_CHNL_38
375#define BTA_BLE_ADV_CHNL_39 BTM_BLE_ADV_CHNL_39
376typedef tBTM_BLE_ADV_CHNL_MAP tBTA_BLE_ADV_CHNL_MAP; /* use as a bit mask */
377
378/* advertising filter policy */
379typedef tBTM_BLE_AFP tBTA_BLE_AFP;
380
381/* adv event type */
382#define BTA_BLE_CONNECT_EVT BTM_BLE_CONNECT_EVT /* Connectable undirected advertising */
383#define BTA_BLE_CONNECT_DIR_EVT BTM_BLE_CONNECT_DIR_EVT /* Connectable directed advertising */
384#define BTA_BLE_DISCOVER_EVT BTM_BLE_DISCOVER_EVT /* Scannable undirected advertising */
385#define BTA_BLE_NON_CONNECT_EVT BTM_BLE_NON_CONNECT_EVT /* Non connectable undirected advertising */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700386typedef uint8_t tBTA_BLE_ADV_EVT;
Wei Wanga6ce7752014-05-20 06:30:32 +0000387
388/* adv tx power level */
389#define BTA_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
390#define BTA_BLE_ADV_TX_POWER_LOW 1 /* low tx power */
391#define BTA_BLE_ADV_TX_POWER_MID 2 /* middle tx power */
392#define BTA_BLE_ADV_TX_POWER_UPPER 3 /* upper tx power */
393#define BTA_BLE_ADV_TX_POWER_MAX 4 /* maximum tx power */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700394typedef uint8_t tBTA_BLE_ADV_TX_POWER;
Wei Wanga6ce7752014-05-20 06:30:32 +0000395
396/* advertising instance parameters */
397typedef struct
398{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700399 uint16_t adv_int_min; /* minimum adv interval */
400 uint16_t adv_int_max; /* maximum adv interval */
Wei Wanga6ce7752014-05-20 06:30:32 +0000401 tBTA_BLE_ADV_EVT adv_type; /* adv event type */
402 tBTA_BLE_ADV_CHNL_MAP channel_map; /* adv channel map */
403 tBTA_BLE_AFP adv_filter_policy; /* advertising filter policy */
404 tBTA_BLE_ADV_TX_POWER tx_power; /* adv tx power */
405}tBTA_BLE_ADV_PARAMS;
406
The Android Open Source Project5738f832012-12-12 16:00:35 -0800407/* These are the fields returned in each device adv packet. It
408** is returned in the results callback if registered.
409*/
410typedef struct
411{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700412 uint8_t conn_mode;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800413 tBTA_BLE_AD_MASK ad_mask; /* mask of the valid adv data field */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700414 uint8_t flag;
415 uint8_t tx_power_level;
416 uint8_t remote_name_len;
417 uint8_t *p_remote_name;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800418 tBTA_BLE_SERVICE service;
419} tBTA_BLE_INQ_DATA;
Satya Callojic4e25962014-05-10 23:46:24 -0700420
421enum
422{
Satya Calloji5725fc62015-03-31 13:24:32 -0700423 BTA_BLE_BATCH_SCAN_MODE_PASS = 1,
424 BTA_BLE_BATCH_SCAN_MODE_ACTI = 2,
425 BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3
Satya Callojic4e25962014-05-10 23:46:24 -0700426};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700427typedef uint8_t tBTA_BLE_BATCH_SCAN_MODE;
Satya Callojic4e25962014-05-10 23:46:24 -0700428
429enum
430{
431 BTA_BLE_DISCARD_OLD_ITEMS=0,
432 BTA_BLE_DISCARD_LOWER_RSSI_ITEMS=1
433};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700434typedef uint8_t tBTA_BLE_DISCARD_RULE;
Satya Callojic4e25962014-05-10 23:46:24 -0700435
436enum
437{
438 BTA_BLE_ADV_SEEN_FIRST_TIME=0,
439 BTA_BLE_ADV_TRACKING_TIMEOUT=1
440};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700441typedef uint8_t tBTA_BLE_ADV_CHANGE_REASON;
Satya Callojic4e25962014-05-10 23:46:24 -0700442
443enum
444{
445 BTA_BLE_BATCH_SCAN_ENB_EVT = 1,
446 BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2,
447 BTA_BLE_BATCH_SCAN_DATA_EVT = 3,
448 BTA_BLE_BATCH_SCAN_THRES_EVT = 4,
449 BTA_BLE_BATCH_SCAN_PARAM_EVT = 5,
450 BTA_BLE_BATCH_SCAN_DIS_EVT = 6
451};
452typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
453
454typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800455#endif
456
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800457/* BLE customer specific feature function type definitions */
458/* data type used on customer specific feature for RSSI monitoring */
459#define BTA_BLE_RSSI_ALERT_HI 0
460#define BTA_BLE_RSSI_ALERT_RANGE 1
461#define BTA_BLE_RSSI_ALERT_LO 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700462typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800463
Kim Schulz8372aa52015-03-25 10:39:40 +0100464#define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */
465#define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */
466#define BTA_BLE_RSSI_ALERT_RANGE_BIT BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */
467#define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700468typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_MASK;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800469
470
Marie Janssene9e58ce2016-06-17 14:12:17 -0700471typedef void (tBTA_DM_BLE_RSSI_CBACK) (BD_ADDR bd_addr, tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, int8_t rssi);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800472
473/* max number of filter spot for different filter type */
474#define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */
475#define BTA_DM_BLE_MAX_ADDR_FILTER BTM_BLE_MAX_ADDR_FILTER /* 8 */
476#define BTA_DM_BLE_PF_STR_COND_MAX BTM_BLE_PF_STR_COND_MAX /* 4 apply to manu data , or local name */
Kim Schulz8372aa52015-03-25 10:39:40 +0100477#define BTA_DM_BLE_PF_STR_LEN_MAX BTM_BLE_PF_STR_LEN_MAX /* match for first 20 bytes */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800478
479#define BTA_DM_BLE_PF_LOGIC_OR 0
480#define BTA_DM_BLE_PF_LOGIC_AND 1
Marie Janssene9e58ce2016-06-17 14:12:17 -0700481typedef uint8_t tBTA_DM_BLE_PF_LOGIC_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800482
483enum
484{
485 BTA_DM_BLE_SCAN_COND_ADD,
486 BTA_DM_BLE_SCAN_COND_DELETE,
487 BTA_DM_BLE_SCAN_COND_CLEAR = 2
488};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700489typedef uint8_t tBTA_DM_BLE_SCAN_COND_OP;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800490
Satya Calloji1a9247a2014-06-05 13:15:15 -0700491/* ADV payload filtering vendor specific call event */
492enum
493{
494 BTA_BLE_SCAN_PF_ENABLE_EVT = 7,
495 BTA_BLE_SCAN_PF_COND_EVT
496};
497
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800498/* filter selection bit index */
499#define BTA_DM_BLE_PF_ADDR_FILTER BTM_BLE_PF_ADDR_FILTER
Andre Eisenbachb203d472013-11-20 17:23:06 -0800500#define BTA_DM_BLE_PF_SRVC_DATA BTM_BLE_PF_SRVC_DATA
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800501#define BTA_DM_BLE_PF_SRVC_UUID BTM_BLE_PF_SRVC_UUID
502#define BTA_DM_BLE_PF_SRVC_SOL_UUID BTM_BLE_PF_SRVC_SOL_UUID
503#define BTA_DM_BLE_PF_LOCAL_NAME BTM_BLE_PF_LOCAL_NAME
504#define BTA_DM_BLE_PF_MANU_DATA BTM_BLE_PF_MANU_DATA
Andre Eisenbachb203d472013-11-20 17:23:06 -0800505#define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN
Andre Eisenbach3aa60542013-03-22 18:00:51 -0700506#define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700507#define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX
Marie Janssene9e58ce2016-06-17 14:12:17 -0700508typedef uint8_t tBTA_DM_BLE_PF_COND_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800509
Andre Eisenbachb203d472013-11-20 17:23:06 -0800510typedef union
511{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700512 uint16_t uuid16_mask;
513 uint32_t uuid32_mask;
514 uint8_t uuid128_mask[LEN_UUID_128];
Andre Eisenbachb203d472013-11-20 17:23:06 -0800515}tBTA_DM_BLE_PF_COND_MASK;
516
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800517typedef struct
518{
519 tBLE_BD_ADDR *p_target_addr; /* target address, if NULL, generic UUID filter */
520 tBT_UUID uuid; /* UUID condition */
521 tBTA_DM_BLE_PF_LOGIC_TYPE cond_logic; /* AND/OR */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800522 tBTA_DM_BLE_PF_COND_MASK *p_uuid_mask; /* UUID condition mask, if NULL, match exact as UUID condition */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800523}tBTA_DM_BLE_PF_UUID_COND;
524
525typedef struct
526{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700527 uint8_t data_len; /* <= 20 bytes */
528 uint8_t *p_data;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800529}tBTA_DM_BLE_PF_LOCAL_NAME_COND;
530
531typedef struct
532{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700533 uint16_t company_id; /* company ID */
534 uint8_t data_len; /* <= 20 bytes */
535 uint8_t *p_pattern;
536 uint16_t company_id_mask; /* UUID value mask */
537 uint8_t *p_pattern_mask; /* Manufacturer data matching mask, same length
Satya Callojic4e25962014-05-10 23:46:24 -0700538 as data pattern, set to all 0xff, match exact data */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800539}tBTA_DM_BLE_PF_MANU_COND;
540
Andre Eisenbachb203d472013-11-20 17:23:06 -0800541typedef struct
542{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700543 uint16_t uuid; /* service ID */
544 uint8_t data_len; /* <= 20 bytes */
545 uint8_t *p_pattern;
546 uint8_t *p_pattern_mask; /* Service data matching mask, same length
Satya Calloji1a9247a2014-06-05 13:15:15 -0700547 as data pattern, set to all 0xff, match exact data */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800548}tBTA_DM_BLE_PF_SRVC_PATTERN_COND;
549
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800550typedef union
551{
552 tBLE_BD_ADDR target_addr;
553 tBTA_DM_BLE_PF_LOCAL_NAME_COND local_name; /* lcoal name filtering */
554 tBTA_DM_BLE_PF_MANU_COND manu_data; /* manufactuer data filtering */
555 tBTA_DM_BLE_PF_UUID_COND srvc_uuid; /* service UUID filtering */
556 tBTA_DM_BLE_PF_UUID_COND solicitate_uuid; /* solicitated service UUID filtering */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800557 tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800558}tBTA_DM_BLE_PF_COND_PARAM;
559
Marie Janssene9e58ce2016-06-17 14:12:17 -0700560typedef uint8_t tBTA_DM_BLE_PF_FILT_INDEX;
561typedef uint8_t tBTA_DM_BLE_PF_AVBL_SPACE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700562
Marie Janssene9e58ce2016-06-17 14:12:17 -0700563typedef int8_t tBTA_DM_RSSI_VALUE;
564typedef uint8_t tBTA_DM_LINK_QUALITY_VALUE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800565
566
Marie Janssene9e58ce2016-06-17 14:12:17 -0700567typedef uint8_t tBTA_SIG_STRENGTH_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800568
569
570/* Security Callback Events */
571#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
572#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
573#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
574#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
575#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
576#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
577#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
578#define BTA_DM_SIG_STRENGTH_EVT 7 /* Signal strength for bluetooth connection */
579#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
580#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
581#define BTA_DM_SP_CFM_REQ_EVT 10 /* Simple Pairing User Confirmation request. */
582#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
583#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
584#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
585#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
586#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
587#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
588#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
589#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
590#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
591#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
592#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
Satya Calloji444a8da2015-03-06 10:38:22 -0800593#define BTA_DM_BLE_NC_REQ_EVT 22 /* SMP Numeric Comparison request event */
Satya Calloji444a8da2015-03-06 10:38:22 -0800594#define BTA_DM_SP_RMT_OOB_EXT_EVT 23 /* Simple Pairing Remote OOB Extended Data request. */
595#define BTA_DM_BLE_AUTH_CMPL_EVT 24 /* BLE Auth complete */
Satya Calloji444a8da2015-03-06 10:38:22 -0800596#define BTA_DM_DEV_UNPAIRED_EVT 25
597#define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */
598#define BTA_DM_LE_FEATURES_READ 27 /* Cotroller specific LE features are read */
599#define BTA_DM_ENER_INFO_READ 28 /* Energy info read */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700600typedef uint8_t tBTA_DM_SEC_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800601
602/* Structure associated with BTA_DM_ENABLE_EVT */
603typedef struct
604{
The Android Open Source Project5738f832012-12-12 16:00:35 -0800605 tBTA_STATUS status;
606} tBTA_DM_ENABLE;
607
608/* Structure associated with BTA_DM_PIN_REQ_EVT */
609typedef struct
610{
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700611 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800612 BD_ADDR bd_addr; /* BD address peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800613 DEV_CLASS dev_class; /* Class of Device */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800614 BD_NAME bd_name; /* Name of peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700615 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 -0800616} tBTA_DM_PIN_REQ;
617
618/* BLE related definition */
619
620#define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10)
621#define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x))
622#define BTA_DM_AUTH_SMP_PASSKEY_FAIL BTA_DM_AUTH_CONVERT_SMP_CODE (SMP_PASSKEY_ENTRY_FAIL)
623#define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL)
624#define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL)
625#define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR)
626#define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT)
627#define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE)
628#define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD)
629#define BTA_DM_AUTH_SMP_UNKNOWN_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN)
630#define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS)
Satya Calloji444a8da2015-03-06 10:38:22 -0800631#define BTA_DM_AUTH_SMP_INVALID_PARAMETERS (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_PARAMETERS)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800632#define BTA_DM_AUTH_SMP_INTERNAL_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR)
633#define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP)
634#define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL)
635#define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL)
636#define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY)
637#define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL)
638#define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT)
639
640/* connection parameter boundary value and dummy value */
641#define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN
642#define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX
643#define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN
644#define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX
645#define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN
646#define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX
647#define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX
648#define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN
649#define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX
650#define BTA_DM_BLE_CONN_PARAM_UNDEF BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be overwritten */
651
652
653#define BTA_LE_KEY_PENC BTM_LE_KEY_PENC /* encryption information of peer device */
654#define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */
655#define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */
656#define BTA_LE_KEY_LENC BTM_LE_KEY_LENC /* master role security information:div */
657#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
658#define BTA_LE_KEY_LCSRK BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700659typedef uint8_t tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800660
661
662typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS ;
663typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS;
664typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS ;
665typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS ;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800666typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS ;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800667
668typedef union
669{
670 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */
671 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800672 tBTA_LE_PID_KEYS pid_key; /* peer device ID key */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800673 tBTA_LE_LENC_KEYS lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/
674 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/
Satya Calloji444a8da2015-03-06 10:38:22 -0800675 tBTA_LE_PID_KEYS lid_key; /* local device ID key for the particular remote */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800676}tBTA_LE_KEY_VALUE;
677
678#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
679#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700680typedef uint8_t tBTA_DM_BLE_LOCAL_KEY_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800681
682typedef struct
683{
684 BT_OCTET16 ir;
685 BT_OCTET16 irk;
686 BT_OCTET16 dhk;
687}tBTA_BLE_LOCAL_ID_KEYS;
688
689#define BTA_DM_SEC_GRANTED BTA_SUCCESS
690#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
691#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
Marie Janssene9e58ce2016-06-17 14:12:17 -0700692typedef uint8_t tBTA_DM_BLE_SEC_GRANT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800693
694
695#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
696#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
697#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
Marie Janssene9e58ce2016-06-17 14:12:17 -0700698typedef uint8_t tBTA_DM_BLE_CONN_TYPE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800699
Marie Janssene9e58ce2016-06-17 14:12:17 -0700700typedef 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 -0800701
702/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
703typedef struct
704{
705 BD_ADDR bd_addr; /* peer address */
706 BD_NAME bd_name; /* peer device name */
707} tBTA_DM_BLE_SEC_REQ;
708
709typedef struct
710{
711 BD_ADDR bd_addr; /* peer address */
712 tBTM_LE_KEY_TYPE key_type;
Satya Calloji444a8da2015-03-06 10:38:22 -0800713 tBTM_LE_KEY_VALUE *p_key_value;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800714}tBTA_DM_BLE_KEY;
715
716/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
717typedef struct
718{
719 BD_ADDR bd_addr; /* BD address peer device. */
720 BD_NAME bd_name; /* Name of peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700721 bool key_present; /* Valid link key value in key element */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800722 LINK_KEY key; /* Link key associated with peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700723 uint8_t key_type; /* The type of Link Key */
724 bool success; /* true of authentication succeeded, false if failed. */
725 uint8_t fail_reason; /* The HCI reason/error code for when success=false */
Andre Eisenbach77668212015-05-06 21:49:35 -0700726 tBLE_ADDR_TYPE addr_type; /* Peer device address type */
Chaojing Sune2805532015-04-22 13:40:21 -0700727 tBT_DEVICE_TYPE dev_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800728} tBTA_DM_AUTH_CMPL;
729
730
731/* Structure associated with BTA_DM_AUTHORIZE_EVT */
732typedef struct
733{
734 BD_ADDR bd_addr; /* BD address peer device. */
735 BD_NAME bd_name; /* Name of peer device. */
736 tBTA_SERVICE_ID service; /* Service ID to authorize. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800737 DEV_CLASS dev_class;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800738} tBTA_DM_AUTHORIZE;
739
740/* Structure associated with BTA_DM_LINK_UP_EVT */
741typedef struct
742{
743 BD_ADDR bd_addr; /* BD address peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700744#if (BLE_INCLUDED == TRUE)
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700745 tBTA_TRANSPORT link_type;
746#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800747} tBTA_DM_LINK_UP;
748
749/* Structure associated with BTA_DM_LINK_DOWN_EVT */
750typedef struct
751{
752 BD_ADDR bd_addr; /* BD address peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700753 uint8_t status; /* connection open/closed */
754 bool is_removed; /* true if device is removed when link is down */
755#if (BLE_INCLUDED == TRUE)
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700756 tBTA_TRANSPORT link_type;
757#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800758} tBTA_DM_LINK_DOWN;
759
760/* Structure associated with BTA_DM_ROLE_CHG_EVT */
761typedef struct
762{
763 BD_ADDR bd_addr; /* BD address peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700764 uint8_t new_role; /* the new connection role */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800765} tBTA_DM_ROLE_CHG;
766
The Android Open Source Project5738f832012-12-12 16:00:35 -0800767/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
768typedef struct
769{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700770 uint8_t level; /* when paging or inquiring, level is 10.
The Android Open Source Project5738f832012-12-12 16:00:35 -0800771 Otherwise, the number of ACL links */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700772 uint8_t level_flags; /* indicates individual flags */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800773} tBTA_DM_BUSY_LEVEL;
774
Satya Calloji444a8da2015-03-06 10:38:22 -0800775#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
776#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
777#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
778#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700779#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
Satya Calloji444a8da2015-03-06 10:38:22 -0800780#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
781#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800782typedef tBTM_IO_CAP tBTA_IO_CAP;
783
784#define BTA_AUTH_SP_NO BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single Profile/non-bonding
785 Numeric comparison with automatic accept allowed */
786#define BTA_AUTH_SP_YES BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding
787 Use IO Capabilities to determine authentication procedure */
788#define BTA_AUTH_AP_NO BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated bonding
789 Numeric comparison with automatic accept allowed */
790#define BTA_AUTH_AP_YES BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated bonding
791 Use IO Capabilities to determine authentication procedure */
792#define BTA_AUTH_SPGB_NO BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general bonding
793 Numeric comparison with automatic accept allowed */
794#define BTA_AUTH_SPGB_YES BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general bonding
795 Use IO Capabilities to determine authentication procedure */
796typedef tBTM_AUTH_REQ tBTA_AUTH_REQ;
797
798#define BTA_AUTH_DD_BOND BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */
799#define BTA_AUTH_GEN_BOND BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */
800#define BTA_AUTH_BONDS BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */
801
802#define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/
803#define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */
804#define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */
Satya Calloji444a8da2015-03-06 10:38:22 -0800805
806#define BTA_LE_AUTH_REQ_SC_ONLY BTM_LE_AUTH_REQ_SC_ONLY /* 1 << 3 */
807#define BTA_LE_AUTH_REQ_SC_BOND BTM_LE_AUTH_REQ_SC_BOND /* 1001 */
808#define BTA_LE_AUTH_REQ_SC_MITM BTM_LE_AUTH_REQ_SC_MITM /* 1100 */
809#define BTA_LE_AUTH_REQ_SC_MITM_BOND BTM_LE_AUTH_REQ_SC_MITM_BOND /* 1101 */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800810typedef tBTM_LE_AUTH_REQ tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */
811
812#define BTA_OOB_NONE BTM_OOB_NONE
813#define BTA_OOB_PRESENT BTM_OOB_PRESENT
The Android Open Source Project5738f832012-12-12 16:00:35 -0800814#define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN
Jakub Pawlowski175da702015-11-12 15:00:58 -0800815
The Android Open Source Project5738f832012-12-12 16:00:35 -0800816typedef tBTM_OOB_DATA tBTA_OOB_DATA;
817
818/* Structure associated with BTA_DM_SP_CFM_REQ_EVT */
819typedef struct
820{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800821 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800822 BD_ADDR bd_addr; /* peer address */
823 DEV_CLASS dev_class; /* peer CoD */
824 BD_NAME bd_name; /* peer device name */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700825 uint32_t num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */
826 bool just_works; /* true, if "Just Works" association model */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800827 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
828 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
829 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
830 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */
831} tBTA_DM_SP_CFM_REQ;
832
833enum
834{
835 BTA_SP_KEY_STARTED, /* passkey entry started */
836 BTA_SP_KEY_ENTERED, /* passkey digit entered */
837 BTA_SP_KEY_ERASED, /* passkey digit erased */
838 BTA_SP_KEY_CLEARED, /* passkey cleared */
839 BTA_SP_KEY_COMPLT /* passkey entry completed */
840};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700841typedef uint8_t tBTA_SP_KEY_TYPE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800842
843/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
844typedef struct
845{
846 BD_ADDR bd_addr; /* peer address */
847 tBTA_SP_KEY_TYPE notif_type;
848}tBTA_DM_SP_KEY_PRESS;
849
850/* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */
851typedef struct
852{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800853 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800854 BD_ADDR bd_addr; /* peer address */
855 DEV_CLASS dev_class; /* peer CoD */
856 BD_NAME bd_name; /* peer device name */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700857 uint32_t passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800858} tBTA_DM_SP_KEY_NOTIF;
859
860/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
861typedef struct
862{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800863 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800864 BD_ADDR bd_addr; /* peer address */
865 DEV_CLASS dev_class; /* peer CoD */
866 BD_NAME bd_name; /* peer device name */
867} tBTA_DM_SP_RMT_OOB;
868
869/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
870typedef struct
871{
Marie Janssene9e58ce2016-06-17 14:12:17 -0700872 tBTA_STATUS result; /* true of bond cancel succeeded, false if failed. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800873} tBTA_DM_BOND_CANCEL_CMPL;
874
875/* Union of all security callback structures */
876typedef union
877{
878 tBTA_DM_ENABLE enable; /* BTA enabled */
879 tBTA_DM_PIN_REQ pin_req; /* PIN request. */
880 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */
881 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */
882 tBTA_DM_LINK_UP link_up; /* ACL connection down event */
883 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800884 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
885 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */
886 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */
887 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */
888 tBTA_DM_BOND_CANCEL_CMPL bond_cancel_cmpl; /* Bond Cancel Complete indication */
889 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */
890 tBTA_DM_ROLE_CHG role_chg; /* role change event */
891 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */
892 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */
893 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */
894 BT_OCTET16 ble_er; /* ER event data */
895} tBTA_DM_SEC;
896
897/* Security callback */
898typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
899
Wei Wanga6ce7752014-05-20 06:30:32 +0000900#define BTA_BLE_MULTI_ADV_ILLEGAL 0
901
902/* multi adv callback event */
903#define BTA_BLE_MULTI_ADV_ENB_EVT 1
904#define BTA_BLE_MULTI_ADV_DISABLE_EVT 2
905#define BTA_BLE_MULTI_ADV_PARAM_EVT 3
906#define BTA_BLE_MULTI_ADV_DATA_EVT 4
907
Marie Janssene9e58ce2016-06-17 14:12:17 -0700908typedef uint8_t tBTA_BLE_MULTI_ADV_EVT;
Wei Wanga6ce7752014-05-20 06:30:32 +0000909
910/* multi adv callback */
911typedef void (tBTA_BLE_MULTI_ADV_CBACK)(tBTA_BLE_MULTI_ADV_EVT event,
Marie Janssene9e58ce2016-06-17 14:12:17 -0700912 uint8_t inst_id, void *p_ref, tBTA_STATUS status);
913typedef uint32_t tBTA_DM_BLE_REF_VALUE;
Wei Wanga6ce7752014-05-20 06:30:32 +0000914
Satya Calloji1a9247a2014-06-05 13:15:15 -0700915#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
916#define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG
Marie Janssene9e58ce2016-06-17 14:12:17 -0700917typedef uint8_t tBTA_DM_BLE_PF_EVT;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700918
Satya Calloji1a9247a2014-06-05 13:15:15 -0700919#define BTA_DM_BLE_PF_ENABLE 1
920#define BTA_DM_BLE_PF_CONFIG 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700921typedef uint8_t tBTA_DM_BLE_PF_ACTION;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700922
Satya Calloji1a9247a2014-06-05 13:15:15 -0700923/* Config callback */
924typedef void (tBTA_DM_BLE_PF_CFG_CBACK) (tBTA_DM_BLE_PF_ACTION action,
925 tBTA_DM_BLE_PF_COND_TYPE cfg_cond,
926 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, tBTA_STATUS status,
927 tBTA_DM_BLE_REF_VALUE ref_value);
928/* Param callback */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700929typedef void (tBTA_DM_BLE_PF_PARAM_CBACK) (uint8_t action_type, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
Satya Calloji1a9247a2014-06-05 13:15:15 -0700930 tBTA_DM_BLE_REF_VALUE ref_value, tBTA_STATUS status);
931
932/* Status callback */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700933typedef void (tBTA_DM_BLE_PF_STATUS_CBACK) (uint8_t action, tBTA_STATUS status,
Satya Callojie5ba8842014-07-03 17:18:02 -0700934 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700935
936
937#define BTA_DM_BLE_PF_BRDCAST_ADDR_FILT 1
938#define BTA_DM_BLE_PF_SERV_DATA_CHG_FILT 2
939#define BTA_DM_BLE_PF_SERV_UUID 4
940#define BTA_DM_BLE_PF_SERV_SOLC_UUID 8
941#define BTA_DM_BLE_PF_LOC_NAME_CHECK 16
942#define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32
943#define BTA_DM_BLE_PF_SERV_DATA_CHECK 64
Marie Janssene9e58ce2016-06-17 14:12:17 -0700944typedef uint16_t tBTA_DM_BLE_PF_FEAT_SEL;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700945
946#define BTA_DM_BLE_PF_LIST_LOGIC_OR 1
947#define BTA_DM_BLE_PF_LIST_LOGIC_AND 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700948typedef uint16_t tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700949
950#define BTA_DM_BLE_PF_FILT_LOGIC_OR 0
951#define BTA_DM_BLE_PF_FILT_LOGIC_AND 1
Marie Janssene9e58ce2016-06-17 14:12:17 -0700952typedef uint16_t tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700953
Marie Janssene9e58ce2016-06-17 14:12:17 -0700954typedef uint8_t tBTA_DM_BLE_PF_RSSI_THRESHOLD;
955typedef uint8_t tBTA_DM_BLE_PF_DELIVERY_MODE;
956typedef uint16_t tBTA_DM_BLE_PF_TIMEOUT;
957typedef uint8_t tBTA_DM_BLE_PF_TIMEOUT_CNT;
958typedef uint16_t tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700959
960typedef struct
961{
962 tBTA_DM_BLE_PF_FEAT_SEL feat_seln;
963 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE list_logic_type;
964 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE filt_logic_type;
965 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_high_thres;
966 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_low_thres;
967 tBTA_DM_BLE_PF_DELIVERY_MODE dely_mode;
968 tBTA_DM_BLE_PF_TIMEOUT found_timeout;
969 tBTA_DM_BLE_PF_TIMEOUT lost_timeout;
970 tBTA_DM_BLE_PF_TIMEOUT_CNT found_timeout_cnt;
Satya Callojif5387072015-02-09 17:40:52 -0800971 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES num_of_tracking_entries;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700972} tBTA_DM_BLE_PF_FILT_PARAMS;
973
The Android Open Source Project5738f832012-12-12 16:00:35 -0800974/* Search callback events */
975#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
976#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
977#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
978#define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based servoce on a peer device. */
979#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
980#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
981#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
982
Marie Janssene9e58ce2016-06-17 14:12:17 -0700983typedef uint8_t tBTA_DM_SEARCH_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800984
985#define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
986
987/* Structure associated with BTA_DM_INQ_RES_EVT */
988typedef struct
989{
990 BD_ADDR bd_addr; /* BD address peer device. */
991 DEV_CLASS dev_class; /* Device class of peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700992 bool remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800993 /* If the device name is known to application BTA skips the remote name request */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700994 bool is_limited; /* true, if the limited inquiry bit is set in the CoD */
995 int8_t rssi; /* The rssi value */
996 uint8_t *p_eir; /* received EIR */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800997#if (BLE_INCLUDED == TRUE)
Marie Janssene9e58ce2016-06-17 14:12:17 -0700998 uint8_t inq_result_type;
999 uint8_t ble_addr_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001000 tBTM_BLE_EVT_TYPE ble_evt_type;
1001 tBT_DEVICE_TYPE device_type;
Marie Janssene9e58ce2016-06-17 14:12:17 -07001002 uint8_t flag;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001003#endif
1004
1005} tBTA_DM_INQ_RES;
1006
1007/* Structure associated with BTA_DM_INQ_CMPL_EVT */
1008typedef struct
1009{
Marie Janssene9e58ce2016-06-17 14:12:17 -07001010 uint8_t num_resps; /* Number of inquiry responses. */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001011} tBTA_DM_INQ_CMPL;
1012
1013/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
1014typedef struct
1015{
1016 BD_ADDR bd_addr; /* BD address peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -07001017 uint8_t num_record; /* Number of DI record */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001018 tBTA_STATUS result;
1019} tBTA_DM_DI_DISC_CMPL;
1020
1021/* Structure associated with BTA_DM_DISC_RES_EVT */
1022typedef struct
1023{
1024 BD_ADDR bd_addr; /* BD address peer device. */
1025 BD_NAME bd_name; /* Name of peer device. */
1026 tBTA_SERVICE_MASK services; /* Services found on peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -07001027 uint8_t * p_raw_data; /* Raw data for discovery DB */
1028 uint32_t raw_data_size; /* size of raw data */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001029 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
Marie Janssene9e58ce2016-06-17 14:12:17 -07001030 uint32_t num_uuids;
1031 uint8_t *p_uuid_list;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001032 tBTA_STATUS result;
1033} tBTA_DM_DISC_RES;
1034
1035/* Structure associated with tBTA_DM_DISC_BLE_RES */
1036typedef struct
1037{
1038 BD_ADDR bd_addr; /* BD address peer device. */
1039 BD_NAME bd_name; /* Name of peer device. */
1040 tBT_UUID service; /* GATT based Services UUID found on peer device. */
1041} tBTA_DM_DISC_BLE_RES;
1042
1043
1044/* Union of all search callback structures */
1045typedef union
1046{
1047 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
1048 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
1049 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
1050 tBTA_DM_DISC_BLE_RES disc_ble_res; /* discovery result for GATT based service */
1051 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
1052
1053} tBTA_DM_SEARCH;
1054
1055/* Search callback */
1056typedef void (tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data);
1057
1058/* Execute call back */
1059typedef void (tBTA_DM_EXEC_CBACK) (void * p_param);
1060
1061/* Encryption callback*/
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001062typedef void (tBTA_DM_ENCRYPT_CBACK) (BD_ADDR bd_addr, tBTA_TRANSPORT transport, tBTA_STATUS result);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001063
The Android Open Source Project5738f832012-12-12 16:00:35 -08001064#define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE
1065#define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT
1066#define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM
1067#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
1068typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
Satya Callojic4e25962014-05-10 23:46:24 -07001069
Marie Janssene9e58ce2016-06-17 14:12:17 -07001070#if (BLE_INCLUDED == TRUE)
Satya Callojie5ba8842014-07-03 17:18:02 -07001071typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
1072typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
1073typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
1074typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED;
1075
1076#define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */
1077#define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */
1078#define BTA_DM_CONTRL_SCAN 2 /* Scan state - paging/inquiry/trying to connect*/
1079#define BTA_DM_CONTRL_IDLE 3 /* Idle state - page scan, LE advt, inquiry scan */
1080
Marie Janssene9e58ce2016-06-17 14:12:17 -07001081typedef uint8_t tBTA_DM_CONTRL_STATE;
Satya Callojie5ba8842014-07-03 17:18:02 -07001082
Marie Janssene9e58ce2016-06-17 14:12:17 -07001083typedef uint8_t tBTA_DM_BLE_ADV_STATE;
1084typedef uint8_t tBTA_DM_BLE_ADV_INFO_PRESENT;
1085typedef uint8_t tBTA_DM_BLE_RSSI_VALUE;
1086typedef uint16_t tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
Satya Callojif5387072015-02-09 17:40:52 -08001087
1088typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA;
Satya Callojie5ba8842014-07-03 17:18:02 -07001089
Satya Callojic4e25962014-05-10 23:46:24 -07001090typedef void (tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojie5ba8842014-07-03 17:18:02 -07001091
Marie Janssene9e58ce2016-06-17 14:12:17 -07001092typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, uint8_t report_format,
1093 uint8_t num_records, uint16_t data_len,
1094 uint8_t* p_rep_data, tBTA_STATUS status);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001095
Satya Callojie5ba8842014-07-03 17:18:02 -07001096typedef void (tBTA_BLE_SCAN_SETUP_CBACK) (tBTA_BLE_BATCH_SCAN_EVT evt,
1097 tBTA_DM_BLE_REF_VALUE ref_value,
Satya Callojic4e25962014-05-10 23:46:24 -07001098 tBTA_STATUS status);
1099
Satya Calloji1acb61c2014-06-14 23:16:18 -07001100typedef void (tBTA_BLE_TRACK_ADV_CMPL_CBACK)(int action, tBTA_STATUS status,
Satya Callojie5ba8842014-07-03 17:18:02 -07001101 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
1102 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001103
Satya Callojif5387072015-02-09 17:40:52 -08001104typedef void (tBTA_BLE_TRACK_ADV_CBACK)(tBTA_DM_BLE_TRACK_ADV_DATA *p_adv_data);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001105
Satya Callojie5ba8842014-07-03 17:18:02 -07001106typedef void (tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
1107 tBTA_DM_BLE_RX_TIME_MS rx_time,
1108 tBTA_DM_BLE_IDLE_TIME_MS idle_time,
1109 tBTA_DM_BLE_ENERGY_USED energy_used,
1110 tBTA_DM_CONTRL_STATE ctrl_state,
1111 tBTA_STATUS status);
1112
The Android Open Source Project5738f832012-12-12 16:00:35 -08001113#else
Marie Janssene9e58ce2016-06-17 14:12:17 -07001114typedef uint8_t tBTA_DM_BLE_SEC_ACT;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001115#endif
1116
1117/* Maximum service name length */
1118#define BTA_SERVICE_NAME_LEN 35
1119#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
1120#define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN
1121
1122
1123/* link policy masks */
1124#define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH
1125#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
1126#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
1127#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
Marie Janssene9e58ce2016-06-17 14:12:17 -07001128typedef uint16_t tBTA_DM_LP_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001129
1130/* power mode actions */
1131#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
1132#define BTA_DM_PM_PARK 0x10 /* prefers park mode */
1133#define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */
1134#define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */
1135#define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */
1136#define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */
1137#define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */
1138#define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */
1139#define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */
1140#define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */
1141#define BTA_DM_PM_SNIFF_USER0 0x28 /* prefers user-defined sniff0 mode (testtool only) */
1142#define BTA_DM_PM_SNIFF_USER1 0x29 /* prefers user-defined sniff1 mode (testtool only) */
1143#define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */
1144#define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -07001145#define BTA_DM_PM_SUSPEND 0x04 /* prefers suspend mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001146#define BTA_DM_PM_NO_PREF 0x01 /* service has no prefernce on power mode setting. eg. connection to service got closed */
1147
Marie Janssene9e58ce2016-06-17 14:12:17 -07001148typedef uint8_t tBTA_DM_PM_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001149
1150/* index to bta_dm_ssr_spec */
1151#define BTA_DM_PM_SSR0 0
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001152#define BTA_DM_PM_SSR1 1 /* BTA_DM_PM_SSR1 will be dedicated for
1153 HH SSR setting entry, no other profile can use it */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001154#define BTA_DM_PM_SSR2 2
1155#define BTA_DM_PM_SSR3 3
1156#define BTA_DM_PM_SSR4 4
1157#define BTA_DM_PM_SSR5 5
1158#define BTA_DM_PM_SSR6 6
1159
1160#define BTA_DM_PM_NUM_EVTS 9
1161
1162#ifndef BTA_DM_PM_PARK_IDX
1163#define BTA_DM_PM_PARK_IDX 5 /* the actual index to bta_dm_pm_md[] for PARK mode */
1164#endif
1165
Adam Hampson63399d92014-05-19 16:23:45 -07001166#ifndef BTA_DM_PM_SNIFF_A2DP_IDX
1167#define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF
1168#endif
1169
1170#ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX
1171#define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF2
1172#endif
1173
1174#ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX
1175#define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3
1176#endif
1177
1178#ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX
1179#define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF4
1180#endif
1181
1182#ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX
1183#define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF2
1184#endif
1185
1186#ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX
1187#define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF2
1188#endif
1189
1190#ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX
1191#define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF2
1192#endif
1193
1194
1195#ifndef BTA_DM_PM_HH_OPEN_DELAY
1196#define BTA_DM_PM_HH_OPEN_DELAY 30000
1197#endif
1198
1199#ifndef BTA_DM_PM_HH_ACTIVE_DELAY
1200#define BTA_DM_PM_HH_ACTIVE_DELAY 30000
1201#endif
1202
1203#ifndef BTA_DM_PM_HH_IDLE_DELAY
1204#define BTA_DM_PM_HH_IDLE_DELAY 30000
1205#endif
1206
1207/* The Sniff Parameters defined below must be ordered from highest
1208 * latency (biggest interval) to lowest latency. If there is a conflict
1209 * among the connected services the setting with the lowest latency will
1210 * be selected. If a device should override a sniff parameter then it
1211 * must insure that order is maintained.
1212 */
1213#ifndef BTA_DM_PM_SNIFF_MAX
1214#define BTA_DM_PM_SNIFF_MAX 800
1215#define BTA_DM_PM_SNIFF_MIN 400
1216#define BTA_DM_PM_SNIFF_ATTEMPT 4
1217#define BTA_DM_PM_SNIFF_TIMEOUT 1
1218#endif
1219
1220#ifndef BTA_DM_PM_SNIFF1_MAX
1221#define BTA_DM_PM_SNIFF1_MAX 400
1222#define BTA_DM_PM_SNIFF1_MIN 200
1223#define BTA_DM_PM_SNIFF1_ATTEMPT 4
1224#define BTA_DM_PM_SNIFF1_TIMEOUT 1
1225#endif
1226
1227#ifndef BTA_DM_PM_SNIFF2_MAX
1228#define BTA_DM_PM_SNIFF2_MAX 180
1229#define BTA_DM_PM_SNIFF2_MIN 150
1230#define BTA_DM_PM_SNIFF2_ATTEMPT 4
1231#define BTA_DM_PM_SNIFF2_TIMEOUT 1
1232#endif
1233
1234#ifndef BTA_DM_PM_SNIFF3_MAX
1235#define BTA_DM_PM_SNIFF3_MAX 150
1236#define BTA_DM_PM_SNIFF3_MIN 50
1237#define BTA_DM_PM_SNIFF3_ATTEMPT 4
1238#define BTA_DM_PM_SNIFF3_TIMEOUT 1
1239#endif
1240
1241#ifndef BTA_DM_PM_SNIFF4_MAX
1242#define BTA_DM_PM_SNIFF4_MAX 54
1243#define BTA_DM_PM_SNIFF4_MIN 30
1244#define BTA_DM_PM_SNIFF4_ATTEMPT 4
1245#define BTA_DM_PM_SNIFF4_TIMEOUT 1
1246#endif
1247
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -07001248#ifndef BTA_DM_PM_SNIFF5_MAX
1249#define BTA_DM_PM_SNIFF5_MAX 36
1250#define BTA_DM_PM_SNIFF5_MIN 30
1251#define BTA_DM_PM_SNIFF5_ATTEMPT 2
1252#define BTA_DM_PM_SNIFF5_TIMEOUT 0
1253#endif
1254
Adam Hampson63399d92014-05-19 16:23:45 -07001255#ifndef BTA_DM_PM_PARK_MAX
1256#define BTA_DM_PM_PARK_MAX 800
1257#define BTA_DM_PM_PARK_MIN 400
1258#define BTA_DM_PM_PARK_ATTEMPT 0
1259#define BTA_DM_PM_PARK_TIMEOUT 0
1260#endif
1261
1262
The Android Open Source Project5738f832012-12-12 16:00:35 -08001263/* Switch callback events */
1264#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
1265
Marie Janssene9e58ce2016-06-17 14:12:17 -07001266typedef uint8_t tBTA_DM_SWITCH_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001267typedef void (tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, tBTA_STATUS status);
1268
1269/* Audio routing out configuration */
1270#define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */
1271#define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */
1272#define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */
1273#define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */
1274#define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */
1275#define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */
1276#define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */
1277#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
1278#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
1279
Marie Janssene9e58ce2016-06-17 14:12:17 -07001280typedef uint8_t tBTA_DM_ROUTE_PATH;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001281
1282
1283/* Device Identification (DI) data structure
1284*/
1285/* Used to set the DI record */
1286typedef tSDP_DI_RECORD tBTA_DI_RECORD;
1287/* Used to get the DI record */
1288typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD;
1289/* SDP discovery database */
1290typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB;
1291
1292#ifndef BTA_DI_NUM_MAX
1293#define BTA_DI_NUM_MAX 3
1294#endif
1295
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001296/* Device features mask definitions */
1297#define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE
1298#define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001299/* ACL type
1300*/
1301#define BTA_DM_LINK_TYPE_BR_EDR 0x01
1302#define BTA_DM_LINK_TYPE_LE 0x02
1303#define BTA_DM_LINK_TYPE_ALL 0xFF
Marie Janssene9e58ce2016-06-17 14:12:17 -07001304typedef uint8_t tBTA_DM_LINK_TYPE;
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001305
Satya Calloji6e2d9db2014-07-08 16:18:58 -07001306#define IMMEDIATE_DELY_MODE 0x00
1307#define ONFOUND_DELY_MODE 0x01
1308#define BATCH_DELY_MODE 0x02
1309#define ALLOW_ALL_FILTER 0x00
1310#define LOWEST_RSSI_VALUE 129
1311
The Android Open Source Project5738f832012-12-12 16:00:35 -08001312/*****************************************************************************
1313** External Function Declarations
1314*****************************************************************************/
The Android Open Source Project5738f832012-12-12 16:00:35 -08001315
1316/*******************************************************************************
1317**
1318** Function BTA_EnableBluetooth
1319**
1320** Description This function initializes BTA and prepares BTA and the
1321** Bluetooth protocol stack for use. This function is
1322** typically called at startup or when Bluetooth services
1323** are required by the phone. This function must be called
1324** before calling any other API function.
1325**
1326**
1327** Returns BTA_SUCCESS if successful.
1328** BTA_FAIL if internal failure.
1329**
1330*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001331extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001332
1333/*******************************************************************************
1334**
1335** Function BTA_DisableBluetooth
1336**
1337** Description This function disables BTA and the Bluetooth protocol
1338** stack. It is called when BTA is no longer being used
1339** by any application in the system.
1340**
1341**
1342** Returns void
1343**
1344*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001345extern tBTA_STATUS BTA_DisableBluetooth(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001346
1347/*******************************************************************************
1348**
1349** Function BTA_EnableTestMode
1350**
1351** Description Enables bluetooth device under test mode
1352**
1353**
1354** Returns tBTA_STATUS
1355**
1356*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001357extern tBTA_STATUS BTA_EnableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001358
1359/*******************************************************************************
1360**
1361** Function BTA_DisableTestMode
1362**
1363** Description Disable bluetooth device under test mode
1364**
1365**
1366** Returns None
1367**
1368*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001369extern void BTA_DisableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001370
1371/*******************************************************************************
1372**
1373** Function BTA_DmSetDeviceName
1374**
1375** Description This function sets the Bluetooth name of the local device.
1376**
1377**
1378** Returns void
1379**
1380*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001381extern void BTA_DmSetDeviceName(char *p_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001382
1383/*******************************************************************************
1384**
1385** Function BTA_DmSetVisibility
1386**
1387** Description This function sets the Bluetooth connectable,discoverable,
1388** pairable and conn paired only modesmodes of the local device.
1389** This controls whether other Bluetooth devices can find and connect to
1390** the local device.
1391**
1392**
1393** Returns void
1394**
1395*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001396extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, uint8_t pairable_mode, uint8_t conn_filter);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001397
1398/*******************************************************************************
1399**
1400** Function BTA_DmSearch
1401**
1402** Description This function searches for peer Bluetooth devices. It
1403** first performs an inquiry; for each device found from the
1404** inquiry it gets the remote name of the device. If
1405** parameter services is nonzero, service discovery will be
1406** performed on each device for the services specified.
1407**
1408**
1409** Returns void
1410**
1411*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001412extern void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services,
1413 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001414
1415/*******************************************************************************
1416**
1417** Function BTA_DmSearchCancel
1418**
1419** Description This function cancels a search that has been initiated
1420** by calling BTA_DmSearch().
1421**
1422**
1423** Returns void
1424**
1425*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001426extern void BTA_DmSearchCancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001427
1428/*******************************************************************************
1429**
1430** Function BTA_DmDiscover
1431**
1432** Description This function performs service discovery for the services
1433** of a particular peer device.
1434**
1435**
1436** Returns void
1437**
1438*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001439extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001440 tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001441
The Android Open Source Project5738f832012-12-12 16:00:35 -08001442/*******************************************************************************
1443**
1444** Function BTA_DmDiscoverUUID
1445**
1446** Description This function performs service discovery for the services
1447** of a particular peer device.
1448**
1449**
1450** Returns void
1451**
1452*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001453extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001454 tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001455
1456/*******************************************************************************
1457**
1458** Function BTA_DmGetCachedRemoteName
1459**
1460** Description Retieve cached remote name if available
1461**
1462** Returns BTA_SUCCESS if cached name was retrieved
1463** BTA_FAILURE if cached name is not available
1464**
1465*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001466tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, uint8_t **pp_cached_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001467
1468/*******************************************************************************
1469**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001470** Function BTA_DmBond
1471**
1472** Description This function initiates a bonding procedure with a peer
1473** device. The bonding procedure enables authentication
1474** and optionally encryption on the Bluetooth link.
1475**
1476**
1477** Returns void
1478**
1479*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001480extern void BTA_DmBond(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001481
1482/*******************************************************************************
1483**
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001484** Function BTA_DmBondByTransport
1485**
1486** Description This function initiates a bonding procedure with a peer
1487** device by designated transport. The bonding procedure enables
1488** authentication and optionally encryption on the Bluetooth link.
1489**
1490**
1491** Returns void
1492**
1493*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001494extern void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001495
1496
1497/*******************************************************************************
1498**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001499** Function BTA_DmBondCancel
1500**
1501** Description This function cancels a bonding procedure with a peer
1502** device.
1503**
1504**
1505** Returns void
1506**
1507*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001508extern void BTA_DmBondCancel(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001509
1510/*******************************************************************************
1511**
1512** Function BTA_DmPinReply
1513**
1514** Description This function provides a PIN when one is requested by DM
1515** during a bonding procedure. The application should call
1516** this function after the security callback is called with
1517** a BTA_DM_PIN_REQ_EVT.
1518**
1519**
1520** Returns void
1521**
1522*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001523extern void BTA_DmPinReply(BD_ADDR bd_addr, bool accept, uint8_t pin_len,
1524 uint8_t *p_pin);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001525
The Android Open Source Project5738f832012-12-12 16:00:35 -08001526/*******************************************************************************
1527**
1528** Function BTA_DmLocalOob
1529**
1530** Description This function retrieves the OOB data from local controller.
1531** The result is reported by bta_dm_co_loc_oob().
1532**
1533** Returns void
1534**
1535*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001536extern void BTA_DmLocalOob(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001537
1538/*******************************************************************************
1539**
1540** Function BTA_DmConfirm
1541**
1542** Description This function accepts or rejects the numerical value of the
1543** Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT
1544**
1545** Returns void
1546**
1547*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001548extern void BTA_DmConfirm(BD_ADDR bd_addr, bool accept);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001549
1550/*******************************************************************************
1551**
1552** Function BTA_DmAddDevice
1553**
1554** Description This function adds a device to the security database list
1555** of peer devices. This function would typically be called
1556** at system startup to initialize the security database with
1557** known peer devices. This is a direct execution function
1558** that may lock task scheduling on some platforms.
1559**
1560** Returns void
1561**
1562*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001563extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class,
1564 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001565 bool is_trusted, uint8_t key_type,
1566 tBTA_IO_CAP io_cap, uint8_t pin_length);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001567
1568/*******************************************************************************
1569**
1570** Function BTA_DmRemoveDevice
1571**
1572** Description This function removes a device from the security database.
1573** This is a direct execution function that may lock task
1574** scheduling on some platforms.
1575**
1576**
1577** Returns BTA_SUCCESS if successful.
1578** BTA_FAIL if operation failed.
1579**
1580*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001581extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001582
1583/*******************************************************************************
1584**
1585** Function BTA_GetEirService
1586**
1587** Description This function is called to get BTA service mask from EIR.
1588**
1589** Parameters p_eir - pointer of EIR significant part
1590** p_services - return the BTA service mask
1591**
1592** Returns None
1593**
1594*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001595extern void BTA_GetEirService( uint8_t *p_eir, tBTA_SERVICE_MASK *p_services );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001596
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001597/*******************************************************************************
1598**
1599** Function BTA_DmGetConnectionState
1600**
1601** Description Returns whether the remote device is currently connected.
1602**
1603** Returns 0 if the device is NOT connected.
1604**
1605*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001606extern uint16_t BTA_DmGetConnectionState( const BD_ADDR bd_addr );
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001607
The Android Open Source Project5738f832012-12-12 16:00:35 -08001608
1609/*******************************************************************************
1610**
1611** Function BTA_DmSetLocalDiRecord
1612**
1613** Description This function adds a DI record to the local SDP database.
1614**
1615** Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1616**
1617*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001618extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001619 uint32_t *p_handle );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001620
1621/*******************************************************************************
1622**
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001623**
1624** Function BTA_DmCloseACL
1625**
1626** Description This function force to close an ACL connection and remove the
1627** device from the security database list of known devices.
1628**
1629** Parameters: bd_addr - Address of the peer device
1630** remove_dev - remove device or not after link down
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001631** transport - which transport to close
1632
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001633**
1634** Returns void.
1635**
1636*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001637extern void BTA_DmCloseACL(BD_ADDR bd_addr, bool remove_dev, tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001638
1639/*******************************************************************************
1640**
1641** Function bta_dmexecutecallback
1642**
1643** Description This function will request BTA to execute a call back in the context of BTU task
1644** This API was named in lower case because it is only intended
1645** for the internal customers(like BTIF).
1646**
1647** Returns void
1648**
1649*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001650extern void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK* p_callback, void * p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001651
1652#if (BTM_SCO_HCI_INCLUDED == TRUE)
1653/*******************************************************************************
1654**
1655** Function BTA_DmPcmInitSamples
1656**
1657** Description initialize the down sample converter.
1658**
1659** src_sps: original samples per second (source audio data)
1660** (ex. 44100, 48000)
1661** bits: number of bits per pcm sample (16)
1662** n_channels: number of channels (i.e. mono(1), stereo(2)...)
1663**
1664** Returns none
1665**
1666*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001667extern void BTA_DmPcmInitSamples (uint32_t src_sps, uint32_t bits, uint32_t n_channels);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001668
1669/**************************************************************************************
1670** Function BTA_DmPcmResample
1671**
1672** Description Down sampling utility to convert higher sampling rate into 8K/16bits
1673** PCM samples.
1674**
1675** Parameters p_src: pointer to the buffer where the original sampling PCM
1676** are stored.
1677** in_bytes: Length of the input PCM sample buffer in byte.
1678** p_dst: pointer to the buffer which is to be used to store
1679** the converted PCM samples.
1680**
1681**
Marie Janssene9e58ce2016-06-17 14:12:17 -07001682** Returns int32_t: number of samples converted.
The Android Open Source Project5738f832012-12-12 16:00:35 -08001683**
1684**************************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001685extern int32_t BTA_DmPcmResample (void *p_src, uint32_t in_bytes, void *p_dst);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001686#endif
1687
Marie Janssene9e58ce2016-06-17 14:12:17 -07001688#if (BLE_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -08001689/* BLE related API functions */
1690/*******************************************************************************
1691**
1692** Function BTA_DmBleSecurityGrant
1693**
1694** Description Grant security request access.
1695**
1696** Parameters: bd_addr - BD address of the peer
1697** res - security grant status.
1698**
1699** Returns void
1700**
1701*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001702extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001703
1704
1705
1706/*******************************************************************************
1707**
1708** Function BTA_DmBleSetBgConnType
1709**
1710** Description This function is called to set BLE connectable mode for a
1711** peripheral device.
1712**
1713** Parameters bg_conn_type: it can be auto connection, or selective connection.
1714** p_select_cback: callback function when selective connection procedure
1715** is being used.
1716**
1717** Returns void
1718**
1719*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001720extern void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type, tBTA_DM_BLE_SEL_CBACK *p_select_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001721
1722/*******************************************************************************
1723**
1724** Function BTA_DmBlePasskeyReply
1725**
1726** Description Send BLE SMP passkey reply.
1727**
1728** Parameters: bd_addr - BD address of the peer
1729** accept - passkey entry sucessful or declined.
1730** passkey - passkey value, must be a 6 digit number,
1731** can be lead by 0.
1732**
1733** Returns void
1734**
1735*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001736extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept, uint32_t passkey);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001737
1738/*******************************************************************************
1739**
Satya Calloji444a8da2015-03-06 10:38:22 -08001740** Function BTA_DmBleConfirmReply
1741**
1742** Description Send BLE SMP SC user confirmation reply.
1743**
1744** Parameters: bd_addr - BD address of the peer
1745** accept - numbers to compare are the same or different.
1746**
1747** Returns void
1748**
1749*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001750extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept);
Satya Calloji444a8da2015-03-06 10:38:22 -08001751
1752/*******************************************************************************
1753**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001754** Function BTA_DmAddBleDevice
1755**
1756** Description Add a BLE device. This function will be normally called
1757** during host startup to restore all required information
1758** for a LE device stored in the NVRAM.
1759**
1760** Parameters: bd_addr - BD address of the peer
1761** dev_type - Remote device's device type.
1762** addr_type - LE device address type.
1763**
1764** Returns void
1765**
1766*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001767extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
1768 tBT_DEVICE_TYPE dev_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001769
1770
1771/*******************************************************************************
1772**
1773** Function BTA_DmAddBleKey
1774**
1775** Description Add/modify LE device information. This function will be
1776** normally called during host startup to restore all required
1777** information stored in the NVRAM.
1778**
1779** Parameters: bd_addr - BD address of the peer
1780** p_le_key - LE key values.
1781** key_type - LE SMP key type.
1782**
1783** Returns void
1784**
1785*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001786extern void BTA_DmAddBleKey (BD_ADDR bd_addr,
1787 tBTA_LE_KEY_VALUE *p_le_key,
1788 tBTA_LE_KEY_TYPE key_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001789
1790/*******************************************************************************
1791**
1792** Function BTA_DmSetBlePrefConnParams
1793**
1794** Description This function is called to set the preferred connection
1795** parameters when default connection parameter is not desired.
1796**
1797** Parameters: bd_addr - BD address of the peripheral
1798** min_conn_int - minimum preferred connection interval
1799** max_conn_int - maximum preferred connection interval
1800** slave_latency - preferred slave latency
1801** supervision_tout - preferred supervision timeout
1802**
1803**
1804** Returns void
1805**
1806*******************************************************************************/
Jakub Pawlowski063ca022016-04-25 10:43:02 -07001807extern void BTA_DmSetBlePrefConnParams(const BD_ADDR bd_addr,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001808 uint16_t min_conn_int, uint16_t max_conn_int,
1809 uint16_t slave_latency, uint16_t supervision_tout );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001810
1811/*******************************************************************************
1812**
1813** Function BTA_DmSetBleConnScanParams
1814**
1815** Description This function is called to set scan parameters used in
1816** BLE connection request
1817**
Satya Calloji444a8da2015-03-06 10:38:22 -08001818** Parameters: scan_interval - scan interval
The Android Open Source Project5738f832012-12-12 16:00:35 -08001819** scan_window - scan window
1820**
1821** Returns void
1822**
1823*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001824extern void BTA_DmSetBleConnScanParams(uint32_t scan_interval,
1825 uint32_t scan_window);
Satya Calloji5725fc62015-03-31 13:24:32 -07001826
1827/*******************************************************************************
1828**
1829** Function BTA_DmSetBleScanParams
1830**
1831** Description This function is called to set scan parameters
1832**
1833** Parameters: client_if - Client IF
1834** scan_interval - scan interval
1835** scan_window - scan window
1836** scan_mode - scan mode
1837** scan_param_setup_status_cback - Set scan param status callback
1838**
1839** Returns void
1840**
1841*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001842extern void BTA_DmSetBleScanParams(tGATT_IF client_if, uint32_t scan_interval,
1843 uint32_t scan_window, tBLE_SCAN_MODE scan_mode,
Satya Calloji5725fc62015-03-31 13:24:32 -07001844 tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_status_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001845
1846/*******************************************************************************
1847**
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001848** Function BTA_DmSetBleAdvParams
1849**
1850** Description This function sets the advertising parameters BLE functionality.
1851** It is to be called when device act in peripheral or broadcaster
1852** role.
1853**
1854** Parameters: adv_int_min - adv interval minimum
1855** adv_int_max - adv interval max
1856** p_dir_bda - directed adv initator address
1857**
1858** Returns void
1859**
1860*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001861extern void BTA_DmSetBleAdvParams (uint16_t adv_int_min, uint16_t adv_int_max,
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001862 tBLE_BD_ADDR *p_dir_bda);
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001863/*******************************************************************************
1864**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001865** Function BTA_DmSearchExt
1866**
1867** Description This function searches for peer Bluetooth devices. It performs
1868** an inquiry and gets the remote name for devices. Service
1869** discovery is done if services is non zero
1870**
1871** Parameters p_dm_inq: inquiry conditions
1872** services: if service is not empty, service discovery will be done.
1873** for all GATT based service condition, put num_uuid, and
1874** p_uuid is the pointer to the list of UUID values.
1875** p_cback: callback functino when search is completed.
1876**
1877**
1878**
1879** Returns void
1880**
1881*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001882extern void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services,
1883 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001884
1885/*******************************************************************************
1886**
1887** Function BTA_DmDiscoverExt
1888**
1889** Description This function does service discovery for services of a
1890** peer device. When services.num_uuid is 0, it indicates all
1891** GATT based services are to be searched; other wise a list of
1892** UUID of interested services should be provided through
1893** services.p_uuid.
1894**
1895**
1896**
1897** Returns void
1898**
1899*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001900extern void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001901 tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001902
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001903/*******************************************************************************
1904**
1905** Function BTA_DmDiscoverByTransport
1906**
1907** Description This function does service discovery on particular transport
1908** for services of a
1909** peer device. When services.num_uuid is 0, it indicates all
1910** GATT based services are to be searched; other wise a list of
1911** UUID of interested services should be provided through
1912** p_services->p_uuid.
1913**
1914**
1915**
1916** Returns void
1917**
1918*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001919extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001920 tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search,
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001921 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001922
1923/*******************************************************************************
1924**
1925** Function BTA_DmSetEncryption
1926**
1927** Description This function is called to ensure that connection is
1928** encrypted. Should be called only on an open connection.
1929** Typically only needed for connections that first want to
1930** bring up unencrypted links, then later encrypt them.
1931**
1932** Parameters: bd_addr - Address of the peer device
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001933** transport - transport of the link to be encruypted
The Android Open Source Project5738f832012-12-12 16:00:35 -08001934** p_callback - Pointer to callback function to indicat the
1935** link encryption status
1936** sec_act - This is the security action to indicate
1937** what knid of BLE security level is required for
1938** the BLE link if the BLE is supported
1939** Note: This parameter is ignored for the BR/EDR link
1940** or the BLE is not supported
1941**
1942** Returns void
1943**
1944**
1945*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001946extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
1947 tBTA_DM_ENCRYPT_CBACK *p_callback,
1948 tBTA_DM_BLE_SEC_ACT sec_act);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001949
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001950
1951/*******************************************************************************
1952**
1953** Function BTA_DmBleObserve
1954**
1955** Description This procedure keep the device listening for advertising
1956** events from a broadcast device.
1957**
1958** Parameters start: start or stop observe.
1959** duration : Duration of the scan. Continuous scan if 0 is passed
1960** p_results_cb: Callback to be called with scan results
1961**
1962** Returns void
1963**
1964*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001965extern void BTA_DmBleObserve(bool start, uint8_t duration,
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001966 tBTA_DM_SEARCH_CBACK *p_results_cb);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001967
1968
The Android Open Source Project5738f832012-12-12 16:00:35 -08001969#endif
1970
Marie Janssene9e58ce2016-06-17 14:12:17 -07001971#if (BLE_INCLUDED == TRUE)
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001972/*******************************************************************************
1973**
1974** Function BTA_DmBleConfigLocalPrivacy
1975**
1976** Description Enable/disable privacy on the local device
1977**
1978** Parameters: privacy_enable - enable/disabe privacy on remote device.
1979**
1980** Returns void
1981**
1982*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001983extern void BTA_DmBleConfigLocalPrivacy(bool privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001984
1985/*******************************************************************************
1986**
1987** Function BTA_DmBleEnableRemotePrivacy
1988**
1989** Description Enable/disable privacy on a remote device
1990**
1991** Parameters: bd_addr - BD address of the peer
1992** privacy_enable - enable/disabe privacy on remote device.
1993**
1994** Returns void
1995**
1996*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001997extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, bool privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001998
1999
2000/*******************************************************************************
2001**
2002** Function BTA_DmBleSetAdvConfig
2003**
2004** Description This function is called to override the BTA default ADV parameters.
2005**
2006** Parameters Pointer to User defined ADV data structure
2007**
2008** Returns None
2009**
2010*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002011extern void BTA_DmBleSetAdvConfig (tBTA_BLE_AD_MASK data_mask,
2012 tBTA_BLE_ADV_DATA *p_adv_cfg,
2013 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002014
2015/*******************************************************************************
2016**
2017** Function BTA_DmBleSetScanRsp
2018**
2019** Description This function is called to override the BTA scan response.
2020**
2021** Parameters Pointer to User defined ADV data structure
2022**
2023** Returns None
2024**
2025*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002026extern void BTA_DmBleSetScanRsp (tBTA_BLE_AD_MASK data_mask,
2027 tBTA_BLE_ADV_DATA *p_adv_cfg,
2028 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002029
2030/*******************************************************************************
2031**
2032** Function BTA_DmBleBroadcast
2033**
2034** Description This function starts or stops LE broadcasting.
2035**
2036** Parameters start: start or stop broadcast.
2037**
2038** Returns None
2039**
2040*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002041extern void BTA_DmBleBroadcast (bool start);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002042
Wei Wanga6ce7752014-05-20 06:30:32 +00002043
2044/*******************************************************************************
2045**
2046** Function BTA_BleEnableAdvInstance
2047**
2048** Description This function enables the Multi ADV instance feature
2049**
2050** Parameters p_params Pointer to ADV param user defined structure
2051** p_cback Pointer to Multi ADV callback structure
2052** p_ref - Reference pointer
2053**
2054** Returns None
2055**
2056*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002057extern void BTA_BleEnableAdvInstance (tBTA_BLE_ADV_PARAMS *p_params,
Wei Wanga6ce7752014-05-20 06:30:32 +00002058 tBTA_BLE_MULTI_ADV_CBACK *p_cback,void *p_ref);
2059
2060/*******************************************************************************
2061**
2062** Function BTA_BleUpdateAdvInstParam
2063**
2064** Description This function updates the Multi ADV instance params
2065**
2066** Parameters inst_id Instance ID
2067** p_params Pointer to ADV param user defined structure
2068**
2069** Returns None
2070**
2071*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002072extern void BTA_BleUpdateAdvInstParam (uint8_t inst_id,
Wei Wanga6ce7752014-05-20 06:30:32 +00002073 tBTA_BLE_ADV_PARAMS *p_params);
2074
2075/*******************************************************************************
2076**
2077** Function BTA_BleCfgAdvInstData
2078**
2079** Description This function is called to configure the ADV instance data
2080**
2081** Parameters inst_id - Instance ID
2082** is_scan_rsp - Boolean value Scan response
2083** Pointer to User defined ADV data structure
2084** Returns None
2085**
2086*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002087extern void BTA_BleCfgAdvInstData (uint8_t inst_id, bool is_scan_rsp,
Wei Wanga6ce7752014-05-20 06:30:32 +00002088 tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_data);
2089
2090/*******************************************************************************
2091**
2092** Function BTA_BleDisableAdvInstance
2093**
2094** Description This function is called to disable the ADV instance
2095**
2096** Parameters inst_id - Instance ID to be disabled
2097**
2098** Returns None
2099**
2100*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002101extern void BTA_BleDisableAdvInstance(uint8_t inst_id);
Wei Wanga6ce7752014-05-20 06:30:32 +00002102
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07002103/*******************************************************************************
2104**
2105** Function BTA_DmBleUpdateConnectionParams
2106**
2107** Description Update connection parameters, can only be used when connection is up.
2108**
2109** Parameters: bd_addr - BD address of the peer
2110** min_int - minimum connection interval, [0x0004~ 0x4000]
2111** max_int - maximum connection interval, [0x0004~ 0x4000]
2112** latency - slave latency [0 ~ 500]
2113** timeout - supervision timeout [0x000a ~ 0xc80]
2114**
2115** Returns void
2116**
2117*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002118extern void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr, uint16_t min_int,
2119 uint16_t max_int, uint16_t latency, uint16_t timeout);
Satya Callojic4e25962014-05-10 23:46:24 -07002120
2121/*******************************************************************************
2122**
Priti Aghera636d6712014-12-18 13:55:48 -08002123** Function BTA_DmBleSetDataLength
2124**
2125** Description This function is to set maximum LE data packet size
2126**
2127** Returns void
2128**
2129*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002130extern void BTA_DmBleSetDataLength(BD_ADDR remote_device, uint16_t tx_data_length);
Priti Aghera636d6712014-12-18 13:55:48 -08002131
2132/*******************************************************************************
2133**
Satya Callojic4e25962014-05-10 23:46:24 -07002134** Function BTA_DmBleSetStorageParams
2135**
2136** Description This function is called to set the storage parameters
2137**
2138** Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning
2139** batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning
2140** batch_scan_notify_threshold - Setup notification level based on total space
2141** consumed by both pools. Setting it to 0 will disable threshold notification
2142** p_setup_cback - Setup callback
2143** p_thres_cback - Threshold callback
2144** p_rep_cback - Reports callback
Satya Calloji1acb61c2014-06-14 23:16:18 -07002145** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002146**
2147** Returns None
2148**
2149*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002150extern void BTA_DmBleSetStorageParams(uint8_t batch_scan_full_max,
2151 uint8_t batch_scan_trunc_max,
2152 uint8_t batch_scan_notify_threshold,
Satya Callojic4e25962014-05-10 23:46:24 -07002153 tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback,
2154 tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002155 tBTA_BLE_SCAN_REP_CBACK* p_rep_cback,
Satya Callojic4e25962014-05-10 23:46:24 -07002156 tBTA_DM_BLE_REF_VALUE ref_value);
2157
2158/*******************************************************************************
2159**
2160** Function BTA_DmBleEnableBatchScan
2161**
2162** Description This function is called to enable the batch scan
2163**
2164** Parameters scan_mode -Batch scan mode
2165** scan_interval - Scan interval
2166** scan_window - Scan window
2167** discard_rule -Discard rules
2168** addr_type - Address type
Satya Calloji1acb61c2014-06-14 23:16:18 -07002169** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002170**
2171** Returns None
2172**
2173*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002174extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
Marie Janssene9e58ce2016-06-17 14:12:17 -07002175 uint32_t scan_interval, uint32_t scan_window,
Satya Callojic4e25962014-05-10 23:46:24 -07002176 tBTA_BLE_DISCARD_RULE discard_rule,
2177 tBLE_ADDR_TYPE addr_type,
2178 tBTA_DM_BLE_REF_VALUE ref_value);
2179
2180/*******************************************************************************
2181**
2182** Function BTA_DmBleReadScanReports
2183**
2184** Description This function is called to read the batch scan reports
2185**
2186** Parameters scan_mode -Batch scan mode
Satya Calloji1acb61c2014-06-14 23:16:18 -07002187** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002188**
2189** Returns None
2190**
2191*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002192extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
Satya Callojic4e25962014-05-10 23:46:24 -07002193 tBTA_DM_BLE_REF_VALUE ref_value);
2194
2195/*******************************************************************************
2196**
2197** Function BTA_DmBleDisableBatchScan
2198**
2199** Description This function is called to disable the batch scanning
2200**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002201** Parameters ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002202**
2203** Returns None
2204**
2205*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002206extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002207
Satya Calloji1a9247a2014-06-05 13:15:15 -07002208/*******************************************************************************
2209**
2210** Function BTA_DmEnableScanFilter
2211**
2212** Description This function is called to enable the adv data payload filter
2213**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002214** Parameters action - enable or disable the APCF feature
2215** p_cmpl_cback - Command completed callback
2216** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002217**
2218** Returns void
2219**
2220*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002221extern void BTA_DmEnableScanFilter(uint8_t action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002222 tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
2223 tBTA_DM_BLE_REF_VALUE ref_value);
2224
2225/*******************************************************************************
2226**
2227** Function BTA_DmBleScanFilterSetup
2228**
2229** Description This function is called to setup the filter params
2230**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002231** Parameters p_target: enable the filter condition on a target device; if NULL
2232** filt_index - Filter index
2233** p_filt_params -Filter parameters
2234** ref_value - Reference value
2235** action - Add, delete or clear
2236** p_cmpl_back - Command completed callback
Satya Calloji1a9247a2014-06-05 13:15:15 -07002237**
2238** Returns void
2239**
2240*******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002241extern void BTA_DmBleScanFilterSetup(uint8_t action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002242 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2243 tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
2244 tBLE_BD_ADDR *p_target,
2245 tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
2246 tBTA_DM_BLE_REF_VALUE ref_value);
2247
2248/*******************************************************************************
2249**
2250** Function BTA_DmBleCfgFilterCondition
2251**
2252** Description This function is called to configure the adv data payload filter
2253** condition.
2254**
2255** Parameters action: to read/write/clear
Satya Calloji1acb61c2014-06-14 23:16:18 -07002256** cond_type: filter condition type
2257** filt_index - Filter index
Satya Calloji1a9247a2014-06-05 13:15:15 -07002258** p_cond: filter condition parameter
Satya Calloji1acb61c2014-06-14 23:16:18 -07002259** p_cmpl_back - Command completed callback
2260** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002261**
2262** Returns void
2263**
2264*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002265extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002266 tBTA_DM_BLE_PF_COND_TYPE cond_type,
2267 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2268 tBTA_DM_BLE_PF_COND_PARAM *p_cond,
2269 tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
2270 tBTA_DM_BLE_REF_VALUE ref_value);
2271
Satya Calloji1acb61c2014-06-14 23:16:18 -07002272
2273/*******************************************************************************
2274**
2275** Function BTA_DmBleTrackAdvertiser
2276**
2277** Description This function is called to track the advertiser
2278**
2279** Parameters ref_value - Reference value
2280** p_track_adv_cback - ADV callback
2281**
2282** Returns None
2283**
2284*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002285extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
Satya Calloji1acb61c2014-06-14 23:16:18 -07002286 tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback);
2287
Satya Callojie5ba8842014-07-03 17:18:02 -07002288/*******************************************************************************
2289**
2290** Function BTA_DmBleGetEnergyInfo
2291**
2292** Description This function is called to obtain the energy info
2293**
2294** Parameters p_cmpl_cback - Command complete callback
2295**
2296** Returns void
2297**
2298*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002299extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback);
Satya Callojie5ba8842014-07-03 17:18:02 -07002300
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002301/*******************************************************************************
2302**
2303** Function BTA_BrcmInit
2304**
2305** Description This function initializes Broadcom specific VS handler in BTA
2306**
2307** Returns void
2308**
2309*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002310extern void BTA_VendorInit (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002311
2312/*******************************************************************************
2313**
2314** Function BTA_BrcmCleanup
2315**
2316** Description This function frees up Broadcom specific VS specific dynamic memory
2317**
2318** Returns void
2319**
2320*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002321extern void BTA_VendorCleanup (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002322
Matthew Xiefc4b2f12013-05-06 20:51:02 -07002323#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -08002324
2325#ifdef __cplusplus
2326}
2327#endif
2328
2329#endif /* BTA_API_H */