blob: 5d71b412cd241f9239fc4e8013dc5d2734f46a21 [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"
31#include "uipc_msg.h"
32
33#if BLE_INCLUDED == TRUE
34#include "btm_ble_api.h"
35#endif
36
37/*****************************************************************************
38** Constants and data types
39*****************************************************************************/
40
41/* Status Return Value */
42#define BTA_SUCCESS 0 /* Successful operation. */
43#define BTA_FAILURE 1 /* Generic failure. */
44#define BTA_PENDING 2 /* API cannot be completed right now */
45#define BTA_BUSY 3
46#define BTA_NO_RESOURCES 4
47#define BTA_WRONG_MODE 5
48
49typedef UINT8 tBTA_STATUS;
50
51/*
52 * Service ID
53 *
54 * NOTES: When you add a new Service ID for BTA AND require to change the value of BTA_MAX_SERVICE_ID,
55 * make sure that the correct security ID of the new service from Security service definitions (btm_api.h)
56 * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in bta_dm_act.c.
57 */
58
59#define BTA_RES_SERVICE_ID 0 /* Reserved */
60#define BTA_SPP_SERVICE_ID 1 /* Serial port profile. */
61#define BTA_DUN_SERVICE_ID 2 /* Dial-up networking profile. */
62#define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */
63#define BTA_LAP_SERVICE_ID 4 /* LAN access profile. */
64#define BTA_HSP_SERVICE_ID 5 /* Headset profile. */
65#define BTA_HFP_SERVICE_ID 6 /* Hands-free profile. */
66#define BTA_OPP_SERVICE_ID 7 /* Object push */
67#define BTA_FTP_SERVICE_ID 8 /* File transfer */
68#define BTA_CTP_SERVICE_ID 9 /* Cordless Terminal */
69#define BTA_ICP_SERVICE_ID 10 /* Intercom Terminal */
70#define BTA_SYNC_SERVICE_ID 11 /* Synchronization */
71#define BTA_BPP_SERVICE_ID 12 /* Basic printing profile */
72#define BTA_BIP_SERVICE_ID 13 /* Basic Imaging profile */
73#define BTA_PANU_SERVICE_ID 14 /* PAN User */
74#define BTA_NAP_SERVICE_ID 15 /* PAN Network access point */
75#define BTA_GN_SERVICE_ID 16 /* PAN Group Ad-hoc networks */
76#define BTA_SAP_SERVICE_ID 17 /* SIM Access profile */
Rakesh Iyer9c8dfac2015-04-08 12:25:37 -070077#define BTA_A2DP_SINK_SERVICE_ID 18 /* A2DP Sink */
The Android Open Source Project5738f832012-12-12 16:00:35 -080078#define BTA_AVRCP_SERVICE_ID 19 /* A/V remote control */
79#define BTA_HID_SERVICE_ID 20 /* HID */
80#define BTA_VDP_SERVICE_ID 21 /* Video distribution */
81#define BTA_PBAP_SERVICE_ID 22 /* PhoneBook Access Server*/
82#define BTA_HSP_HS_SERVICE_ID 23 /* HFP HS role */
83#define BTA_HFP_HS_SERVICE_ID 24 /* HSP HS role */
84#define BTA_MAP_SERVICE_ID 25 /* Message Access Profile */
85#define BTA_MN_SERVICE_ID 26 /* Message Notification Service */
86#define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */
87#define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/
Kim Schulz8372aa52015-03-25 10:39:40 +010088#define BTA_SDP_SERVICE_ID 29 /* SDP Search*/
The Android Open Source Project5738f832012-12-12 16:00:35 -080089#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
90/* BLE profile service ID */
Kim Schulz8372aa52015-03-25 10:39:40 +010091#define BTA_BLE_SERVICE_ID 30 /* GATT profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -080092
93// btla-specific ++
Kim Schulz8372aa52015-03-25 10:39:40 +010094#define BTA_USER_SERVICE_ID 31 /* User requested UUID */
The Android Open Source Project5738f832012-12-12 16:00:35 -080095
Kim Schulz8372aa52015-03-25 10:39:40 +010096#define BTA_MAX_SERVICE_ID 32
The Android Open Source Project5738f832012-12-12 16:00:35 -080097// btla-specific --
98#else
Kim Schulz8372aa52015-03-25 10:39:40 +010099#define BTA_USER_SERVICE_ID 30 /* User requested UUID */
100#define BTA_MAX_SERVICE_ID 31
The Android Open Source Project5738f832012-12-12 16:00:35 -0800101#endif
102/* service IDs (BTM_SEC_SERVICE_FIRST_EMPTY + 1) to (BTM_SEC_MAX_SERVICES - 1)
103 * are used by BTA JV */
104#define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1)
105#define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1)
106
107typedef UINT8 tBTA_SERVICE_ID;
108
109/* Service ID Mask */
110#define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */
111#define BTA_SPP_SERVICE_MASK 0x00000002 /* Serial port profile. */
112#define BTA_DUN_SERVICE_MASK 0x00000004 /* Dial-up networking profile. */
113#define BTA_FAX_SERVICE_MASK 0x00000008 /* Fax profile. */
114#define BTA_LAP_SERVICE_MASK 0x00000010 /* LAN access profile. */
115#define BTA_HSP_SERVICE_MASK 0x00000020 /* HSP AG role. */
116#define BTA_HFP_SERVICE_MASK 0x00000040 /* HFP AG role */
117#define BTA_OPP_SERVICE_MASK 0x00000080 /* Object push */
118#define BTA_FTP_SERVICE_MASK 0x00000100 /* File transfer */
119#define BTA_CTP_SERVICE_MASK 0x00000200 /* Cordless Terminal */
120#define BTA_ICP_SERVICE_MASK 0x00000400 /* Intercom Terminal */
121#define BTA_SYNC_SERVICE_MASK 0x00000800 /* Synchronization */
122#define BTA_BPP_SERVICE_MASK 0x00001000 /* Print server */
123#define BTA_BIP_SERVICE_MASK 0x00002000 /* Basic Imaging */
124#define BTA_PANU_SERVICE_MASK 0x00004000 /* PAN User */
125#define BTA_NAP_SERVICE_MASK 0x00008000 /* PAN Network access point */
126#define BTA_GN_SERVICE_MASK 0x00010000 /* PAN Group Ad-hoc networks */
127#define BTA_SAP_SERVICE_MASK 0x00020000 /* PAN Group Ad-hoc networks */
128#define BTA_A2DP_SERVICE_MASK 0x00040000 /* Advanced audio distribution */
129#define BTA_AVRCP_SERVICE_MASK 0x00080000 /* A/V remote control */
130#define BTA_HID_SERVICE_MASK 0x00100000 /* HID */
131#define BTA_VDP_SERVICE_MASK 0x00200000 /* Video distribution */
132#define BTA_PBAP_SERVICE_MASK 0x00400000 /* Phone Book Server */
133#define BTA_HSP_HS_SERVICE_MASK 0x00800000 /* HFP HS role */
134#define BTA_HFP_HS_SERVICE_MASK 0x01000000 /* HSP HS role */
135#define BTA_MAS_SERVICE_MASK 0x02000000 /* Message Access Profile */
136#define BTA_MN_SERVICE_MASK 0x04000000 /* Message Notification Profile */
137#define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */
138#define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */
139
140#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
141#define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */
142// btla-specific ++
143#define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */
144// btla-specific --
145#else
146// btla-specific ++
147#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
148// btla-specific --
149#endif
150
151#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
152#define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */
153#else
154#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
155#endif
156
157typedef UINT32 tBTA_SERVICE_MASK;
158
159/* extended service mask, including mask with one or more GATT UUID */
160typedef struct
161{
162 tBTA_SERVICE_MASK srvc_mask;
163 UINT8 num_uuid;
164 tBT_UUID *p_uuid;
165}tBTA_SERVICE_MASK_EXT;
166
167/* Security Setting Mask */
168#define BTA_SEC_NONE BTM_SEC_NONE /* No security. */
169#define BTA_SEC_AUTHORIZE (BTM_SEC_IN_AUTHORIZE ) /* Authorization required (only needed for out going connection )*/
170#define BTA_SEC_AUTHENTICATE (BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */
171#define BTA_SEC_ENCRYPT (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */
Mudumba Ananth899b7712015-01-30 02:33:02 -0800172#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 +0200173#define BTA_SEC_MITM (BTM_SEC_IN_MITM | BTM_SEC_OUT_MITM) /* Man-In-The_Middle protection */
174#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 -0800175
Casper Bonde818d0f22015-05-21 11:08:45 +0200176typedef UINT16 tBTA_SEC;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800177
178/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -0700179#define BTA_DM_IGNORE 0x00FF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800180
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -0700181/* Ignore for Discoverable, Connectable only for LE modes */
182#define BTA_DM_LE_IGNORE 0xFF00
The Android Open Source Project5738f832012-12-12 16:00:35 -0800183
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900184#define BTA_ALL_APP_ID 0xFF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800185
186/* Discoverable Modes */
187#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
188#define BTA_DM_GENERAL_DISC BTM_GENERAL_DISCOVERABLE /* General discoverable. */
189#define BTA_DM_LIMITED_DISC BTM_LIMITED_DISCOVERABLE /* Limited discoverable. */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800190#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
191#define BTA_DM_BLE_NON_DISCOVERABLE BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
192#define BTA_DM_BLE_GENERAL_DISCOVERABLE BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
193#define BTA_DM_BLE_LIMITED_DISCOVERABLE BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
194#endif
195typedef UINT16 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 -0800196
197/* Connectable Modes */
198#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
199#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800200#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
201#define BTA_DM_BLE_NON_CONNECTABLE BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
202#define BTA_DM_BLE_CONNECTABLE BTM_BLE_CONNECTABLE /* Device is LE connectable. */
203#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800204
205// btla-specific ++
206typedef UINT16 tBTA_DM_CONN;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700207
208#define BTA_TRANSPORT_UNKNOWN 0
209#define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR
210#define BTA_TRANSPORT_LE BT_TRANSPORT_LE
211typedef tBT_TRANSPORT tBTA_TRANSPORT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800212
213/* Pairable Modes */
214#define BTA_DM_PAIRABLE 1
215#define BTA_DM_NON_PAIRABLE 0
216
217/* Connectable Paired Only Mode */
218#define BTA_DM_CONN_ALL 0
219#define BTA_DM_CONN_PAIRED 1
220
221/* Inquiry Modes */
Kim Schulz8372aa52015-03-25 10:39:40 +0100222#define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800223#define BTA_DM_GENERAL_INQUIRY BTM_GENERAL_INQUIRY /* Perform general inquiry. */
224#define BTA_DM_LIMITED_INQUIRY BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
225
226#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
227#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
228#define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
229#define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
230#endif
231typedef UINT8 tBTA_DM_INQ_MODE;
232
233/* Inquiry Filter Type */
234#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
235#define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
236#define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
237
238typedef UINT8 tBTA_DM_INQ_FILT;
239
240/* Authorize Response */
241#define BTA_DM_AUTH_PERM 0 /* Authorized for future connections to the service */
242#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
243#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
244
245typedef UINT8 tBTA_AUTH_RESP;
246
247/* M/S preferred roles */
248#define BTA_ANY_ROLE 0x00
249#define BTA_MASTER_ROLE_PREF 0x01
250#define BTA_MASTER_ROLE_ONLY 0x02
251
252typedef UINT8 tBTA_PREF_ROLES;
253
254enum
255{
256
257 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
258 support "role switch during connection" for
259 an incoming connection, when it already has
260 another connection in master role */
261 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
262 simulateous connection in Master and Slave roles
263 for short period of time */
264 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
265 and slave roles */
266
267};
268
269
270/* Inquiry filter device class condition */
271typedef struct
272{
273 DEV_CLASS dev_class; /* device class of interest */
274 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of interest */
275} tBTA_DM_COD_COND;
276
277
278/* Inquiry Filter Condition */
279typedef union
280{
281 BD_ADDR bd_addr; /* BD address of device to filter. */
282 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
283} tBTA_DM_INQ_COND;
284
285/* Inquiry Parameters */
286typedef struct
287{
288 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
289 UINT8 duration; /* Inquiry duration in 1.28 sec units. */
290 UINT8 max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
291 BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */
292 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
293 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
Matthew Xie7f3e4292013-09-30 12:44:10 -0700294#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE)
295 UINT8 intl_duration[4];/*duration array storing the interleave scan's time portions*/
296#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800297} tBTA_DM_INQ;
298
299typedef struct
300{
301 UINT8 bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */
302#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
303 UINT8 bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
304 UINT8 *bta_dm_eir_uuid16; /* 16-bit UUIDs */
305#else
306 UINT32 uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
307#endif
308 INT8 *bta_dm_eir_inq_tx_power; /* Inquiry TX power */
309 UINT8 bta_dm_eir_flag_len; /* length of flags in bytes */
310 UINT8 *bta_dm_eir_flags; /* flags for EIR */
311 UINT8 bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */
312 UINT8 *bta_dm_eir_manufac_spec; /* manufacturer specific */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800313 UINT8 bta_dm_eir_additional_len; /* length of additional data in bytes */
314 UINT8 *bta_dm_eir_additional; /* additional data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800315} tBTA_DM_EIR_CONF;
316
317#if BLE_INCLUDED == TRUE
318/* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */
319#define BTA_BLE_LIMIT_DISC_FLAG BTM_BLE_LIMIT_DISC_FLAG
320#define BTA_BLE_GEN_DISC_FLAG BTM_BLE_GEN_DISC_FLAG
321#define BTA_BLE_BREDR_NOT_SPT BTM_BLE_BREDR_NOT_SPT
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700322#define BTA_BLE_DMT_CONTROLLER_SPT BTM_BLE_DMT_CONTROLLER_SPT
323#define BTA_BLE_DMT_HOST_SPT BTM_BLE_DMT_HOST_SPT
The Android Open Source Project5738f832012-12-12 16:00:35 -0800324#define BTA_BLE_NON_LIMIT_DISC_FLAG BTM_BLE_NON_LIMIT_DISC_FLAG
325#define BTA_BLE_ADV_FLAG_MASK BTM_BLE_ADV_FLAG_MASK
326#define BTA_BLE_LIMIT_DISC_MASK BTM_BLE_LIMIT_DISC_MASK
327
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800328/* ADV data bit mask */
329#define BTA_BLE_AD_BIT_DEV_NAME BTM_BLE_AD_BIT_DEV_NAME
330#define BTA_BLE_AD_BIT_FLAGS BTM_BLE_AD_BIT_FLAGS
331#define BTA_BLE_AD_BIT_MANU BTM_BLE_AD_BIT_MANU
332#define BTA_BLE_AD_BIT_TX_PWR BTM_BLE_AD_BIT_TX_PWR
333#define BTA_BLE_AD_BIT_INT_RANGE BTM_BLE_AD_BIT_INT_RANGE
334#define BTA_BLE_AD_BIT_SERVICE BTM_BLE_AD_BIT_SERVICE
335#define BTA_BLE_AD_BIT_APPEARANCE BTM_BLE_AD_BIT_APPEARANCE
336#define BTA_BLE_AD_BIT_PROPRIETARY BTM_BLE_AD_BIT_PROPRIETARY
337#define BTA_DM_BLE_AD_BIT_SERVICE_SOL BTM_BLE_AD_BIT_SERVICE_SOL
338#define BTA_DM_BLE_AD_BIT_SERVICE_DATA BTM_BLE_AD_BIT_SERVICE_DATA
339#define BTA_DM_BLE_AD_BIT_SIGN_DATA BTM_BLE_AD_BIT_SIGN_DATA
340#define BTA_DM_BLE_AD_BIT_SERVICE_128SOL BTM_BLE_AD_BIT_SERVICE_128SOL
341#define BTA_DM_BLE_AD_BIT_PUBLIC_ADDR BTM_BLE_AD_BIT_PUBLIC_ADDR
342#define BTA_DM_BLE_AD_BIT_RANDOM_ADDR BTM_BLE_AD_BIT_RANDOM_ADDR
Wei Wanga6ce7752014-05-20 06:30:32 +0000343#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 -0800344
Wei Wanga6ce7752014-05-20 06:30:32 +0000345typedef tBTM_BLE_AD_MASK tBTA_BLE_AD_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800346
347/* slave preferred connection interval range */
348typedef struct
349{
350 UINT16 low;
351 UINT16 hi;
352
353}tBTA_BLE_INT_RANGE;
354
355/* Service tag supported in the device */
356typedef struct
357{
358 UINT8 num_service;
359 BOOLEAN list_cmpl;
360 UINT16 *p_uuid;
361}tBTA_BLE_SERVICE;
362
The Android Open Source Project5738f832012-12-12 16:00:35 -0800363
364typedef struct
365{
366 UINT8 len;
367 UINT8 *p_val;
368}tBTA_BLE_MANU;
369
370typedef struct
371{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800372 UINT8 adv_type;
373 UINT8 len;
374 UINT8 *p_val; /* number of len byte */
375}tBTA_BLE_PROP_ELEM;
376
377/* vendor proprietary adv type */
378typedef struct
379{
380 UINT8 num_elem;
381 tBTA_BLE_PROP_ELEM *p_elem;
382}tBTA_BLE_PROPRIETARY;
383
384typedef struct
385{
Wei Wanga6ce7752014-05-20 06:30:32 +0000386 tBT_UUID service_uuid;
387 UINT8 len;
388 UINT8 *p_val;
389}tBTA_BLE_SERVICE_DATA;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800390
Wei Wanga6ce7752014-05-20 06:30:32 +0000391typedef tBTM_BLE_128SERVICE tBTA_BLE_128SERVICE;
392typedef tBTM_BLE_32SERVICE tBTA_BLE_32SERVICE;
393
394typedef struct
395{
396 tBTA_BLE_INT_RANGE int_range; /* slave prefered conn interval range */
397 tBTA_BLE_MANU *p_manu; /* manufacturer data */
398 tBTA_BLE_SERVICE *p_services; /* 16 bits services */
399 tBTA_BLE_128SERVICE *p_services_128b; /* 128 bits service */
400 tBTA_BLE_32SERVICE *p_service_32b; /* 32 bits Service UUID */
401 tBTA_BLE_SERVICE *p_sol_services; /* 16 bits services Solicitation UUIDs */
402 tBTA_BLE_32SERVICE *p_sol_service_32b; /* List of 32 bit Service Solicitation UUIDs */
403 tBTA_BLE_128SERVICE *p_sol_service_128b;/* List of 128 bit Service Solicitation UUIDs */
404 tBTA_BLE_PROPRIETARY *p_proprietary; /* proprietary data */
405 tBTA_BLE_SERVICE_DATA *p_service_data; /* service data */
406 UINT16 appearance; /* appearance data */
407 UINT8 flag;
408 UINT8 tx_power;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800409}tBTA_BLE_ADV_DATA;
410
Wei Wanga6ce7752014-05-20 06:30:32 +0000411typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status);
412
413/* advertising channel map */
414#define BTA_BLE_ADV_CHNL_37 BTM_BLE_ADV_CHNL_37
415#define BTA_BLE_ADV_CHNL_38 BTM_BLE_ADV_CHNL_38
416#define BTA_BLE_ADV_CHNL_39 BTM_BLE_ADV_CHNL_39
417typedef tBTM_BLE_ADV_CHNL_MAP tBTA_BLE_ADV_CHNL_MAP; /* use as a bit mask */
418
419/* advertising filter policy */
420typedef tBTM_BLE_AFP tBTA_BLE_AFP;
421
422/* adv event type */
423#define BTA_BLE_CONNECT_EVT BTM_BLE_CONNECT_EVT /* Connectable undirected advertising */
424#define BTA_BLE_CONNECT_DIR_EVT BTM_BLE_CONNECT_DIR_EVT /* Connectable directed advertising */
425#define BTA_BLE_DISCOVER_EVT BTM_BLE_DISCOVER_EVT /* Scannable undirected advertising */
426#define BTA_BLE_NON_CONNECT_EVT BTM_BLE_NON_CONNECT_EVT /* Non connectable undirected advertising */
427typedef UINT8 tBTA_BLE_ADV_EVT;
428
429/* adv tx power level */
430#define BTA_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
431#define BTA_BLE_ADV_TX_POWER_LOW 1 /* low tx power */
432#define BTA_BLE_ADV_TX_POWER_MID 2 /* middle tx power */
433#define BTA_BLE_ADV_TX_POWER_UPPER 3 /* upper tx power */
434#define BTA_BLE_ADV_TX_POWER_MAX 4 /* maximum tx power */
435typedef UINT8 tBTA_BLE_ADV_TX_POWER;
436
437/* advertising instance parameters */
438typedef struct
439{
440 UINT16 adv_int_min; /* minimum adv interval */
441 UINT16 adv_int_max; /* maximum adv interval */
442 tBTA_BLE_ADV_EVT adv_type; /* adv event type */
443 tBTA_BLE_ADV_CHNL_MAP channel_map; /* adv channel map */
444 tBTA_BLE_AFP adv_filter_policy; /* advertising filter policy */
445 tBTA_BLE_ADV_TX_POWER tx_power; /* adv tx power */
446}tBTA_BLE_ADV_PARAMS;
447
The Android Open Source Project5738f832012-12-12 16:00:35 -0800448/* These are the fields returned in each device adv packet. It
449** is returned in the results callback if registered.
450*/
451typedef struct
452{
453 UINT8 conn_mode;
454 tBTA_BLE_AD_MASK ad_mask; /* mask of the valid adv data field */
455 UINT8 flag;
456 UINT8 tx_power_level;
457 UINT8 remote_name_len;
458 UINT8 *p_remote_name;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800459 tBTA_BLE_SERVICE service;
460} tBTA_BLE_INQ_DATA;
Satya Callojic4e25962014-05-10 23:46:24 -0700461
462enum
463{
Satya Calloji5725fc62015-03-31 13:24:32 -0700464 BTA_BLE_BATCH_SCAN_MODE_PASS = 1,
465 BTA_BLE_BATCH_SCAN_MODE_ACTI = 2,
466 BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3
Satya Callojic4e25962014-05-10 23:46:24 -0700467};
Satya Calloji5725fc62015-03-31 13:24:32 -0700468typedef UINT8 tBTA_BLE_BATCH_SCAN_MODE;
Satya Callojic4e25962014-05-10 23:46:24 -0700469
470enum
471{
472 BTA_BLE_DISCARD_OLD_ITEMS=0,
473 BTA_BLE_DISCARD_LOWER_RSSI_ITEMS=1
474};
475typedef UINT8 tBTA_BLE_DISCARD_RULE;
476
477enum
478{
479 BTA_BLE_ADV_SEEN_FIRST_TIME=0,
480 BTA_BLE_ADV_TRACKING_TIMEOUT=1
481};
482typedef UINT8 tBTA_BLE_ADV_CHANGE_REASON;
483
484enum
485{
486 BTA_BLE_BATCH_SCAN_ENB_EVT = 1,
487 BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2,
488 BTA_BLE_BATCH_SCAN_DATA_EVT = 3,
489 BTA_BLE_BATCH_SCAN_THRES_EVT = 4,
490 BTA_BLE_BATCH_SCAN_PARAM_EVT = 5,
491 BTA_BLE_BATCH_SCAN_DIS_EVT = 6
492};
493typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
494
495typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800496#endif
497
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800498/* BLE customer specific feature function type definitions */
499/* data type used on customer specific feature for RSSI monitoring */
500#define BTA_BLE_RSSI_ALERT_HI 0
501#define BTA_BLE_RSSI_ALERT_RANGE 1
502#define BTA_BLE_RSSI_ALERT_LO 2
503typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_TYPE;
504
Kim Schulz8372aa52015-03-25 10:39:40 +0100505#define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */
506#define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */
507#define BTA_BLE_RSSI_ALERT_RANGE_BIT BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */
508#define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800509typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_MASK;
510
511
512typedef void (tBTA_DM_BLE_RSSI_CBACK) (BD_ADDR bd_addr, tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, INT8 rssi);
513
514/* max number of filter spot for different filter type */
515#define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */
516#define BTA_DM_BLE_MAX_ADDR_FILTER BTM_BLE_MAX_ADDR_FILTER /* 8 */
517#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 +0100518#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 -0800519
520#define BTA_DM_BLE_PF_LOGIC_OR 0
521#define BTA_DM_BLE_PF_LOGIC_AND 1
522typedef UINT8 tBTA_DM_BLE_PF_LOGIC_TYPE;
523
524enum
525{
526 BTA_DM_BLE_SCAN_COND_ADD,
527 BTA_DM_BLE_SCAN_COND_DELETE,
528 BTA_DM_BLE_SCAN_COND_CLEAR = 2
529};
530typedef UINT8 tBTA_DM_BLE_SCAN_COND_OP;
531
Satya Calloji1a9247a2014-06-05 13:15:15 -0700532/* ADV payload filtering vendor specific call event */
533enum
534{
535 BTA_BLE_SCAN_PF_ENABLE_EVT = 7,
536 BTA_BLE_SCAN_PF_COND_EVT
537};
538
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800539/* filter selection bit index */
540#define BTA_DM_BLE_PF_ADDR_FILTER BTM_BLE_PF_ADDR_FILTER
Andre Eisenbachb203d472013-11-20 17:23:06 -0800541#define BTA_DM_BLE_PF_SRVC_DATA BTM_BLE_PF_SRVC_DATA
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800542#define BTA_DM_BLE_PF_SRVC_UUID BTM_BLE_PF_SRVC_UUID
543#define BTA_DM_BLE_PF_SRVC_SOL_UUID BTM_BLE_PF_SRVC_SOL_UUID
544#define BTA_DM_BLE_PF_LOCAL_NAME BTM_BLE_PF_LOCAL_NAME
545#define BTA_DM_BLE_PF_MANU_DATA BTM_BLE_PF_MANU_DATA
Andre Eisenbachb203d472013-11-20 17:23:06 -0800546#define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN
Andre Eisenbach3aa60542013-03-22 18:00:51 -0700547#define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700548#define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800549typedef UINT8 tBTA_DM_BLE_PF_COND_TYPE;
550
Andre Eisenbachb203d472013-11-20 17:23:06 -0800551typedef union
552{
553 UINT16 uuid16_mask;
554 UINT32 uuid32_mask;
555 UINT8 uuid128_mask[LEN_UUID_128];
556}tBTA_DM_BLE_PF_COND_MASK;
557
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800558typedef struct
559{
560 tBLE_BD_ADDR *p_target_addr; /* target address, if NULL, generic UUID filter */
561 tBT_UUID uuid; /* UUID condition */
562 tBTA_DM_BLE_PF_LOGIC_TYPE cond_logic; /* AND/OR */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800563 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 -0800564}tBTA_DM_BLE_PF_UUID_COND;
565
566typedef struct
567{
568 UINT8 data_len; /* <= 20 bytes */
569 UINT8 *p_data;
570}tBTA_DM_BLE_PF_LOCAL_NAME_COND;
571
572typedef struct
573{
574 UINT16 company_id; /* company ID */
575 UINT8 data_len; /* <= 20 bytes */
576 UINT8 *p_pattern;
Andre Eisenbachb203d472013-11-20 17:23:06 -0800577 UINT16 company_id_mask; /* UUID value mask */
Satya Callojic4e25962014-05-10 23:46:24 -0700578 UINT8 *p_pattern_mask; /* Manufacturer data matching mask, same length
579 as data pattern, set to all 0xff, match exact data */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800580}tBTA_DM_BLE_PF_MANU_COND;
581
Andre Eisenbachb203d472013-11-20 17:23:06 -0800582typedef struct
583{
584 UINT16 uuid; /* service ID */
585 UINT8 data_len; /* <= 20 bytes */
586 UINT8 *p_pattern;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700587 UINT8 *p_pattern_mask; /* Service data matching mask, same length
588 as data pattern, set to all 0xff, match exact data */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800589}tBTA_DM_BLE_PF_SRVC_PATTERN_COND;
590
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800591typedef union
592{
593 tBLE_BD_ADDR target_addr;
594 tBTA_DM_BLE_PF_LOCAL_NAME_COND local_name; /* lcoal name filtering */
595 tBTA_DM_BLE_PF_MANU_COND manu_data; /* manufactuer data filtering */
596 tBTA_DM_BLE_PF_UUID_COND srvc_uuid; /* service UUID filtering */
597 tBTA_DM_BLE_PF_UUID_COND solicitate_uuid; /* solicitated service UUID filtering */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800598 tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800599}tBTA_DM_BLE_PF_COND_PARAM;
600
Satya Calloji1a9247a2014-06-05 13:15:15 -0700601typedef UINT8 tBTA_DM_BLE_PF_FILT_INDEX;
602typedef UINT8 tBTA_DM_BLE_PF_AVBL_SPACE;
603
The Android Open Source Project5738f832012-12-12 16:00:35 -0800604typedef INT8 tBTA_DM_RSSI_VALUE;
605typedef UINT8 tBTA_DM_LINK_QUALITY_VALUE;
606
607
The Android Open Source Project5738f832012-12-12 16:00:35 -0800608typedef UINT8 tBTA_SIG_STRENGTH_MASK;
609
610
611/* Security Callback Events */
612#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
613#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
614#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
615#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
616#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
617#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
618#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
619#define BTA_DM_SIG_STRENGTH_EVT 7 /* Signal strength for bluetooth connection */
620#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
621#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
622#define BTA_DM_SP_CFM_REQ_EVT 10 /* Simple Pairing User Confirmation request. */
623#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
624#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
625#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
626#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
627#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
628#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
629#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
630#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
631#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
632#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
633#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
Satya Calloji444a8da2015-03-06 10:38:22 -0800634#define BTA_DM_BLE_NC_REQ_EVT 22 /* SMP Numeric Comparison request event */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800635// btla-specific ++
Satya Calloji444a8da2015-03-06 10:38:22 -0800636#define BTA_DM_SP_RMT_OOB_EXT_EVT 23 /* Simple Pairing Remote OOB Extended Data request. */
637#define BTA_DM_BLE_AUTH_CMPL_EVT 24 /* BLE Auth complete */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800638// btla-specific --
Satya Calloji444a8da2015-03-06 10:38:22 -0800639#define BTA_DM_DEV_UNPAIRED_EVT 25
640#define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */
641#define BTA_DM_LE_FEATURES_READ 27 /* Cotroller specific LE features are read */
642#define BTA_DM_ENER_INFO_READ 28 /* Energy info read */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800643typedef UINT8 tBTA_DM_SEC_EVT;
644
645/* Structure associated with BTA_DM_ENABLE_EVT */
646typedef struct
647{
The Android Open Source Project5738f832012-12-12 16:00:35 -0800648 tBTA_STATUS status;
649} tBTA_DM_ENABLE;
650
651/* Structure associated with BTA_DM_PIN_REQ_EVT */
652typedef struct
653{
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700654 /* 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 -0800655 BD_ADDR bd_addr; /* BD address peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800656 DEV_CLASS dev_class; /* Class of Device */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800657 BD_NAME bd_name; /* Name of peer device. */
Casper Bonde818d0f22015-05-21 11:08:45 +0200658 BOOLEAN min_16_digit; /* TRUE if the pin returned must be at least 16 digits */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800659} tBTA_DM_PIN_REQ;
660
661/* BLE related definition */
662
663#define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10)
664#define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x))
665#define BTA_DM_AUTH_SMP_PASSKEY_FAIL BTA_DM_AUTH_CONVERT_SMP_CODE (SMP_PASSKEY_ENTRY_FAIL)
666#define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL)
667#define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL)
668#define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR)
669#define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT)
670#define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE)
671#define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD)
672#define BTA_DM_AUTH_SMP_UNKNOWN_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN)
673#define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS)
Satya Calloji444a8da2015-03-06 10:38:22 -0800674#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 -0800675#define BTA_DM_AUTH_SMP_INTERNAL_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR)
676#define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP)
677#define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL)
678#define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL)
679#define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY)
680#define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL)
681#define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT)
682
683/* connection parameter boundary value and dummy value */
684#define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN
685#define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX
686#define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN
687#define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX
688#define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN
689#define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX
690#define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX
691#define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN
692#define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX
693#define BTA_DM_BLE_CONN_PARAM_UNDEF BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be overwritten */
694
695
696#define BTA_LE_KEY_PENC BTM_LE_KEY_PENC /* encryption information of peer device */
697#define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */
698#define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */
699#define BTA_LE_KEY_LENC BTM_LE_KEY_LENC /* master role security information:div */
700#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
701#define BTA_LE_KEY_LCSRK BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
702typedef UINT8 tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
703
704
705typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS ;
706typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS;
707typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS ;
708typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS ;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800709typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS ;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800710
711typedef union
712{
713 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */
714 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800715 tBTA_LE_PID_KEYS pid_key; /* peer device ID key */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800716 tBTA_LE_LENC_KEYS lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/
717 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/
Satya Calloji444a8da2015-03-06 10:38:22 -0800718 tBTA_LE_PID_KEYS lid_key; /* local device ID key for the particular remote */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800719}tBTA_LE_KEY_VALUE;
720
721#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
722#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
723typedef UINT8 tBTA_DM_BLE_LOCAL_KEY_MASK;
724
725typedef struct
726{
727 BT_OCTET16 ir;
728 BT_OCTET16 irk;
729 BT_OCTET16 dhk;
730}tBTA_BLE_LOCAL_ID_KEYS;
731
732#define BTA_DM_SEC_GRANTED BTA_SUCCESS
733#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
734#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
735typedef UINT8 tBTA_DM_BLE_SEC_GRANT;
736
737
738#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
739#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
740#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
741typedef UINT8 tBTA_DM_BLE_CONN_TYPE;
742
743typedef BOOLEAN (tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name);
744
745/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
746typedef struct
747{
748 BD_ADDR bd_addr; /* peer address */
749 BD_NAME bd_name; /* peer device name */
750} tBTA_DM_BLE_SEC_REQ;
751
752typedef struct
753{
754 BD_ADDR bd_addr; /* peer address */
755 tBTM_LE_KEY_TYPE key_type;
Satya Calloji444a8da2015-03-06 10:38:22 -0800756 tBTM_LE_KEY_VALUE *p_key_value;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800757}tBTA_DM_BLE_KEY;
758
759/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
760typedef struct
761{
762 BD_ADDR bd_addr; /* BD address peer device. */
763 BD_NAME bd_name; /* Name of peer device. */
764 BOOLEAN key_present; /* Valid link key value in key element */
765 LINK_KEY key; /* Link key associated with peer device. */
766 UINT8 key_type; /* The type of Link Key */
767 BOOLEAN success; /* TRUE of authentication succeeded, FALSE if failed. */
768 UINT8 fail_reason; /* The HCI reason/error code for when success=FALSE */
Andre Eisenbach77668212015-05-06 21:49:35 -0700769 tBLE_ADDR_TYPE addr_type; /* Peer device address type */
Chaojing Sune2805532015-04-22 13:40:21 -0700770 tBT_DEVICE_TYPE dev_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800771} tBTA_DM_AUTH_CMPL;
772
773
774/* Structure associated with BTA_DM_AUTHORIZE_EVT */
775typedef struct
776{
777 BD_ADDR bd_addr; /* BD address peer device. */
778 BD_NAME bd_name; /* Name of peer device. */
779 tBTA_SERVICE_ID service; /* Service ID to authorize. */
780// btla-specific ++
781 DEV_CLASS dev_class;
782// btla-specific --
783} tBTA_DM_AUTHORIZE;
784
785/* Structure associated with BTA_DM_LINK_UP_EVT */
786typedef struct
787{
788 BD_ADDR bd_addr; /* BD address peer device. */
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700789#if BLE_INCLUDED == TRUE
790 tBTA_TRANSPORT link_type;
791#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800792} tBTA_DM_LINK_UP;
793
794/* Structure associated with BTA_DM_LINK_DOWN_EVT */
795typedef struct
796{
797 BD_ADDR bd_addr; /* BD address peer device. */
798 UINT8 status; /* connection open/closed */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800799 BOOLEAN is_removed; /* TRUE if device is removed when link is down */
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700800#if BLE_INCLUDED == TRUE
801 tBTA_TRANSPORT link_type;
802#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800803} tBTA_DM_LINK_DOWN;
804
805/* Structure associated with BTA_DM_ROLE_CHG_EVT */
806typedef struct
807{
808 BD_ADDR bd_addr; /* BD address peer device. */
809 UINT8 new_role; /* the new connection role */
810} tBTA_DM_ROLE_CHG;
811
The Android Open Source Project5738f832012-12-12 16:00:35 -0800812/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
813typedef struct
814{
815 UINT8 level; /* when paging or inquiring, level is 10.
816 Otherwise, the number of ACL links */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800817 UINT8 level_flags; /* indicates individual flags */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800818} tBTA_DM_BUSY_LEVEL;
819
Satya Calloji444a8da2015-03-06 10:38:22 -0800820#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
821#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
822#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
823#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
824#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
825#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
826#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800827typedef tBTM_IO_CAP tBTA_IO_CAP;
828
829#define BTA_AUTH_SP_NO BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single Profile/non-bonding
830 Numeric comparison with automatic accept allowed */
831#define BTA_AUTH_SP_YES BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding
832 Use IO Capabilities to determine authentication procedure */
833#define BTA_AUTH_AP_NO BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated bonding
834 Numeric comparison with automatic accept allowed */
835#define BTA_AUTH_AP_YES BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated bonding
836 Use IO Capabilities to determine authentication procedure */
837#define BTA_AUTH_SPGB_NO BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general bonding
838 Numeric comparison with automatic accept allowed */
839#define BTA_AUTH_SPGB_YES BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general bonding
840 Use IO Capabilities to determine authentication procedure */
841typedef tBTM_AUTH_REQ tBTA_AUTH_REQ;
842
843#define BTA_AUTH_DD_BOND BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */
844#define BTA_AUTH_GEN_BOND BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */
845#define BTA_AUTH_BONDS BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */
846
847#define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/
848#define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */
849#define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */
Satya Calloji444a8da2015-03-06 10:38:22 -0800850
851#define BTA_LE_AUTH_REQ_SC_ONLY BTM_LE_AUTH_REQ_SC_ONLY /* 1 << 3 */
852#define BTA_LE_AUTH_REQ_SC_BOND BTM_LE_AUTH_REQ_SC_BOND /* 1001 */
853#define BTA_LE_AUTH_REQ_SC_MITM BTM_LE_AUTH_REQ_SC_MITM /* 1100 */
854#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 -0800855typedef tBTM_LE_AUTH_REQ tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */
856
857#define BTA_OOB_NONE BTM_OOB_NONE
858#define BTA_OOB_PRESENT BTM_OOB_PRESENT
859#if BTM_OOB_INCLUDED == TRUE
860#define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN
861#endif
862typedef tBTM_OOB_DATA tBTA_OOB_DATA;
863
864/* Structure associated with BTA_DM_SP_CFM_REQ_EVT */
865typedef struct
866{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800867 /* 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 -0800868 BD_ADDR bd_addr; /* peer address */
869 DEV_CLASS dev_class; /* peer CoD */
870 BD_NAME bd_name; /* peer device name */
871 UINT32 num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */
872 BOOLEAN just_works; /* TRUE, if "Just Works" association model */
873 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
874 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
875 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
876 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */
877} tBTA_DM_SP_CFM_REQ;
878
879enum
880{
881 BTA_SP_KEY_STARTED, /* passkey entry started */
882 BTA_SP_KEY_ENTERED, /* passkey digit entered */
883 BTA_SP_KEY_ERASED, /* passkey digit erased */
884 BTA_SP_KEY_CLEARED, /* passkey cleared */
885 BTA_SP_KEY_COMPLT /* passkey entry completed */
886};
887typedef UINT8 tBTA_SP_KEY_TYPE;
888
889/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
890typedef struct
891{
892 BD_ADDR bd_addr; /* peer address */
893 tBTA_SP_KEY_TYPE notif_type;
894}tBTA_DM_SP_KEY_PRESS;
895
896/* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */
897typedef struct
898{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800899 /* 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 -0800900 BD_ADDR bd_addr; /* peer address */
901 DEV_CLASS dev_class; /* peer CoD */
902 BD_NAME bd_name; /* peer device name */
903 UINT32 passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */
904} tBTA_DM_SP_KEY_NOTIF;
905
906/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
907typedef struct
908{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800909 /* 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 -0800910 BD_ADDR bd_addr; /* peer address */
911 DEV_CLASS dev_class; /* peer CoD */
912 BD_NAME bd_name; /* peer device name */
913} tBTA_DM_SP_RMT_OOB;
914
915/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
916typedef struct
917{
918 tBTA_STATUS result; /* TRUE of bond cancel succeeded, FALSE if failed. */
919} tBTA_DM_BOND_CANCEL_CMPL;
920
921/* Union of all security callback structures */
922typedef union
923{
924 tBTA_DM_ENABLE enable; /* BTA enabled */
925 tBTA_DM_PIN_REQ pin_req; /* PIN request. */
926 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */
927 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */
928 tBTA_DM_LINK_UP link_up; /* ACL connection down event */
929 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800930 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
931 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */
932 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */
933 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */
934 tBTA_DM_BOND_CANCEL_CMPL bond_cancel_cmpl; /* Bond Cancel Complete indication */
935 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */
936 tBTA_DM_ROLE_CHG role_chg; /* role change event */
937 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */
938 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */
939 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */
940 BT_OCTET16 ble_er; /* ER event data */
941} tBTA_DM_SEC;
942
943/* Security callback */
944typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
945
Wei Wanga6ce7752014-05-20 06:30:32 +0000946#define BTA_BLE_MULTI_ADV_ILLEGAL 0
947
948/* multi adv callback event */
949#define BTA_BLE_MULTI_ADV_ENB_EVT 1
950#define BTA_BLE_MULTI_ADV_DISABLE_EVT 2
951#define BTA_BLE_MULTI_ADV_PARAM_EVT 3
952#define BTA_BLE_MULTI_ADV_DATA_EVT 4
953
954typedef UINT8 tBTA_BLE_MULTI_ADV_EVT;
955
956/* multi adv callback */
957typedef void (tBTA_BLE_MULTI_ADV_CBACK)(tBTA_BLE_MULTI_ADV_EVT event,
958 UINT8 inst_id, void *p_ref, tBTA_STATUS status);
Satya Callojie5ba8842014-07-03 17:18:02 -0700959typedef UINT32 tBTA_DM_BLE_REF_VALUE;
Wei Wanga6ce7752014-05-20 06:30:32 +0000960
Satya Calloji1a9247a2014-06-05 13:15:15 -0700961#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
962#define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG
963typedef UINT8 tBTA_DM_BLE_PF_EVT;
964
Satya Calloji1a9247a2014-06-05 13:15:15 -0700965#define BTA_DM_BLE_PF_ENABLE 1
966#define BTA_DM_BLE_PF_CONFIG 2
967typedef UINT8 tBTA_DM_BLE_PF_ACTION;
968
Satya Calloji1a9247a2014-06-05 13:15:15 -0700969/* Config callback */
970typedef void (tBTA_DM_BLE_PF_CFG_CBACK) (tBTA_DM_BLE_PF_ACTION action,
971 tBTA_DM_BLE_PF_COND_TYPE cfg_cond,
972 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, tBTA_STATUS status,
973 tBTA_DM_BLE_REF_VALUE ref_value);
974/* Param callback */
975typedef void (tBTA_DM_BLE_PF_PARAM_CBACK) (UINT8 action_type, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
976 tBTA_DM_BLE_REF_VALUE ref_value, tBTA_STATUS status);
977
978/* Status callback */
Satya Callojie5ba8842014-07-03 17:18:02 -0700979typedef void (tBTA_DM_BLE_PF_STATUS_CBACK) (UINT8 action, tBTA_STATUS status,
980 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700981
982
983#define BTA_DM_BLE_PF_BRDCAST_ADDR_FILT 1
984#define BTA_DM_BLE_PF_SERV_DATA_CHG_FILT 2
985#define BTA_DM_BLE_PF_SERV_UUID 4
986#define BTA_DM_BLE_PF_SERV_SOLC_UUID 8
987#define BTA_DM_BLE_PF_LOC_NAME_CHECK 16
988#define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32
989#define BTA_DM_BLE_PF_SERV_DATA_CHECK 64
990typedef UINT16 tBTA_DM_BLE_PF_FEAT_SEL;
991
992#define BTA_DM_BLE_PF_LIST_LOGIC_OR 1
993#define BTA_DM_BLE_PF_LIST_LOGIC_AND 2
994typedef UINT16 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
995
996#define BTA_DM_BLE_PF_FILT_LOGIC_OR 0
997#define BTA_DM_BLE_PF_FILT_LOGIC_AND 1
998typedef UINT16 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
999
1000typedef UINT8 tBTA_DM_BLE_PF_RSSI_THRESHOLD;
1001typedef UINT8 tBTA_DM_BLE_PF_DELIVERY_MODE;
1002typedef UINT16 tBTA_DM_BLE_PF_TIMEOUT;
1003typedef UINT8 tBTA_DM_BLE_PF_TIMEOUT_CNT;
Satya Callojif5387072015-02-09 17:40:52 -08001004typedef UINT16 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES;
Satya Calloji1a9247a2014-06-05 13:15:15 -07001005
1006typedef struct
1007{
1008 tBTA_DM_BLE_PF_FEAT_SEL feat_seln;
1009 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE list_logic_type;
1010 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE filt_logic_type;
1011 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_high_thres;
1012 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_low_thres;
1013 tBTA_DM_BLE_PF_DELIVERY_MODE dely_mode;
1014 tBTA_DM_BLE_PF_TIMEOUT found_timeout;
1015 tBTA_DM_BLE_PF_TIMEOUT lost_timeout;
1016 tBTA_DM_BLE_PF_TIMEOUT_CNT found_timeout_cnt;
Satya Callojif5387072015-02-09 17:40:52 -08001017 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES num_of_tracking_entries;
Satya Calloji1a9247a2014-06-05 13:15:15 -07001018} tBTA_DM_BLE_PF_FILT_PARAMS;
1019
The Android Open Source Project5738f832012-12-12 16:00:35 -08001020/* Search callback events */
1021#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
1022#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
1023#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
1024#define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based servoce on a peer device. */
1025#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
1026#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
1027#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
1028
1029typedef UINT8 tBTA_DM_SEARCH_EVT;
1030
1031#define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
1032
1033/* Structure associated with BTA_DM_INQ_RES_EVT */
1034typedef struct
1035{
1036 BD_ADDR bd_addr; /* BD address peer device. */
1037 DEV_CLASS dev_class; /* Device class of peer device. */
1038 BOOLEAN remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
1039 /* If the device name is known to application BTA skips the remote name request */
1040 BOOLEAN is_limited; /* TRUE, if the limited inquiry bit is set in the CoD */
1041 INT8 rssi; /* The rssi value */
1042 UINT8 *p_eir; /* received EIR */
1043#if (BLE_INCLUDED == TRUE)
1044 UINT8 inq_result_type;
1045 UINT8 ble_addr_type;
1046 tBTM_BLE_EVT_TYPE ble_evt_type;
1047 tBT_DEVICE_TYPE device_type;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001048 UINT8 flag;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001049#endif
1050
1051} tBTA_DM_INQ_RES;
1052
1053/* Structure associated with BTA_DM_INQ_CMPL_EVT */
1054typedef struct
1055{
1056 UINT8 num_resps; /* Number of inquiry responses. */
1057} tBTA_DM_INQ_CMPL;
1058
1059/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
1060typedef struct
1061{
1062 BD_ADDR bd_addr; /* BD address peer device. */
1063 UINT8 num_record; /* Number of DI record */
1064 tBTA_STATUS result;
1065} tBTA_DM_DI_DISC_CMPL;
1066
1067/* Structure associated with BTA_DM_DISC_RES_EVT */
1068typedef struct
1069{
1070 BD_ADDR bd_addr; /* BD address peer device. */
1071 BD_NAME bd_name; /* Name of peer device. */
1072 tBTA_SERVICE_MASK services; /* Services found on peer device. */
1073// btla-specific ++
1074 UINT8 * p_raw_data; /* Raw data for discovery DB */
1075 UINT32 raw_data_size; /* size of raw data */
1076 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
1077 UINT32 num_uuids;
1078 UINT8 *p_uuid_list;
1079// btla-specific --
1080 tBTA_STATUS result;
1081} tBTA_DM_DISC_RES;
1082
1083/* Structure associated with tBTA_DM_DISC_BLE_RES */
1084typedef struct
1085{
1086 BD_ADDR bd_addr; /* BD address peer device. */
1087 BD_NAME bd_name; /* Name of peer device. */
1088 tBT_UUID service; /* GATT based Services UUID found on peer device. */
1089} tBTA_DM_DISC_BLE_RES;
1090
1091
1092/* Union of all search callback structures */
1093typedef union
1094{
1095 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
1096 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
1097 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
1098 tBTA_DM_DISC_BLE_RES disc_ble_res; /* discovery result for GATT based service */
1099 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
1100
1101} tBTA_DM_SEARCH;
1102
1103/* Search callback */
1104typedef void (tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data);
1105
1106/* Execute call back */
1107typedef void (tBTA_DM_EXEC_CBACK) (void * p_param);
1108
1109/* Encryption callback*/
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001110typedef 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 -08001111
1112#if BLE_INCLUDED == TRUE
1113#define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE
1114#define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT
1115#define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM
1116#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
1117typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
Satya Callojic4e25962014-05-10 23:46:24 -07001118
Satya Callojie5ba8842014-07-03 17:18:02 -07001119typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
1120typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
1121typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
1122typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED;
1123
1124#define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */
1125#define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */
1126#define BTA_DM_CONTRL_SCAN 2 /* Scan state - paging/inquiry/trying to connect*/
1127#define BTA_DM_CONTRL_IDLE 3 /* Idle state - page scan, LE advt, inquiry scan */
1128
1129typedef UINT8 tBTA_DM_CONTRL_STATE;
1130
Satya Callojif5387072015-02-09 17:40:52 -08001131typedef UINT8 tBTA_DM_BLE_ADV_STATE;
1132typedef UINT8 tBTA_DM_BLE_ADV_INFO_PRESENT;
1133typedef UINT8 tBTA_DM_BLE_RSSI_VALUE;
1134typedef UINT16 tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
1135
1136typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA;
Satya Callojie5ba8842014-07-03 17:18:02 -07001137
Satya Callojic4e25962014-05-10 23:46:24 -07001138typedef void (tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojie5ba8842014-07-03 17:18:02 -07001139
Satya Calloji1a9247a2014-06-05 13:15:15 -07001140typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, UINT8 report_format,
Satya Callojic4e25962014-05-10 23:46:24 -07001141 UINT8 num_records, UINT16 data_len,
1142 UINT8* p_rep_data, tBTA_STATUS status);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001143
Satya Callojie5ba8842014-07-03 17:18:02 -07001144typedef void (tBTA_BLE_SCAN_SETUP_CBACK) (tBTA_BLE_BATCH_SCAN_EVT evt,
1145 tBTA_DM_BLE_REF_VALUE ref_value,
Satya Callojic4e25962014-05-10 23:46:24 -07001146 tBTA_STATUS status);
1147
Satya Calloji1acb61c2014-06-14 23:16:18 -07001148typedef void (tBTA_BLE_TRACK_ADV_CMPL_CBACK)(int action, tBTA_STATUS status,
Satya Callojie5ba8842014-07-03 17:18:02 -07001149 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
1150 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001151
Satya Callojif5387072015-02-09 17:40:52 -08001152typedef void (tBTA_BLE_TRACK_ADV_CBACK)(tBTA_DM_BLE_TRACK_ADV_DATA *p_adv_data);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001153
Satya Callojie5ba8842014-07-03 17:18:02 -07001154typedef void (tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
1155 tBTA_DM_BLE_RX_TIME_MS rx_time,
1156 tBTA_DM_BLE_IDLE_TIME_MS idle_time,
1157 tBTA_DM_BLE_ENERGY_USED energy_used,
1158 tBTA_DM_CONTRL_STATE ctrl_state,
1159 tBTA_STATUS status);
1160
The Android Open Source Project5738f832012-12-12 16:00:35 -08001161#else
1162typedef UINT8 tBTA_DM_BLE_SEC_ACT;
1163#endif
1164
1165/* Maximum service name length */
1166#define BTA_SERVICE_NAME_LEN 35
1167#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
1168#define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN
1169
1170
1171/* link policy masks */
1172#define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH
1173#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
1174#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
1175#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
1176typedef UINT16 tBTA_DM_LP_MASK;
1177
1178/* power mode actions */
1179#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
1180#define BTA_DM_PM_PARK 0x10 /* prefers park mode */
1181#define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */
1182#define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */
1183#define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */
1184#define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */
1185#define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */
1186#define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */
1187#define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */
1188#define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */
1189#define BTA_DM_PM_SNIFF_USER0 0x28 /* prefers user-defined sniff0 mode (testtool only) */
1190#define BTA_DM_PM_SNIFF_USER1 0x29 /* prefers user-defined sniff1 mode (testtool only) */
1191#define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */
1192#define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -07001193#define BTA_DM_PM_SUSPEND 0x04 /* prefers suspend mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001194#define BTA_DM_PM_NO_PREF 0x01 /* service has no prefernce on power mode setting. eg. connection to service got closed */
1195
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -07001196typedef UINT8 tBTA_DM_PM_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001197
1198/* index to bta_dm_ssr_spec */
1199#define BTA_DM_PM_SSR0 0
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001200#define BTA_DM_PM_SSR1 1 /* BTA_DM_PM_SSR1 will be dedicated for
1201 HH SSR setting entry, no other profile can use it */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001202#define BTA_DM_PM_SSR2 2
1203#define BTA_DM_PM_SSR3 3
1204#define BTA_DM_PM_SSR4 4
1205#define BTA_DM_PM_SSR5 5
1206#define BTA_DM_PM_SSR6 6
1207
1208#define BTA_DM_PM_NUM_EVTS 9
1209
1210#ifndef BTA_DM_PM_PARK_IDX
1211#define BTA_DM_PM_PARK_IDX 5 /* the actual index to bta_dm_pm_md[] for PARK mode */
1212#endif
1213
Adam Hampson63399d92014-05-19 16:23:45 -07001214#ifndef BTA_DM_PM_SNIFF_A2DP_IDX
1215#define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF
1216#endif
1217
1218#ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX
1219#define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF2
1220#endif
1221
1222#ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX
1223#define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3
1224#endif
1225
1226#ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX
1227#define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF4
1228#endif
1229
1230#ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX
1231#define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF2
1232#endif
1233
1234#ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX
1235#define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF2
1236#endif
1237
1238#ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX
1239#define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF2
1240#endif
1241
1242
1243#ifndef BTA_DM_PM_HH_OPEN_DELAY
1244#define BTA_DM_PM_HH_OPEN_DELAY 30000
1245#endif
1246
1247#ifndef BTA_DM_PM_HH_ACTIVE_DELAY
1248#define BTA_DM_PM_HH_ACTIVE_DELAY 30000
1249#endif
1250
1251#ifndef BTA_DM_PM_HH_IDLE_DELAY
1252#define BTA_DM_PM_HH_IDLE_DELAY 30000
1253#endif
1254
1255/* The Sniff Parameters defined below must be ordered from highest
1256 * latency (biggest interval) to lowest latency. If there is a conflict
1257 * among the connected services the setting with the lowest latency will
1258 * be selected. If a device should override a sniff parameter then it
1259 * must insure that order is maintained.
1260 */
1261#ifndef BTA_DM_PM_SNIFF_MAX
1262#define BTA_DM_PM_SNIFF_MAX 800
1263#define BTA_DM_PM_SNIFF_MIN 400
1264#define BTA_DM_PM_SNIFF_ATTEMPT 4
1265#define BTA_DM_PM_SNIFF_TIMEOUT 1
1266#endif
1267
1268#ifndef BTA_DM_PM_SNIFF1_MAX
1269#define BTA_DM_PM_SNIFF1_MAX 400
1270#define BTA_DM_PM_SNIFF1_MIN 200
1271#define BTA_DM_PM_SNIFF1_ATTEMPT 4
1272#define BTA_DM_PM_SNIFF1_TIMEOUT 1
1273#endif
1274
1275#ifndef BTA_DM_PM_SNIFF2_MAX
1276#define BTA_DM_PM_SNIFF2_MAX 180
1277#define BTA_DM_PM_SNIFF2_MIN 150
1278#define BTA_DM_PM_SNIFF2_ATTEMPT 4
1279#define BTA_DM_PM_SNIFF2_TIMEOUT 1
1280#endif
1281
1282#ifndef BTA_DM_PM_SNIFF3_MAX
1283#define BTA_DM_PM_SNIFF3_MAX 150
1284#define BTA_DM_PM_SNIFF3_MIN 50
1285#define BTA_DM_PM_SNIFF3_ATTEMPT 4
1286#define BTA_DM_PM_SNIFF3_TIMEOUT 1
1287#endif
1288
1289#ifndef BTA_DM_PM_SNIFF4_MAX
1290#define BTA_DM_PM_SNIFF4_MAX 54
1291#define BTA_DM_PM_SNIFF4_MIN 30
1292#define BTA_DM_PM_SNIFF4_ATTEMPT 4
1293#define BTA_DM_PM_SNIFF4_TIMEOUT 1
1294#endif
1295
1296#ifndef BTA_DM_PM_PARK_MAX
1297#define BTA_DM_PM_PARK_MAX 800
1298#define BTA_DM_PM_PARK_MIN 400
1299#define BTA_DM_PM_PARK_ATTEMPT 0
1300#define BTA_DM_PM_PARK_TIMEOUT 0
1301#endif
1302
1303
The Android Open Source Project5738f832012-12-12 16:00:35 -08001304/* Switch callback events */
1305#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
1306
1307typedef UINT8 tBTA_DM_SWITCH_EVT;
1308typedef void (tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, tBTA_STATUS status);
1309
1310/* Audio routing out configuration */
1311#define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */
1312#define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */
1313#define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */
1314#define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */
1315#define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */
1316#define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */
1317#define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */
1318#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
1319#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
1320
1321typedef UINT8 tBTA_DM_ROUTE_PATH;
1322
1323
1324/* Device Identification (DI) data structure
1325*/
1326/* Used to set the DI record */
1327typedef tSDP_DI_RECORD tBTA_DI_RECORD;
1328/* Used to get the DI record */
1329typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD;
1330/* SDP discovery database */
1331typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB;
1332
1333#ifndef BTA_DI_NUM_MAX
1334#define BTA_DI_NUM_MAX 3
1335#endif
1336
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001337/* Device features mask definitions */
1338#define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE
1339#define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001340/* ACL type
1341*/
1342#define BTA_DM_LINK_TYPE_BR_EDR 0x01
1343#define BTA_DM_LINK_TYPE_LE 0x02
1344#define BTA_DM_LINK_TYPE_ALL 0xFF
1345typedef UINT8 tBTA_DM_LINK_TYPE;
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001346
Satya Calloji6e2d9db2014-07-08 16:18:58 -07001347#define IMMEDIATE_DELY_MODE 0x00
1348#define ONFOUND_DELY_MODE 0x01
1349#define BATCH_DELY_MODE 0x02
1350#define ALLOW_ALL_FILTER 0x00
1351#define LOWEST_RSSI_VALUE 129
1352
The Android Open Source Project5738f832012-12-12 16:00:35 -08001353/*****************************************************************************
1354** External Function Declarations
1355*****************************************************************************/
1356#ifdef __cplusplus
1357extern "C"
1358{
1359#endif
1360
1361/*******************************************************************************
1362**
1363** Function BTA_EnableBluetooth
1364**
1365** Description This function initializes BTA and prepares BTA and the
1366** Bluetooth protocol stack for use. This function is
1367** typically called at startup or when Bluetooth services
1368** are required by the phone. This function must be called
1369** before calling any other API function.
1370**
1371**
1372** Returns BTA_SUCCESS if successful.
1373** BTA_FAIL if internal failure.
1374**
1375*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001376extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001377
1378/*******************************************************************************
1379**
1380** Function BTA_DisableBluetooth
1381**
1382** Description This function disables BTA and the Bluetooth protocol
1383** stack. It is called when BTA is no longer being used
1384** by any application in the system.
1385**
1386**
1387** Returns void
1388**
1389*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001390extern tBTA_STATUS BTA_DisableBluetooth(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001391
1392/*******************************************************************************
1393**
1394** Function BTA_EnableTestMode
1395**
1396** Description Enables bluetooth device under test mode
1397**
1398**
1399** Returns tBTA_STATUS
1400**
1401*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001402extern tBTA_STATUS BTA_EnableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001403
1404/*******************************************************************************
1405**
1406** Function BTA_DisableTestMode
1407**
1408** Description Disable bluetooth device under test mode
1409**
1410**
1411** Returns None
1412**
1413*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001414extern void BTA_DisableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001415
1416/*******************************************************************************
1417**
1418** Function BTA_DmSetDeviceName
1419**
1420** Description This function sets the Bluetooth name of the local device.
1421**
1422**
1423** Returns void
1424**
1425*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001426extern void BTA_DmSetDeviceName(char *p_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001427
1428/*******************************************************************************
1429**
1430** Function BTA_DmSetVisibility
1431**
1432** Description This function sets the Bluetooth connectable,discoverable,
1433** pairable and conn paired only modesmodes of the local device.
1434** This controls whether other Bluetooth devices can find and connect to
1435** the local device.
1436**
1437**
1438** Returns void
1439**
1440*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001441extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, UINT8 pairable_mode, UINT8 conn_filter);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001442
1443/*******************************************************************************
1444**
1445** Function BTA_DmSearch
1446**
1447** Description This function searches for peer Bluetooth devices. It
1448** first performs an inquiry; for each device found from the
1449** inquiry it gets the remote name of the device. If
1450** parameter services is nonzero, service discovery will be
1451** performed on each device for the services specified.
1452**
1453**
1454** Returns void
1455**
1456*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001457extern void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services,
1458 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001459
1460/*******************************************************************************
1461**
1462** Function BTA_DmSearchCancel
1463**
1464** Description This function cancels a search that has been initiated
1465** by calling BTA_DmSearch().
1466**
1467**
1468** Returns void
1469**
1470*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001471extern void BTA_DmSearchCancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001472
1473/*******************************************************************************
1474**
1475** Function BTA_DmDiscover
1476**
1477** Description This function performs service discovery for the services
1478** of a particular peer device.
1479**
1480**
1481** Returns void
1482**
1483*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001484extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
1485 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001486
1487// btla-specific ++
1488/*******************************************************************************
1489**
1490** Function BTA_DmDiscoverUUID
1491**
1492** Description This function performs service discovery for the services
1493** of a particular peer device.
1494**
1495**
1496** Returns void
1497**
1498*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001499extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
1500 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001501
1502/*******************************************************************************
1503**
1504** Function BTA_DmGetCachedRemoteName
1505**
1506** Description Retieve cached remote name if available
1507**
1508** Returns BTA_SUCCESS if cached name was retrieved
1509** BTA_FAILURE if cached name is not available
1510**
1511*******************************************************************************/
1512tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, UINT8 **pp_cached_name);
1513// btla-specific --
1514
1515/*******************************************************************************
1516**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001517** Function BTA_DmBond
1518**
1519** Description This function initiates a bonding procedure with a peer
1520** device. The bonding procedure enables authentication
1521** and optionally encryption on the Bluetooth link.
1522**
1523**
1524** Returns void
1525**
1526*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001527extern void BTA_DmBond(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001528
1529/*******************************************************************************
1530**
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001531** Function BTA_DmBondByTransport
1532**
1533** Description This function initiates a bonding procedure with a peer
1534** device by designated transport. The bonding procedure enables
1535** authentication and optionally encryption on the Bluetooth link.
1536**
1537**
1538** Returns void
1539**
1540*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001541extern void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001542
1543
1544/*******************************************************************************
1545**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001546** Function BTA_DmBondCancel
1547**
1548** Description This function cancels a bonding procedure with a peer
1549** device.
1550**
1551**
1552** Returns void
1553**
1554*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001555extern void BTA_DmBondCancel(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001556
1557/*******************************************************************************
1558**
1559** Function BTA_DmPinReply
1560**
1561** Description This function provides a PIN when one is requested by DM
1562** during a bonding procedure. The application should call
1563** this function after the security callback is called with
1564** a BTA_DM_PIN_REQ_EVT.
1565**
1566**
1567** Returns void
1568**
1569*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001570extern void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len,
1571 UINT8 *p_pin);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001572
1573#if (BTM_OOB_INCLUDED == TRUE)
1574/*******************************************************************************
1575**
1576** Function BTA_DmLocalOob
1577**
1578** Description This function retrieves the OOB data from local controller.
1579** The result is reported by bta_dm_co_loc_oob().
1580**
1581** Returns void
1582**
1583*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001584extern void BTA_DmLocalOob(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001585#endif /* BTM_OOB_INCLUDED */
1586
1587/*******************************************************************************
1588**
1589** Function BTA_DmConfirm
1590**
1591** Description This function accepts or rejects the numerical value of the
1592** Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT
1593**
1594** Returns void
1595**
1596*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001597extern void BTA_DmConfirm(BD_ADDR bd_addr, BOOLEAN accept);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001598
1599/*******************************************************************************
1600**
1601** Function BTA_DmAddDevice
1602**
1603** Description This function adds a device to the security database list
1604** of peer devices. This function would typically be called
1605** at system startup to initialize the security database with
1606** known peer devices. This is a direct execution function
1607** that may lock task scheduling on some platforms.
1608**
1609** Returns void
1610**
1611*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001612extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class,
1613 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
1614 BOOLEAN is_trusted, UINT8 key_type,
Casper Bonde818d0f22015-05-21 11:08:45 +02001615 tBTA_IO_CAP io_cap, UINT8 pin_length);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001616
1617/*******************************************************************************
1618**
1619** Function BTA_DmRemoveDevice
1620**
1621** Description This function removes a device from the security database.
1622** This is a direct execution function that may lock task
1623** scheduling on some platforms.
1624**
1625**
1626** Returns BTA_SUCCESS if successful.
1627** BTA_FAIL if operation failed.
1628**
1629*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001630extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001631
1632/*******************************************************************************
1633**
1634** Function BTA_GetEirService
1635**
1636** Description This function is called to get BTA service mask from EIR.
1637**
1638** Parameters p_eir - pointer of EIR significant part
1639** p_services - return the BTA service mask
1640**
1641** Returns None
1642**
1643*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001644extern void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001645
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001646/*******************************************************************************
1647**
1648** Function BTA_DmGetConnectionState
1649**
1650** Description Returns whether the remote device is currently connected.
1651**
1652** Returns 0 if the device is NOT connected.
1653**
1654*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001655extern UINT16 BTA_DmGetConnectionState( BD_ADDR bd_addr );
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001656
The Android Open Source Project5738f832012-12-12 16:00:35 -08001657
1658/*******************************************************************************
1659**
1660** Function BTA_DmSetLocalDiRecord
1661**
1662** Description This function adds a DI record to the local SDP database.
1663**
1664** Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1665**
1666*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001667extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
1668 UINT32 *p_handle );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001669
1670/*******************************************************************************
1671**
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001672**
1673** Function BTA_DmCloseACL
1674**
1675** Description This function force to close an ACL connection and remove the
1676** device from the security database list of known devices.
1677**
1678** Parameters: bd_addr - Address of the peer device
1679** remove_dev - remove device or not after link down
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001680** transport - which transport to close
1681
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001682**
1683** Returns void.
1684**
1685*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001686extern void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001687
1688/*******************************************************************************
1689**
1690** Function bta_dmexecutecallback
1691**
1692** Description This function will request BTA to execute a call back in the context of BTU task
1693** This API was named in lower case because it is only intended
1694** for the internal customers(like BTIF).
1695**
1696** Returns void
1697**
1698*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001699extern void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK* p_callback, void * p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001700
1701#if (BTM_SCO_HCI_INCLUDED == TRUE)
1702/*******************************************************************************
1703**
1704** Function BTA_DmPcmInitSamples
1705**
1706** Description initialize the down sample converter.
1707**
1708** src_sps: original samples per second (source audio data)
1709** (ex. 44100, 48000)
1710** bits: number of bits per pcm sample (16)
1711** n_channels: number of channels (i.e. mono(1), stereo(2)...)
1712**
1713** Returns none
1714**
1715*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001716extern void BTA_DmPcmInitSamples (UINT32 src_sps, UINT32 bits, UINT32 n_channels);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001717
1718/**************************************************************************************
1719** Function BTA_DmPcmResample
1720**
1721** Description Down sampling utility to convert higher sampling rate into 8K/16bits
1722** PCM samples.
1723**
1724** Parameters p_src: pointer to the buffer where the original sampling PCM
1725** are stored.
1726** in_bytes: Length of the input PCM sample buffer in byte.
1727** p_dst: pointer to the buffer which is to be used to store
1728** the converted PCM samples.
1729**
1730**
1731** Returns INT32: number of samples converted.
1732**
1733**************************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001734extern INT32 BTA_DmPcmResample (void *p_src, UINT32 in_bytes, void *p_dst);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001735#endif
1736
1737#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
1738/* BLE related API functions */
1739/*******************************************************************************
1740**
1741** Function BTA_DmBleSecurityGrant
1742**
1743** Description Grant security request access.
1744**
1745** Parameters: bd_addr - BD address of the peer
1746** res - security grant status.
1747**
1748** Returns void
1749**
1750*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001751extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001752
1753
1754
1755/*******************************************************************************
1756**
1757** Function BTA_DmBleSetBgConnType
1758**
1759** Description This function is called to set BLE connectable mode for a
1760** peripheral device.
1761**
1762** Parameters bg_conn_type: it can be auto connection, or selective connection.
1763** p_select_cback: callback function when selective connection procedure
1764** is being used.
1765**
1766** Returns void
1767**
1768*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001769extern 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 -08001770
1771/*******************************************************************************
1772**
1773** Function BTA_DmBlePasskeyReply
1774**
1775** Description Send BLE SMP passkey reply.
1776**
1777** Parameters: bd_addr - BD address of the peer
1778** accept - passkey entry sucessful or declined.
1779** passkey - passkey value, must be a 6 digit number,
1780** can be lead by 0.
1781**
1782** Returns void
1783**
1784*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001785extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, BOOLEAN accept, UINT32 passkey);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001786
1787/*******************************************************************************
1788**
Satya Calloji444a8da2015-03-06 10:38:22 -08001789** Function BTA_DmBleConfirmReply
1790**
1791** Description Send BLE SMP SC user confirmation reply.
1792**
1793** Parameters: bd_addr - BD address of the peer
1794** accept - numbers to compare are the same or different.
1795**
1796** Returns void
1797**
1798*******************************************************************************/
1799extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, BOOLEAN accept);
1800
1801/*******************************************************************************
1802**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001803** Function BTA_DmAddBleDevice
1804**
1805** Description Add a BLE device. This function will be normally called
1806** during host startup to restore all required information
1807** for a LE device stored in the NVRAM.
1808**
1809** Parameters: bd_addr - BD address of the peer
1810** dev_type - Remote device's device type.
1811** addr_type - LE device address type.
1812**
1813** Returns void
1814**
1815*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001816extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
1817 tBT_DEVICE_TYPE dev_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001818
1819
1820/*******************************************************************************
1821**
1822** Function BTA_DmAddBleKey
1823**
1824** Description Add/modify LE device information. This function will be
1825** normally called during host startup to restore all required
1826** information stored in the NVRAM.
1827**
1828** Parameters: bd_addr - BD address of the peer
1829** p_le_key - LE key values.
1830** key_type - LE SMP key type.
1831**
1832** Returns void
1833**
1834*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001835extern void BTA_DmAddBleKey (BD_ADDR bd_addr,
1836 tBTA_LE_KEY_VALUE *p_le_key,
1837 tBTA_LE_KEY_TYPE key_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001838
1839/*******************************************************************************
1840**
1841** Function BTA_DmSetBlePrefConnParams
1842**
1843** Description This function is called to set the preferred connection
1844** parameters when default connection parameter is not desired.
1845**
1846** Parameters: bd_addr - BD address of the peripheral
1847** min_conn_int - minimum preferred connection interval
1848** max_conn_int - maximum preferred connection interval
1849** slave_latency - preferred slave latency
1850** supervision_tout - preferred supervision timeout
1851**
1852**
1853** Returns void
1854**
1855*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001856extern void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr,
1857 UINT16 min_conn_int, UINT16 max_conn_int,
1858 UINT16 slave_latency, UINT16 supervision_tout );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001859
1860/*******************************************************************************
1861**
1862** Function BTA_DmSetBleConnScanParams
1863**
1864** Description This function is called to set scan parameters used in
1865** BLE connection request
1866**
Satya Calloji444a8da2015-03-06 10:38:22 -08001867** Parameters: scan_interval - scan interval
The Android Open Source Project5738f832012-12-12 16:00:35 -08001868** scan_window - scan window
1869**
1870** Returns void
1871**
1872*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07001873extern void BTA_DmSetBleConnScanParams(UINT32 scan_interval,
1874 UINT32 scan_window);
1875
1876/*******************************************************************************
1877**
1878** Function BTA_DmSetBleScanParams
1879**
1880** Description This function is called to set scan parameters
1881**
1882** Parameters: client_if - Client IF
1883** scan_interval - scan interval
1884** scan_window - scan window
1885** scan_mode - scan mode
1886** scan_param_setup_status_cback - Set scan param status callback
1887**
1888** Returns void
1889**
1890*******************************************************************************/
1891extern void BTA_DmSetBleScanParams(tGATT_IF client_if, UINT32 scan_interval,
1892 UINT32 scan_window, tBLE_SCAN_MODE scan_mode,
1893 tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_status_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001894
1895/*******************************************************************************
1896**
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001897** Function BTA_DmSetBleAdvParams
1898**
1899** Description This function sets the advertising parameters BLE functionality.
1900** It is to be called when device act in peripheral or broadcaster
1901** role.
1902**
1903** Parameters: adv_int_min - adv interval minimum
1904** adv_int_max - adv interval max
1905** p_dir_bda - directed adv initator address
1906**
1907** Returns void
1908**
1909*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001910extern void BTA_DmSetBleAdvParams (UINT16 adv_int_min, UINT16 adv_int_max,
1911 tBLE_BD_ADDR *p_dir_bda);
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001912/*******************************************************************************
1913**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001914** Function BTA_DmSearchExt
1915**
1916** Description This function searches for peer Bluetooth devices. It performs
1917** an inquiry and gets the remote name for devices. Service
1918** discovery is done if services is non zero
1919**
1920** Parameters p_dm_inq: inquiry conditions
1921** services: if service is not empty, service discovery will be done.
1922** for all GATT based service condition, put num_uuid, and
1923** p_uuid is the pointer to the list of UUID values.
1924** p_cback: callback functino when search is completed.
1925**
1926**
1927**
1928** Returns void
1929**
1930*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001931extern void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services,
1932 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001933
1934/*******************************************************************************
1935**
1936** Function BTA_DmDiscoverExt
1937**
1938** Description This function does service discovery for services of a
1939** peer device. When services.num_uuid is 0, it indicates all
1940** GATT based services are to be searched; other wise a list of
1941** UUID of interested services should be provided through
1942** services.p_uuid.
1943**
1944**
1945**
1946** Returns void
1947**
1948*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001949extern void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
1950 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001951
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001952/*******************************************************************************
1953**
1954** Function BTA_DmDiscoverByTransport
1955**
1956** Description This function does service discovery on particular transport
1957** for services of a
1958** peer device. When services.num_uuid is 0, it indicates all
1959** GATT based services are to be searched; other wise a list of
1960** UUID of interested services should be provided through
1961** p_services->p_uuid.
1962**
1963**
1964**
1965** Returns void
1966**
1967*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001968extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
1969 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search,
1970 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001971
1972/*******************************************************************************
1973**
1974** Function BTA_DmSetEncryption
1975**
1976** Description This function is called to ensure that connection is
1977** encrypted. Should be called only on an open connection.
1978** Typically only needed for connections that first want to
1979** bring up unencrypted links, then later encrypt them.
1980**
1981** Parameters: bd_addr - Address of the peer device
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001982** transport - transport of the link to be encruypted
The Android Open Source Project5738f832012-12-12 16:00:35 -08001983** p_callback - Pointer to callback function to indicat the
1984** link encryption status
1985** sec_act - This is the security action to indicate
1986** what knid of BLE security level is required for
1987** the BLE link if the BLE is supported
1988** Note: This parameter is ignored for the BR/EDR link
1989** or the BLE is not supported
1990**
1991** Returns void
1992**
1993**
1994*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001995extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
1996 tBTA_DM_ENCRYPT_CBACK *p_callback,
1997 tBTA_DM_BLE_SEC_ACT sec_act);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001998
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001999
2000/*******************************************************************************
2001**
2002** Function BTA_DmBleObserve
2003**
2004** Description This procedure keep the device listening for advertising
2005** events from a broadcast device.
2006**
2007** Parameters start: start or stop observe.
2008** duration : Duration of the scan. Continuous scan if 0 is passed
2009** p_results_cb: Callback to be called with scan results
2010**
2011** Returns void
2012**
2013*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002014extern void BTA_DmBleObserve(BOOLEAN start, UINT8 duration,
2015 tBTA_DM_SEARCH_CBACK *p_results_cb);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002016
2017
The Android Open Source Project5738f832012-12-12 16:00:35 -08002018#endif
2019
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002020#if BLE_INCLUDED == TRUE
The Android Open Source Project5738f832012-12-12 16:00:35 -08002021// btla-specific --
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002022/*******************************************************************************
2023**
2024** Function BTA_DmBleConfigLocalPrivacy
2025**
2026** Description Enable/disable privacy on the local device
2027**
2028** Parameters: privacy_enable - enable/disabe privacy on remote device.
2029**
2030** Returns void
2031**
2032*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002033extern void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002034
2035/*******************************************************************************
2036**
2037** Function BTA_DmBleEnableRemotePrivacy
2038**
2039** Description Enable/disable privacy on a remote device
2040**
2041** Parameters: bd_addr - BD address of the peer
2042** privacy_enable - enable/disabe privacy on remote device.
2043**
2044** Returns void
2045**
2046*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002047extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002048
2049
2050/*******************************************************************************
2051**
2052** Function BTA_DmBleSetAdvConfig
2053**
2054** Description This function is called to override the BTA default ADV parameters.
2055**
2056** Parameters Pointer to User defined ADV data structure
2057**
2058** Returns None
2059**
2060*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002061extern void BTA_DmBleSetAdvConfig (tBTA_BLE_AD_MASK data_mask,
2062 tBTA_BLE_ADV_DATA *p_adv_cfg,
2063 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002064
2065/*******************************************************************************
2066**
2067** Function BTA_DmBleSetScanRsp
2068**
2069** Description This function is called to override the BTA scan response.
2070**
2071** Parameters Pointer to User defined ADV data structure
2072**
2073** Returns None
2074**
2075*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002076extern void BTA_DmBleSetScanRsp (tBTA_BLE_AD_MASK data_mask,
2077 tBTA_BLE_ADV_DATA *p_adv_cfg,
2078 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002079
2080/*******************************************************************************
2081**
2082** Function BTA_DmBleBroadcast
2083**
2084** Description This function starts or stops LE broadcasting.
2085**
2086** Parameters start: start or stop broadcast.
2087**
2088** Returns None
2089**
2090*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002091extern void BTA_DmBleBroadcast (BOOLEAN start);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002092
Wei Wanga6ce7752014-05-20 06:30:32 +00002093
2094/*******************************************************************************
2095**
2096** Function BTA_BleEnableAdvInstance
2097**
2098** Description This function enables the Multi ADV instance feature
2099**
2100** Parameters p_params Pointer to ADV param user defined structure
2101** p_cback Pointer to Multi ADV callback structure
2102** p_ref - Reference pointer
2103**
2104** Returns None
2105**
2106*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002107extern void BTA_BleEnableAdvInstance (tBTA_BLE_ADV_PARAMS *p_params,
Wei Wanga6ce7752014-05-20 06:30:32 +00002108 tBTA_BLE_MULTI_ADV_CBACK *p_cback,void *p_ref);
2109
2110/*******************************************************************************
2111**
2112** Function BTA_BleUpdateAdvInstParam
2113**
2114** Description This function updates the Multi ADV instance params
2115**
2116** Parameters inst_id Instance ID
2117** p_params Pointer to ADV param user defined structure
2118**
2119** Returns None
2120**
2121*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002122extern void BTA_BleUpdateAdvInstParam (UINT8 inst_id,
Wei Wanga6ce7752014-05-20 06:30:32 +00002123 tBTA_BLE_ADV_PARAMS *p_params);
2124
2125/*******************************************************************************
2126**
2127** Function BTA_BleCfgAdvInstData
2128**
2129** Description This function is called to configure the ADV instance data
2130**
2131** Parameters inst_id - Instance ID
2132** is_scan_rsp - Boolean value Scan response
2133** Pointer to User defined ADV data structure
2134** Returns None
2135**
2136*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002137extern void BTA_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp,
Wei Wanga6ce7752014-05-20 06:30:32 +00002138 tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_data);
2139
2140/*******************************************************************************
2141**
2142** Function BTA_BleDisableAdvInstance
2143**
2144** Description This function is called to disable the ADV instance
2145**
2146** Parameters inst_id - Instance ID to be disabled
2147**
2148** Returns None
2149**
2150*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002151extern void BTA_BleDisableAdvInstance(UINT8 inst_id);
Wei Wanga6ce7752014-05-20 06:30:32 +00002152
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07002153/*******************************************************************************
2154**
2155** Function BTA_DmBleUpdateConnectionParams
2156**
2157** Description Update connection parameters, can only be used when connection is up.
2158**
2159** Parameters: bd_addr - BD address of the peer
2160** min_int - minimum connection interval, [0x0004~ 0x4000]
2161** max_int - maximum connection interval, [0x0004~ 0x4000]
2162** latency - slave latency [0 ~ 500]
2163** timeout - supervision timeout [0x000a ~ 0xc80]
2164**
2165** Returns void
2166**
2167*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002168extern void BTA_DmBleUpdateConnectionParams(BD_ADDR bd_addr, UINT16 min_int,
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07002169 UINT16 max_int, UINT16 latency, UINT16 timeout);
Satya Callojic4e25962014-05-10 23:46:24 -07002170
2171/*******************************************************************************
2172**
Priti Aghera636d6712014-12-18 13:55:48 -08002173** Function BTA_DmBleSetDataLength
2174**
2175** Description This function is to set maximum LE data packet size
2176**
2177** Returns void
2178**
2179*******************************************************************************/
2180extern void BTA_DmBleSetDataLength(BD_ADDR remote_device, UINT16 tx_data_length);
2181
2182/*******************************************************************************
2183**
Satya Callojic4e25962014-05-10 23:46:24 -07002184** Function BTA_DmBleSetStorageParams
2185**
2186** Description This function is called to set the storage parameters
2187**
2188** Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning
2189** batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning
2190** batch_scan_notify_threshold - Setup notification level based on total space
2191** consumed by both pools. Setting it to 0 will disable threshold notification
2192** p_setup_cback - Setup callback
2193** p_thres_cback - Threshold callback
2194** p_rep_cback - Reports callback
Satya Calloji1acb61c2014-06-14 23:16:18 -07002195** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002196**
2197** Returns None
2198**
2199*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002200extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max,
Satya Callojic4e25962014-05-10 23:46:24 -07002201 UINT8 batch_scan_trunc_max,
2202 UINT8 batch_scan_notify_threshold,
2203 tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback,
2204 tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002205 tBTA_BLE_SCAN_REP_CBACK* p_rep_cback,
Satya Callojic4e25962014-05-10 23:46:24 -07002206 tBTA_DM_BLE_REF_VALUE ref_value);
2207
2208/*******************************************************************************
2209**
2210** Function BTA_DmBleEnableBatchScan
2211**
2212** Description This function is called to enable the batch scan
2213**
2214** Parameters scan_mode -Batch scan mode
2215** scan_interval - Scan interval
2216** scan_window - Scan window
2217** discard_rule -Discard rules
2218** addr_type - Address type
Satya Calloji1acb61c2014-06-14 23:16:18 -07002219** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002220**
2221** Returns None
2222**
2223*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002224extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
Satya Callojic4e25962014-05-10 23:46:24 -07002225 UINT32 scan_interval, UINT32 scan_window,
2226 tBTA_BLE_DISCARD_RULE discard_rule,
2227 tBLE_ADDR_TYPE addr_type,
2228 tBTA_DM_BLE_REF_VALUE ref_value);
2229
2230/*******************************************************************************
2231**
2232** Function BTA_DmBleReadScanReports
2233**
2234** Description This function is called to read the batch scan reports
2235**
2236** Parameters scan_mode -Batch scan mode
Satya Calloji1acb61c2014-06-14 23:16:18 -07002237** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002238**
2239** Returns None
2240**
2241*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002242extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
Satya Callojic4e25962014-05-10 23:46:24 -07002243 tBTA_DM_BLE_REF_VALUE ref_value);
2244
2245/*******************************************************************************
2246**
2247** Function BTA_DmBleDisableBatchScan
2248**
2249** Description This function is called to disable the batch scanning
2250**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002251** Parameters ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002252**
2253** Returns None
2254**
2255*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002256extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002257
Satya Calloji1a9247a2014-06-05 13:15:15 -07002258/*******************************************************************************
2259**
2260** Function BTA_DmEnableScanFilter
2261**
2262** Description This function is called to enable the adv data payload filter
2263**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002264** Parameters action - enable or disable the APCF feature
2265** p_cmpl_cback - Command completed callback
2266** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002267**
2268** Returns void
2269**
2270*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002271extern void BTA_DmEnableScanFilter(UINT8 action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002272 tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
2273 tBTA_DM_BLE_REF_VALUE ref_value);
2274
2275/*******************************************************************************
2276**
2277** Function BTA_DmBleScanFilterSetup
2278**
2279** Description This function is called to setup the filter params
2280**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002281** Parameters p_target: enable the filter condition on a target device; if NULL
2282** filt_index - Filter index
2283** p_filt_params -Filter parameters
2284** ref_value - Reference value
2285** action - Add, delete or clear
2286** p_cmpl_back - Command completed callback
Satya Calloji1a9247a2014-06-05 13:15:15 -07002287**
2288** Returns void
2289**
2290*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002291extern void BTA_DmBleScanFilterSetup(UINT8 action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002292 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2293 tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
2294 tBLE_BD_ADDR *p_target,
2295 tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
2296 tBTA_DM_BLE_REF_VALUE ref_value);
2297
2298/*******************************************************************************
2299**
2300** Function BTA_DmBleCfgFilterCondition
2301**
2302** Description This function is called to configure the adv data payload filter
2303** condition.
2304**
2305** Parameters action: to read/write/clear
Satya Calloji1acb61c2014-06-14 23:16:18 -07002306** cond_type: filter condition type
2307** filt_index - Filter index
Satya Calloji1a9247a2014-06-05 13:15:15 -07002308** p_cond: filter condition parameter
Satya Calloji1acb61c2014-06-14 23:16:18 -07002309** p_cmpl_back - Command completed callback
2310** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002311**
2312** Returns void
2313**
2314*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002315extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002316 tBTA_DM_BLE_PF_COND_TYPE cond_type,
2317 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2318 tBTA_DM_BLE_PF_COND_PARAM *p_cond,
2319 tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
2320 tBTA_DM_BLE_REF_VALUE ref_value);
2321
Satya Calloji1acb61c2014-06-14 23:16:18 -07002322
2323/*******************************************************************************
2324**
2325** Function BTA_DmBleTrackAdvertiser
2326**
2327** Description This function is called to track the advertiser
2328**
2329** Parameters ref_value - Reference value
2330** p_track_adv_cback - ADV callback
2331**
2332** Returns None
2333**
2334*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002335extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
Satya Calloji1acb61c2014-06-14 23:16:18 -07002336 tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback);
2337
Satya Callojie5ba8842014-07-03 17:18:02 -07002338/*******************************************************************************
2339**
2340** Function BTA_DmBleGetEnergyInfo
2341**
2342** Description This function is called to obtain the energy info
2343**
2344** Parameters p_cmpl_cback - Command complete callback
2345**
2346** Returns void
2347**
2348*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002349extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback);
Satya Callojie5ba8842014-07-03 17:18:02 -07002350
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002351/*******************************************************************************
2352**
2353** Function BTA_BrcmInit
2354**
2355** Description This function initializes Broadcom specific VS handler in BTA
2356**
2357** Returns void
2358**
2359*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002360extern void BTA_VendorInit (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002361
2362/*******************************************************************************
2363**
2364** Function BTA_BrcmCleanup
2365**
2366** Description This function frees up Broadcom specific VS specific dynamic memory
2367**
2368** Returns void
2369**
2370*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002371extern void BTA_VendorCleanup (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002372
Matthew Xiefc4b2f12013-05-06 20:51:02 -07002373#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -08002374
2375#ifdef __cplusplus
2376}
2377#endif
2378
2379#endif /* BTA_API_H */