blob: 71906d4a3764041b49220f20624659404bdcc45d [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 */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800173
174typedef UINT8 tBTA_SEC;
175
176/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
177
178#define BTA_DM_IGNORE 0xFF
179
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900180#define BTA_ALL_APP_ID 0xFF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800181
182/* Discoverable Modes */
183#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
184#define BTA_DM_GENERAL_DISC BTM_GENERAL_DISCOVERABLE /* General discoverable. */
185#define BTA_DM_LIMITED_DISC BTM_LIMITED_DISCOVERABLE /* Limited discoverable. */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800186#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
187#define BTA_DM_BLE_NON_DISCOVERABLE BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
188#define BTA_DM_BLE_GENERAL_DISCOVERABLE BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
189#define BTA_DM_BLE_LIMITED_DISCOVERABLE BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
190#endif
191typedef 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 -0800192
193/* Connectable Modes */
194#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
195#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800196#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
197#define BTA_DM_BLE_NON_CONNECTABLE BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
198#define BTA_DM_BLE_CONNECTABLE BTM_BLE_CONNECTABLE /* Device is LE connectable. */
199#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800200
201// btla-specific ++
202typedef UINT16 tBTA_DM_CONN;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700203
204#define BTA_TRANSPORT_UNKNOWN 0
205#define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR
206#define BTA_TRANSPORT_LE BT_TRANSPORT_LE
207typedef tBT_TRANSPORT tBTA_TRANSPORT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800208
209/* Pairable Modes */
210#define BTA_DM_PAIRABLE 1
211#define BTA_DM_NON_PAIRABLE 0
212
213/* Connectable Paired Only Mode */
214#define BTA_DM_CONN_ALL 0
215#define BTA_DM_CONN_PAIRED 1
216
217/* Inquiry Modes */
Kim Schulz8372aa52015-03-25 10:39:40 +0100218#define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800219#define BTA_DM_GENERAL_INQUIRY BTM_GENERAL_INQUIRY /* Perform general inquiry. */
220#define BTA_DM_LIMITED_INQUIRY BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
221
222#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
223#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
224#define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
225#define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
226#endif
227typedef UINT8 tBTA_DM_INQ_MODE;
228
229/* Inquiry Filter Type */
230#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
231#define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
232#define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
233
234typedef UINT8 tBTA_DM_INQ_FILT;
235
236/* Authorize Response */
237#define BTA_DM_AUTH_PERM 0 /* Authorized for future connections to the service */
238#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
239#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
240
241typedef UINT8 tBTA_AUTH_RESP;
242
243/* M/S preferred roles */
244#define BTA_ANY_ROLE 0x00
245#define BTA_MASTER_ROLE_PREF 0x01
246#define BTA_MASTER_ROLE_ONLY 0x02
247
248typedef UINT8 tBTA_PREF_ROLES;
249
250enum
251{
252
253 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
254 support "role switch during connection" for
255 an incoming connection, when it already has
256 another connection in master role */
257 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
258 simulateous connection in Master and Slave roles
259 for short period of time */
260 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
261 and slave roles */
262
263};
264
265
266/* Inquiry filter device class condition */
267typedef struct
268{
269 DEV_CLASS dev_class; /* device class of interest */
270 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of interest */
271} tBTA_DM_COD_COND;
272
273
274/* Inquiry Filter Condition */
275typedef union
276{
277 BD_ADDR bd_addr; /* BD address of device to filter. */
278 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
279} tBTA_DM_INQ_COND;
280
281/* Inquiry Parameters */
282typedef struct
283{
284 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
285 UINT8 duration; /* Inquiry duration in 1.28 sec units. */
286 UINT8 max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
287 BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */
288 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
289 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
Matthew Xie7f3e4292013-09-30 12:44:10 -0700290#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE)
291 UINT8 intl_duration[4];/*duration array storing the interleave scan's time portions*/
292#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800293} tBTA_DM_INQ;
294
295typedef struct
296{
297 UINT8 bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */
298#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
299 UINT8 bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
300 UINT8 *bta_dm_eir_uuid16; /* 16-bit UUIDs */
301#else
302 UINT32 uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
303#endif
304 INT8 *bta_dm_eir_inq_tx_power; /* Inquiry TX power */
305 UINT8 bta_dm_eir_flag_len; /* length of flags in bytes */
306 UINT8 *bta_dm_eir_flags; /* flags for EIR */
307 UINT8 bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */
308 UINT8 *bta_dm_eir_manufac_spec; /* manufacturer specific */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800309 UINT8 bta_dm_eir_additional_len; /* length of additional data in bytes */
310 UINT8 *bta_dm_eir_additional; /* additional data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800311} tBTA_DM_EIR_CONF;
312
313#if BLE_INCLUDED == TRUE
314/* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */
315#define BTA_BLE_LIMIT_DISC_FLAG BTM_BLE_LIMIT_DISC_FLAG
316#define BTA_BLE_GEN_DISC_FLAG BTM_BLE_GEN_DISC_FLAG
317#define BTA_BLE_BREDR_NOT_SPT BTM_BLE_BREDR_NOT_SPT
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700318#define BTA_BLE_DMT_CONTROLLER_SPT BTM_BLE_DMT_CONTROLLER_SPT
319#define BTA_BLE_DMT_HOST_SPT BTM_BLE_DMT_HOST_SPT
The Android Open Source Project5738f832012-12-12 16:00:35 -0800320#define BTA_BLE_NON_LIMIT_DISC_FLAG BTM_BLE_NON_LIMIT_DISC_FLAG
321#define BTA_BLE_ADV_FLAG_MASK BTM_BLE_ADV_FLAG_MASK
322#define BTA_BLE_LIMIT_DISC_MASK BTM_BLE_LIMIT_DISC_MASK
323
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800324/* ADV data bit mask */
325#define BTA_BLE_AD_BIT_DEV_NAME BTM_BLE_AD_BIT_DEV_NAME
326#define BTA_BLE_AD_BIT_FLAGS BTM_BLE_AD_BIT_FLAGS
327#define BTA_BLE_AD_BIT_MANU BTM_BLE_AD_BIT_MANU
328#define BTA_BLE_AD_BIT_TX_PWR BTM_BLE_AD_BIT_TX_PWR
329#define BTA_BLE_AD_BIT_INT_RANGE BTM_BLE_AD_BIT_INT_RANGE
330#define BTA_BLE_AD_BIT_SERVICE BTM_BLE_AD_BIT_SERVICE
331#define BTA_BLE_AD_BIT_APPEARANCE BTM_BLE_AD_BIT_APPEARANCE
332#define BTA_BLE_AD_BIT_PROPRIETARY BTM_BLE_AD_BIT_PROPRIETARY
333#define BTA_DM_BLE_AD_BIT_SERVICE_SOL BTM_BLE_AD_BIT_SERVICE_SOL
334#define BTA_DM_BLE_AD_BIT_SERVICE_DATA BTM_BLE_AD_BIT_SERVICE_DATA
335#define BTA_DM_BLE_AD_BIT_SIGN_DATA BTM_BLE_AD_BIT_SIGN_DATA
336#define BTA_DM_BLE_AD_BIT_SERVICE_128SOL BTM_BLE_AD_BIT_SERVICE_128SOL
337#define BTA_DM_BLE_AD_BIT_PUBLIC_ADDR BTM_BLE_AD_BIT_PUBLIC_ADDR
338#define BTA_DM_BLE_AD_BIT_RANDOM_ADDR BTM_BLE_AD_BIT_RANDOM_ADDR
Wei Wanga6ce7752014-05-20 06:30:32 +0000339#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 -0800340
Wei Wanga6ce7752014-05-20 06:30:32 +0000341typedef tBTM_BLE_AD_MASK tBTA_BLE_AD_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800342
343/* slave preferred connection interval range */
344typedef struct
345{
346 UINT16 low;
347 UINT16 hi;
348
349}tBTA_BLE_INT_RANGE;
350
351/* Service tag supported in the device */
352typedef struct
353{
354 UINT8 num_service;
355 BOOLEAN list_cmpl;
356 UINT16 *p_uuid;
357}tBTA_BLE_SERVICE;
358
The Android Open Source Project5738f832012-12-12 16:00:35 -0800359
360typedef struct
361{
362 UINT8 len;
363 UINT8 *p_val;
364}tBTA_BLE_MANU;
365
366typedef struct
367{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800368 UINT8 adv_type;
369 UINT8 len;
370 UINT8 *p_val; /* number of len byte */
371}tBTA_BLE_PROP_ELEM;
372
373/* vendor proprietary adv type */
374typedef struct
375{
376 UINT8 num_elem;
377 tBTA_BLE_PROP_ELEM *p_elem;
378}tBTA_BLE_PROPRIETARY;
379
380typedef struct
381{
Wei Wanga6ce7752014-05-20 06:30:32 +0000382 tBT_UUID service_uuid;
383 UINT8 len;
384 UINT8 *p_val;
385}tBTA_BLE_SERVICE_DATA;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800386
Wei Wanga6ce7752014-05-20 06:30:32 +0000387typedef tBTM_BLE_128SERVICE tBTA_BLE_128SERVICE;
388typedef tBTM_BLE_32SERVICE tBTA_BLE_32SERVICE;
389
390typedef struct
391{
392 tBTA_BLE_INT_RANGE int_range; /* slave prefered conn interval range */
393 tBTA_BLE_MANU *p_manu; /* manufacturer data */
394 tBTA_BLE_SERVICE *p_services; /* 16 bits services */
395 tBTA_BLE_128SERVICE *p_services_128b; /* 128 bits service */
396 tBTA_BLE_32SERVICE *p_service_32b; /* 32 bits Service UUID */
397 tBTA_BLE_SERVICE *p_sol_services; /* 16 bits services Solicitation UUIDs */
398 tBTA_BLE_32SERVICE *p_sol_service_32b; /* List of 32 bit Service Solicitation UUIDs */
399 tBTA_BLE_128SERVICE *p_sol_service_128b;/* List of 128 bit Service Solicitation UUIDs */
400 tBTA_BLE_PROPRIETARY *p_proprietary; /* proprietary data */
401 tBTA_BLE_SERVICE_DATA *p_service_data; /* service data */
402 UINT16 appearance; /* appearance data */
403 UINT8 flag;
404 UINT8 tx_power;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800405}tBTA_BLE_ADV_DATA;
406
Wei Wanga6ce7752014-05-20 06:30:32 +0000407typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status);
408
409/* advertising channel map */
410#define BTA_BLE_ADV_CHNL_37 BTM_BLE_ADV_CHNL_37
411#define BTA_BLE_ADV_CHNL_38 BTM_BLE_ADV_CHNL_38
412#define BTA_BLE_ADV_CHNL_39 BTM_BLE_ADV_CHNL_39
413typedef tBTM_BLE_ADV_CHNL_MAP tBTA_BLE_ADV_CHNL_MAP; /* use as a bit mask */
414
415/* advertising filter policy */
416typedef tBTM_BLE_AFP tBTA_BLE_AFP;
417
418/* adv event type */
419#define BTA_BLE_CONNECT_EVT BTM_BLE_CONNECT_EVT /* Connectable undirected advertising */
420#define BTA_BLE_CONNECT_DIR_EVT BTM_BLE_CONNECT_DIR_EVT /* Connectable directed advertising */
421#define BTA_BLE_DISCOVER_EVT BTM_BLE_DISCOVER_EVT /* Scannable undirected advertising */
422#define BTA_BLE_NON_CONNECT_EVT BTM_BLE_NON_CONNECT_EVT /* Non connectable undirected advertising */
423typedef UINT8 tBTA_BLE_ADV_EVT;
424
425/* adv tx power level */
426#define BTA_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
427#define BTA_BLE_ADV_TX_POWER_LOW 1 /* low tx power */
428#define BTA_BLE_ADV_TX_POWER_MID 2 /* middle tx power */
429#define BTA_BLE_ADV_TX_POWER_UPPER 3 /* upper tx power */
430#define BTA_BLE_ADV_TX_POWER_MAX 4 /* maximum tx power */
431typedef UINT8 tBTA_BLE_ADV_TX_POWER;
432
433/* advertising instance parameters */
434typedef struct
435{
436 UINT16 adv_int_min; /* minimum adv interval */
437 UINT16 adv_int_max; /* maximum adv interval */
438 tBTA_BLE_ADV_EVT adv_type; /* adv event type */
439 tBTA_BLE_ADV_CHNL_MAP channel_map; /* adv channel map */
440 tBTA_BLE_AFP adv_filter_policy; /* advertising filter policy */
441 tBTA_BLE_ADV_TX_POWER tx_power; /* adv tx power */
442}tBTA_BLE_ADV_PARAMS;
443
The Android Open Source Project5738f832012-12-12 16:00:35 -0800444/* These are the fields returned in each device adv packet. It
445** is returned in the results callback if registered.
446*/
447typedef struct
448{
449 UINT8 conn_mode;
450 tBTA_BLE_AD_MASK ad_mask; /* mask of the valid adv data field */
451 UINT8 flag;
452 UINT8 tx_power_level;
453 UINT8 remote_name_len;
454 UINT8 *p_remote_name;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800455 tBTA_BLE_SERVICE service;
456} tBTA_BLE_INQ_DATA;
Satya Callojic4e25962014-05-10 23:46:24 -0700457
458enum
459{
Satya Calloji5725fc62015-03-31 13:24:32 -0700460 BTA_BLE_BATCH_SCAN_MODE_PASS = 1,
461 BTA_BLE_BATCH_SCAN_MODE_ACTI = 2,
462 BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3
Satya Callojic4e25962014-05-10 23:46:24 -0700463};
Satya Calloji5725fc62015-03-31 13:24:32 -0700464typedef UINT8 tBTA_BLE_BATCH_SCAN_MODE;
Satya Callojic4e25962014-05-10 23:46:24 -0700465
466enum
467{
468 BTA_BLE_DISCARD_OLD_ITEMS=0,
469 BTA_BLE_DISCARD_LOWER_RSSI_ITEMS=1
470};
471typedef UINT8 tBTA_BLE_DISCARD_RULE;
472
473enum
474{
475 BTA_BLE_ADV_SEEN_FIRST_TIME=0,
476 BTA_BLE_ADV_TRACKING_TIMEOUT=1
477};
478typedef UINT8 tBTA_BLE_ADV_CHANGE_REASON;
479
480enum
481{
482 BTA_BLE_BATCH_SCAN_ENB_EVT = 1,
483 BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2,
484 BTA_BLE_BATCH_SCAN_DATA_EVT = 3,
485 BTA_BLE_BATCH_SCAN_THRES_EVT = 4,
486 BTA_BLE_BATCH_SCAN_PARAM_EVT = 5,
487 BTA_BLE_BATCH_SCAN_DIS_EVT = 6
488};
489typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
490
491typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800492#endif
493
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800494/* BLE customer specific feature function type definitions */
495/* data type used on customer specific feature for RSSI monitoring */
496#define BTA_BLE_RSSI_ALERT_HI 0
497#define BTA_BLE_RSSI_ALERT_RANGE 1
498#define BTA_BLE_RSSI_ALERT_LO 2
499typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_TYPE;
500
Kim Schulz8372aa52015-03-25 10:39:40 +0100501#define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */
502#define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */
503#define BTA_BLE_RSSI_ALERT_RANGE_BIT BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */
504#define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800505typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_MASK;
506
507
508typedef void (tBTA_DM_BLE_RSSI_CBACK) (BD_ADDR bd_addr, tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, INT8 rssi);
509
510/* max number of filter spot for different filter type */
511#define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */
512#define BTA_DM_BLE_MAX_ADDR_FILTER BTM_BLE_MAX_ADDR_FILTER /* 8 */
513#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 +0100514#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 -0800515
516#define BTA_DM_BLE_PF_LOGIC_OR 0
517#define BTA_DM_BLE_PF_LOGIC_AND 1
518typedef UINT8 tBTA_DM_BLE_PF_LOGIC_TYPE;
519
520enum
521{
522 BTA_DM_BLE_SCAN_COND_ADD,
523 BTA_DM_BLE_SCAN_COND_DELETE,
524 BTA_DM_BLE_SCAN_COND_CLEAR = 2
525};
526typedef UINT8 tBTA_DM_BLE_SCAN_COND_OP;
527
Satya Calloji1a9247a2014-06-05 13:15:15 -0700528/* ADV payload filtering vendor specific call event */
529enum
530{
531 BTA_BLE_SCAN_PF_ENABLE_EVT = 7,
532 BTA_BLE_SCAN_PF_COND_EVT
533};
534
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800535/* filter selection bit index */
536#define BTA_DM_BLE_PF_ADDR_FILTER BTM_BLE_PF_ADDR_FILTER
Andre Eisenbachb203d472013-11-20 17:23:06 -0800537#define BTA_DM_BLE_PF_SRVC_DATA BTM_BLE_PF_SRVC_DATA
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800538#define BTA_DM_BLE_PF_SRVC_UUID BTM_BLE_PF_SRVC_UUID
539#define BTA_DM_BLE_PF_SRVC_SOL_UUID BTM_BLE_PF_SRVC_SOL_UUID
540#define BTA_DM_BLE_PF_LOCAL_NAME BTM_BLE_PF_LOCAL_NAME
541#define BTA_DM_BLE_PF_MANU_DATA BTM_BLE_PF_MANU_DATA
Andre Eisenbachb203d472013-11-20 17:23:06 -0800542#define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN
Andre Eisenbach3aa60542013-03-22 18:00:51 -0700543#define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700544#define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800545typedef UINT8 tBTA_DM_BLE_PF_COND_TYPE;
546
Andre Eisenbachb203d472013-11-20 17:23:06 -0800547typedef union
548{
549 UINT16 uuid16_mask;
550 UINT32 uuid32_mask;
551 UINT8 uuid128_mask[LEN_UUID_128];
552}tBTA_DM_BLE_PF_COND_MASK;
553
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800554typedef struct
555{
556 tBLE_BD_ADDR *p_target_addr; /* target address, if NULL, generic UUID filter */
557 tBT_UUID uuid; /* UUID condition */
558 tBTA_DM_BLE_PF_LOGIC_TYPE cond_logic; /* AND/OR */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800559 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 -0800560}tBTA_DM_BLE_PF_UUID_COND;
561
562typedef struct
563{
564 UINT8 data_len; /* <= 20 bytes */
565 UINT8 *p_data;
566}tBTA_DM_BLE_PF_LOCAL_NAME_COND;
567
568typedef struct
569{
570 UINT16 company_id; /* company ID */
571 UINT8 data_len; /* <= 20 bytes */
572 UINT8 *p_pattern;
Andre Eisenbachb203d472013-11-20 17:23:06 -0800573 UINT16 company_id_mask; /* UUID value mask */
Satya Callojic4e25962014-05-10 23:46:24 -0700574 UINT8 *p_pattern_mask; /* Manufacturer data matching mask, same length
575 as data pattern, set to all 0xff, match exact data */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800576}tBTA_DM_BLE_PF_MANU_COND;
577
Andre Eisenbachb203d472013-11-20 17:23:06 -0800578typedef struct
579{
580 UINT16 uuid; /* service ID */
581 UINT8 data_len; /* <= 20 bytes */
582 UINT8 *p_pattern;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700583 UINT8 *p_pattern_mask; /* Service data matching mask, same length
584 as data pattern, set to all 0xff, match exact data */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800585}tBTA_DM_BLE_PF_SRVC_PATTERN_COND;
586
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800587typedef union
588{
589 tBLE_BD_ADDR target_addr;
590 tBTA_DM_BLE_PF_LOCAL_NAME_COND local_name; /* lcoal name filtering */
591 tBTA_DM_BLE_PF_MANU_COND manu_data; /* manufactuer data filtering */
592 tBTA_DM_BLE_PF_UUID_COND srvc_uuid; /* service UUID filtering */
593 tBTA_DM_BLE_PF_UUID_COND solicitate_uuid; /* solicitated service UUID filtering */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800594 tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800595}tBTA_DM_BLE_PF_COND_PARAM;
596
Satya Calloji1a9247a2014-06-05 13:15:15 -0700597typedef UINT8 tBTA_DM_BLE_PF_FILT_INDEX;
598typedef UINT8 tBTA_DM_BLE_PF_AVBL_SPACE;
599
The Android Open Source Project5738f832012-12-12 16:00:35 -0800600typedef INT8 tBTA_DM_RSSI_VALUE;
601typedef UINT8 tBTA_DM_LINK_QUALITY_VALUE;
602
603
The Android Open Source Project5738f832012-12-12 16:00:35 -0800604typedef UINT8 tBTA_SIG_STRENGTH_MASK;
605
606
607/* Security Callback Events */
608#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
609#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
610#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
611#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
612#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
613#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
614#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
615#define BTA_DM_SIG_STRENGTH_EVT 7 /* Signal strength for bluetooth connection */
616#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
617#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
618#define BTA_DM_SP_CFM_REQ_EVT 10 /* Simple Pairing User Confirmation request. */
619#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
620#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
621#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
622#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
623#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
624#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
625#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
626#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
627#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
628#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
629#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
Satya Calloji444a8da2015-03-06 10:38:22 -0800630#define BTA_DM_BLE_NC_REQ_EVT 22 /* SMP Numeric Comparison request event */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800631// btla-specific ++
Satya Calloji444a8da2015-03-06 10:38:22 -0800632#define BTA_DM_SP_RMT_OOB_EXT_EVT 23 /* Simple Pairing Remote OOB Extended Data request. */
633#define BTA_DM_BLE_AUTH_CMPL_EVT 24 /* BLE Auth complete */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800634// btla-specific --
Satya Calloji444a8da2015-03-06 10:38:22 -0800635#define BTA_DM_DEV_UNPAIRED_EVT 25
636#define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */
637#define BTA_DM_LE_FEATURES_READ 27 /* Cotroller specific LE features are read */
638#define BTA_DM_ENER_INFO_READ 28 /* Energy info read */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800639typedef UINT8 tBTA_DM_SEC_EVT;
640
641/* Structure associated with BTA_DM_ENABLE_EVT */
642typedef struct
643{
The Android Open Source Project5738f832012-12-12 16:00:35 -0800644 tBTA_STATUS status;
645} tBTA_DM_ENABLE;
646
647/* Structure associated with BTA_DM_PIN_REQ_EVT */
648typedef struct
649{
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700650 /* 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 -0800651 BD_ADDR bd_addr; /* BD address peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800652 DEV_CLASS dev_class; /* Class of Device */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800653 BD_NAME bd_name; /* Name of peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800654} tBTA_DM_PIN_REQ;
655
656/* BLE related definition */
657
658#define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10)
659#define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x))
660#define BTA_DM_AUTH_SMP_PASSKEY_FAIL BTA_DM_AUTH_CONVERT_SMP_CODE (SMP_PASSKEY_ENTRY_FAIL)
661#define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL)
662#define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL)
663#define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR)
664#define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT)
665#define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE)
666#define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD)
667#define BTA_DM_AUTH_SMP_UNKNOWN_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN)
668#define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS)
Satya Calloji444a8da2015-03-06 10:38:22 -0800669#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 -0800670#define BTA_DM_AUTH_SMP_INTERNAL_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR)
671#define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP)
672#define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL)
673#define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL)
674#define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY)
675#define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL)
676#define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT)
677
678/* connection parameter boundary value and dummy value */
679#define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN
680#define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX
681#define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN
682#define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX
683#define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN
684#define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX
685#define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX
686#define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN
687#define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX
688#define BTA_DM_BLE_CONN_PARAM_UNDEF BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be overwritten */
689
690
691#define BTA_LE_KEY_PENC BTM_LE_KEY_PENC /* encryption information of peer device */
692#define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */
693#define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */
694#define BTA_LE_KEY_LENC BTM_LE_KEY_LENC /* master role security information:div */
695#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
696#define BTA_LE_KEY_LCSRK BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
697typedef UINT8 tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
698
699
700typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS ;
701typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS;
702typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS ;
703typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS ;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800704typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS ;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800705
706typedef union
707{
708 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */
709 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800710 tBTA_LE_PID_KEYS pid_key; /* peer device ID key */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800711 tBTA_LE_LENC_KEYS lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/
712 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/
Satya Calloji444a8da2015-03-06 10:38:22 -0800713 tBTA_LE_PID_KEYS lid_key; /* local device ID key for the particular remote */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800714}tBTA_LE_KEY_VALUE;
715
716#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
717#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
718typedef UINT8 tBTA_DM_BLE_LOCAL_KEY_MASK;
719
720typedef struct
721{
722 BT_OCTET16 ir;
723 BT_OCTET16 irk;
724 BT_OCTET16 dhk;
725}tBTA_BLE_LOCAL_ID_KEYS;
726
727#define BTA_DM_SEC_GRANTED BTA_SUCCESS
728#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
729#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
730typedef UINT8 tBTA_DM_BLE_SEC_GRANT;
731
732
733#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
734#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
735#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
736typedef UINT8 tBTA_DM_BLE_CONN_TYPE;
737
738typedef BOOLEAN (tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name);
739
740/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
741typedef struct
742{
743 BD_ADDR bd_addr; /* peer address */
744 BD_NAME bd_name; /* peer device name */
745} tBTA_DM_BLE_SEC_REQ;
746
747typedef struct
748{
749 BD_ADDR bd_addr; /* peer address */
750 tBTM_LE_KEY_TYPE key_type;
Satya Calloji444a8da2015-03-06 10:38:22 -0800751 tBTM_LE_KEY_VALUE *p_key_value;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800752}tBTA_DM_BLE_KEY;
753
754/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
755typedef struct
756{
757 BD_ADDR bd_addr; /* BD address peer device. */
758 BD_NAME bd_name; /* Name of peer device. */
759 BOOLEAN key_present; /* Valid link key value in key element */
760 LINK_KEY key; /* Link key associated with peer device. */
761 UINT8 key_type; /* The type of Link Key */
762 BOOLEAN success; /* TRUE of authentication succeeded, FALSE if failed. */
763 UINT8 fail_reason; /* The HCI reason/error code for when success=FALSE */
Andre Eisenbach77668212015-05-06 21:49:35 -0700764 tBLE_ADDR_TYPE addr_type; /* Peer device address type */
Chaojing Sune2805532015-04-22 13:40:21 -0700765 tBT_DEVICE_TYPE dev_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800766} tBTA_DM_AUTH_CMPL;
767
768
769/* Structure associated with BTA_DM_AUTHORIZE_EVT */
770typedef struct
771{
772 BD_ADDR bd_addr; /* BD address peer device. */
773 BD_NAME bd_name; /* Name of peer device. */
774 tBTA_SERVICE_ID service; /* Service ID to authorize. */
775// btla-specific ++
776 DEV_CLASS dev_class;
777// btla-specific --
778} tBTA_DM_AUTHORIZE;
779
780/* Structure associated with BTA_DM_LINK_UP_EVT */
781typedef struct
782{
783 BD_ADDR bd_addr; /* BD address peer device. */
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700784#if BLE_INCLUDED == TRUE
785 tBTA_TRANSPORT link_type;
786#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800787} tBTA_DM_LINK_UP;
788
789/* Structure associated with BTA_DM_LINK_DOWN_EVT */
790typedef struct
791{
792 BD_ADDR bd_addr; /* BD address peer device. */
793 UINT8 status; /* connection open/closed */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800794 BOOLEAN is_removed; /* TRUE if device is removed when link is down */
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700795#if BLE_INCLUDED == TRUE
796 tBTA_TRANSPORT link_type;
797#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800798} tBTA_DM_LINK_DOWN;
799
800/* Structure associated with BTA_DM_ROLE_CHG_EVT */
801typedef struct
802{
803 BD_ADDR bd_addr; /* BD address peer device. */
804 UINT8 new_role; /* the new connection role */
805} tBTA_DM_ROLE_CHG;
806
The Android Open Source Project5738f832012-12-12 16:00:35 -0800807/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
808typedef struct
809{
810 UINT8 level; /* when paging or inquiring, level is 10.
811 Otherwise, the number of ACL links */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800812 UINT8 level_flags; /* indicates individual flags */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800813} tBTA_DM_BUSY_LEVEL;
814
Satya Calloji444a8da2015-03-06 10:38:22 -0800815#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
816#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
817#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
818#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
819#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
820#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
821#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800822typedef tBTM_IO_CAP tBTA_IO_CAP;
823
824#define BTA_AUTH_SP_NO BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single Profile/non-bonding
825 Numeric comparison with automatic accept allowed */
826#define BTA_AUTH_SP_YES BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding
827 Use IO Capabilities to determine authentication procedure */
828#define BTA_AUTH_AP_NO BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated bonding
829 Numeric comparison with automatic accept allowed */
830#define BTA_AUTH_AP_YES BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated bonding
831 Use IO Capabilities to determine authentication procedure */
832#define BTA_AUTH_SPGB_NO BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general bonding
833 Numeric comparison with automatic accept allowed */
834#define BTA_AUTH_SPGB_YES BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general bonding
835 Use IO Capabilities to determine authentication procedure */
836typedef tBTM_AUTH_REQ tBTA_AUTH_REQ;
837
838#define BTA_AUTH_DD_BOND BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */
839#define BTA_AUTH_GEN_BOND BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */
840#define BTA_AUTH_BONDS BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */
841
842#define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/
843#define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */
844#define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */
Satya Calloji444a8da2015-03-06 10:38:22 -0800845
846#define BTA_LE_AUTH_REQ_SC_ONLY BTM_LE_AUTH_REQ_SC_ONLY /* 1 << 3 */
847#define BTA_LE_AUTH_REQ_SC_BOND BTM_LE_AUTH_REQ_SC_BOND /* 1001 */
848#define BTA_LE_AUTH_REQ_SC_MITM BTM_LE_AUTH_REQ_SC_MITM /* 1100 */
849#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 -0800850typedef tBTM_LE_AUTH_REQ tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */
851
852#define BTA_OOB_NONE BTM_OOB_NONE
853#define BTA_OOB_PRESENT BTM_OOB_PRESENT
854#if BTM_OOB_INCLUDED == TRUE
855#define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN
856#endif
857typedef tBTM_OOB_DATA tBTA_OOB_DATA;
858
859/* Structure associated with BTA_DM_SP_CFM_REQ_EVT */
860typedef struct
861{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800862 /* 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 -0800863 BD_ADDR bd_addr; /* peer address */
864 DEV_CLASS dev_class; /* peer CoD */
865 BD_NAME bd_name; /* peer device name */
866 UINT32 num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */
867 BOOLEAN just_works; /* TRUE, if "Just Works" association model */
868 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
869 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
870 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
871 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */
872} tBTA_DM_SP_CFM_REQ;
873
874enum
875{
876 BTA_SP_KEY_STARTED, /* passkey entry started */
877 BTA_SP_KEY_ENTERED, /* passkey digit entered */
878 BTA_SP_KEY_ERASED, /* passkey digit erased */
879 BTA_SP_KEY_CLEARED, /* passkey cleared */
880 BTA_SP_KEY_COMPLT /* passkey entry completed */
881};
882typedef UINT8 tBTA_SP_KEY_TYPE;
883
884/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
885typedef struct
886{
887 BD_ADDR bd_addr; /* peer address */
888 tBTA_SP_KEY_TYPE notif_type;
889}tBTA_DM_SP_KEY_PRESS;
890
891/* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */
892typedef struct
893{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800894 /* 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 -0800895 BD_ADDR bd_addr; /* peer address */
896 DEV_CLASS dev_class; /* peer CoD */
897 BD_NAME bd_name; /* peer device name */
898 UINT32 passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */
899} tBTA_DM_SP_KEY_NOTIF;
900
901/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
902typedef struct
903{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800904 /* 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 -0800905 BD_ADDR bd_addr; /* peer address */
906 DEV_CLASS dev_class; /* peer CoD */
907 BD_NAME bd_name; /* peer device name */
908} tBTA_DM_SP_RMT_OOB;
909
910/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
911typedef struct
912{
913 tBTA_STATUS result; /* TRUE of bond cancel succeeded, FALSE if failed. */
914} tBTA_DM_BOND_CANCEL_CMPL;
915
916/* Union of all security callback structures */
917typedef union
918{
919 tBTA_DM_ENABLE enable; /* BTA enabled */
920 tBTA_DM_PIN_REQ pin_req; /* PIN request. */
921 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */
922 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */
923 tBTA_DM_LINK_UP link_up; /* ACL connection down event */
924 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800925 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
926 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */
927 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */
928 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */
929 tBTA_DM_BOND_CANCEL_CMPL bond_cancel_cmpl; /* Bond Cancel Complete indication */
930 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */
931 tBTA_DM_ROLE_CHG role_chg; /* role change event */
932 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */
933 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */
934 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */
935 BT_OCTET16 ble_er; /* ER event data */
936} tBTA_DM_SEC;
937
938/* Security callback */
939typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
940
Wei Wanga6ce7752014-05-20 06:30:32 +0000941#define BTA_BLE_MULTI_ADV_ILLEGAL 0
942
943/* multi adv callback event */
944#define BTA_BLE_MULTI_ADV_ENB_EVT 1
945#define BTA_BLE_MULTI_ADV_DISABLE_EVT 2
946#define BTA_BLE_MULTI_ADV_PARAM_EVT 3
947#define BTA_BLE_MULTI_ADV_DATA_EVT 4
948
949typedef UINT8 tBTA_BLE_MULTI_ADV_EVT;
950
951/* multi adv callback */
952typedef void (tBTA_BLE_MULTI_ADV_CBACK)(tBTA_BLE_MULTI_ADV_EVT event,
953 UINT8 inst_id, void *p_ref, tBTA_STATUS status);
Satya Callojie5ba8842014-07-03 17:18:02 -0700954typedef UINT32 tBTA_DM_BLE_REF_VALUE;
Wei Wanga6ce7752014-05-20 06:30:32 +0000955
Satya Calloji1a9247a2014-06-05 13:15:15 -0700956#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
957#define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG
958typedef UINT8 tBTA_DM_BLE_PF_EVT;
959
Satya Calloji1a9247a2014-06-05 13:15:15 -0700960#define BTA_DM_BLE_PF_ENABLE 1
961#define BTA_DM_BLE_PF_CONFIG 2
962typedef UINT8 tBTA_DM_BLE_PF_ACTION;
963
Satya Calloji1a9247a2014-06-05 13:15:15 -0700964/* Config callback */
965typedef void (tBTA_DM_BLE_PF_CFG_CBACK) (tBTA_DM_BLE_PF_ACTION action,
966 tBTA_DM_BLE_PF_COND_TYPE cfg_cond,
967 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, tBTA_STATUS status,
968 tBTA_DM_BLE_REF_VALUE ref_value);
969/* Param callback */
970typedef void (tBTA_DM_BLE_PF_PARAM_CBACK) (UINT8 action_type, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
971 tBTA_DM_BLE_REF_VALUE ref_value, tBTA_STATUS status);
972
973/* Status callback */
Satya Callojie5ba8842014-07-03 17:18:02 -0700974typedef void (tBTA_DM_BLE_PF_STATUS_CBACK) (UINT8 action, tBTA_STATUS status,
975 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700976
977
978#define BTA_DM_BLE_PF_BRDCAST_ADDR_FILT 1
979#define BTA_DM_BLE_PF_SERV_DATA_CHG_FILT 2
980#define BTA_DM_BLE_PF_SERV_UUID 4
981#define BTA_DM_BLE_PF_SERV_SOLC_UUID 8
982#define BTA_DM_BLE_PF_LOC_NAME_CHECK 16
983#define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32
984#define BTA_DM_BLE_PF_SERV_DATA_CHECK 64
985typedef UINT16 tBTA_DM_BLE_PF_FEAT_SEL;
986
987#define BTA_DM_BLE_PF_LIST_LOGIC_OR 1
988#define BTA_DM_BLE_PF_LIST_LOGIC_AND 2
989typedef UINT16 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
990
991#define BTA_DM_BLE_PF_FILT_LOGIC_OR 0
992#define BTA_DM_BLE_PF_FILT_LOGIC_AND 1
993typedef UINT16 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
994
995typedef UINT8 tBTA_DM_BLE_PF_RSSI_THRESHOLD;
996typedef UINT8 tBTA_DM_BLE_PF_DELIVERY_MODE;
997typedef UINT16 tBTA_DM_BLE_PF_TIMEOUT;
998typedef UINT8 tBTA_DM_BLE_PF_TIMEOUT_CNT;
Satya Callojif5387072015-02-09 17:40:52 -0800999typedef UINT16 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES;
Satya Calloji1a9247a2014-06-05 13:15:15 -07001000
1001typedef struct
1002{
1003 tBTA_DM_BLE_PF_FEAT_SEL feat_seln;
1004 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE list_logic_type;
1005 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE filt_logic_type;
1006 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_high_thres;
1007 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_low_thres;
1008 tBTA_DM_BLE_PF_DELIVERY_MODE dely_mode;
1009 tBTA_DM_BLE_PF_TIMEOUT found_timeout;
1010 tBTA_DM_BLE_PF_TIMEOUT lost_timeout;
1011 tBTA_DM_BLE_PF_TIMEOUT_CNT found_timeout_cnt;
Satya Callojif5387072015-02-09 17:40:52 -08001012 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES num_of_tracking_entries;
Satya Calloji1a9247a2014-06-05 13:15:15 -07001013} tBTA_DM_BLE_PF_FILT_PARAMS;
1014
The Android Open Source Project5738f832012-12-12 16:00:35 -08001015/* Search callback events */
1016#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
1017#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
1018#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
1019#define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based servoce on a peer device. */
1020#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
1021#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
1022#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
1023
1024typedef UINT8 tBTA_DM_SEARCH_EVT;
1025
1026#define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
1027
1028/* Structure associated with BTA_DM_INQ_RES_EVT */
1029typedef struct
1030{
1031 BD_ADDR bd_addr; /* BD address peer device. */
1032 DEV_CLASS dev_class; /* Device class of peer device. */
1033 BOOLEAN remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
1034 /* If the device name is known to application BTA skips the remote name request */
1035 BOOLEAN is_limited; /* TRUE, if the limited inquiry bit is set in the CoD */
1036 INT8 rssi; /* The rssi value */
1037 UINT8 *p_eir; /* received EIR */
1038#if (BLE_INCLUDED == TRUE)
1039 UINT8 inq_result_type;
1040 UINT8 ble_addr_type;
1041 tBTM_BLE_EVT_TYPE ble_evt_type;
1042 tBT_DEVICE_TYPE device_type;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001043 UINT8 flag;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001044#endif
1045
1046} tBTA_DM_INQ_RES;
1047
1048/* Structure associated with BTA_DM_INQ_CMPL_EVT */
1049typedef struct
1050{
1051 UINT8 num_resps; /* Number of inquiry responses. */
1052} tBTA_DM_INQ_CMPL;
1053
1054/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
1055typedef struct
1056{
1057 BD_ADDR bd_addr; /* BD address peer device. */
1058 UINT8 num_record; /* Number of DI record */
1059 tBTA_STATUS result;
1060} tBTA_DM_DI_DISC_CMPL;
1061
1062/* Structure associated with BTA_DM_DISC_RES_EVT */
1063typedef struct
1064{
1065 BD_ADDR bd_addr; /* BD address peer device. */
1066 BD_NAME bd_name; /* Name of peer device. */
1067 tBTA_SERVICE_MASK services; /* Services found on peer device. */
1068// btla-specific ++
1069 UINT8 * p_raw_data; /* Raw data for discovery DB */
1070 UINT32 raw_data_size; /* size of raw data */
1071 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
1072 UINT32 num_uuids;
1073 UINT8 *p_uuid_list;
1074// btla-specific --
1075 tBTA_STATUS result;
1076} tBTA_DM_DISC_RES;
1077
1078/* Structure associated with tBTA_DM_DISC_BLE_RES */
1079typedef struct
1080{
1081 BD_ADDR bd_addr; /* BD address peer device. */
1082 BD_NAME bd_name; /* Name of peer device. */
1083 tBT_UUID service; /* GATT based Services UUID found on peer device. */
1084} tBTA_DM_DISC_BLE_RES;
1085
1086
1087/* Union of all search callback structures */
1088typedef union
1089{
1090 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
1091 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
1092 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
1093 tBTA_DM_DISC_BLE_RES disc_ble_res; /* discovery result for GATT based service */
1094 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
1095
1096} tBTA_DM_SEARCH;
1097
1098/* Search callback */
1099typedef void (tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data);
1100
1101/* Execute call back */
1102typedef void (tBTA_DM_EXEC_CBACK) (void * p_param);
1103
1104/* Encryption callback*/
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001105typedef 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 -08001106
1107#if BLE_INCLUDED == TRUE
1108#define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE
1109#define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT
1110#define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM
1111#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
1112typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
Satya Callojic4e25962014-05-10 23:46:24 -07001113
Satya Callojie5ba8842014-07-03 17:18:02 -07001114typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
1115typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
1116typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
1117typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED;
1118
1119#define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */
1120#define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */
1121#define BTA_DM_CONTRL_SCAN 2 /* Scan state - paging/inquiry/trying to connect*/
1122#define BTA_DM_CONTRL_IDLE 3 /* Idle state - page scan, LE advt, inquiry scan */
1123
1124typedef UINT8 tBTA_DM_CONTRL_STATE;
1125
Satya Callojif5387072015-02-09 17:40:52 -08001126typedef UINT8 tBTA_DM_BLE_ADV_STATE;
1127typedef UINT8 tBTA_DM_BLE_ADV_INFO_PRESENT;
1128typedef UINT8 tBTA_DM_BLE_RSSI_VALUE;
1129typedef UINT16 tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
1130
1131typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA;
Satya Callojie5ba8842014-07-03 17:18:02 -07001132
Satya Callojic4e25962014-05-10 23:46:24 -07001133typedef void (tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojie5ba8842014-07-03 17:18:02 -07001134
Satya Calloji1a9247a2014-06-05 13:15:15 -07001135typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, UINT8 report_format,
Satya Callojic4e25962014-05-10 23:46:24 -07001136 UINT8 num_records, UINT16 data_len,
1137 UINT8* p_rep_data, tBTA_STATUS status);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001138
Satya Callojie5ba8842014-07-03 17:18:02 -07001139typedef void (tBTA_BLE_SCAN_SETUP_CBACK) (tBTA_BLE_BATCH_SCAN_EVT evt,
1140 tBTA_DM_BLE_REF_VALUE ref_value,
Satya Callojic4e25962014-05-10 23:46:24 -07001141 tBTA_STATUS status);
1142
Satya Calloji1acb61c2014-06-14 23:16:18 -07001143typedef void (tBTA_BLE_TRACK_ADV_CMPL_CBACK)(int action, tBTA_STATUS status,
Satya Callojie5ba8842014-07-03 17:18:02 -07001144 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
1145 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001146
Satya Callojif5387072015-02-09 17:40:52 -08001147typedef void (tBTA_BLE_TRACK_ADV_CBACK)(tBTA_DM_BLE_TRACK_ADV_DATA *p_adv_data);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001148
Satya Callojie5ba8842014-07-03 17:18:02 -07001149typedef void (tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
1150 tBTA_DM_BLE_RX_TIME_MS rx_time,
1151 tBTA_DM_BLE_IDLE_TIME_MS idle_time,
1152 tBTA_DM_BLE_ENERGY_USED energy_used,
1153 tBTA_DM_CONTRL_STATE ctrl_state,
1154 tBTA_STATUS status);
1155
The Android Open Source Project5738f832012-12-12 16:00:35 -08001156#else
1157typedef UINT8 tBTA_DM_BLE_SEC_ACT;
1158#endif
1159
1160/* Maximum service name length */
1161#define BTA_SERVICE_NAME_LEN 35
1162#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
1163#define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN
1164
1165
1166/* link policy masks */
1167#define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH
1168#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
1169#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
1170#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
1171typedef UINT16 tBTA_DM_LP_MASK;
1172
1173/* power mode actions */
1174#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
1175#define BTA_DM_PM_PARK 0x10 /* prefers park mode */
1176#define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */
1177#define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */
1178#define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */
1179#define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */
1180#define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */
1181#define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */
1182#define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */
1183#define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */
1184#define BTA_DM_PM_SNIFF_USER0 0x28 /* prefers user-defined sniff0 mode (testtool only) */
1185#define BTA_DM_PM_SNIFF_USER1 0x29 /* prefers user-defined sniff1 mode (testtool only) */
1186#define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */
1187#define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */
1188#define BTA_DM_PM_NO_PREF 0x01 /* service has no prefernce on power mode setting. eg. connection to service got closed */
1189
1190typedef UINT8 tBTA_DM_PM_ACTTION;
1191
1192/* index to bta_dm_ssr_spec */
1193#define BTA_DM_PM_SSR0 0
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001194#define BTA_DM_PM_SSR1 1 /* BTA_DM_PM_SSR1 will be dedicated for
1195 HH SSR setting entry, no other profile can use it */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001196#define BTA_DM_PM_SSR2 2
1197#define BTA_DM_PM_SSR3 3
1198#define BTA_DM_PM_SSR4 4
1199#define BTA_DM_PM_SSR5 5
1200#define BTA_DM_PM_SSR6 6
1201
1202#define BTA_DM_PM_NUM_EVTS 9
1203
1204#ifndef BTA_DM_PM_PARK_IDX
1205#define BTA_DM_PM_PARK_IDX 5 /* the actual index to bta_dm_pm_md[] for PARK mode */
1206#endif
1207
Adam Hampson63399d92014-05-19 16:23:45 -07001208#ifndef BTA_DM_PM_SNIFF_A2DP_IDX
1209#define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF
1210#endif
1211
1212#ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX
1213#define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF2
1214#endif
1215
1216#ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX
1217#define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3
1218#endif
1219
1220#ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX
1221#define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF4
1222#endif
1223
1224#ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX
1225#define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF2
1226#endif
1227
1228#ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX
1229#define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF2
1230#endif
1231
1232#ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX
1233#define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF2
1234#endif
1235
1236
1237#ifndef BTA_DM_PM_HH_OPEN_DELAY
1238#define BTA_DM_PM_HH_OPEN_DELAY 30000
1239#endif
1240
1241#ifndef BTA_DM_PM_HH_ACTIVE_DELAY
1242#define BTA_DM_PM_HH_ACTIVE_DELAY 30000
1243#endif
1244
1245#ifndef BTA_DM_PM_HH_IDLE_DELAY
1246#define BTA_DM_PM_HH_IDLE_DELAY 30000
1247#endif
1248
1249/* The Sniff Parameters defined below must be ordered from highest
1250 * latency (biggest interval) to lowest latency. If there is a conflict
1251 * among the connected services the setting with the lowest latency will
1252 * be selected. If a device should override a sniff parameter then it
1253 * must insure that order is maintained.
1254 */
1255#ifndef BTA_DM_PM_SNIFF_MAX
1256#define BTA_DM_PM_SNIFF_MAX 800
1257#define BTA_DM_PM_SNIFF_MIN 400
1258#define BTA_DM_PM_SNIFF_ATTEMPT 4
1259#define BTA_DM_PM_SNIFF_TIMEOUT 1
1260#endif
1261
1262#ifndef BTA_DM_PM_SNIFF1_MAX
1263#define BTA_DM_PM_SNIFF1_MAX 400
1264#define BTA_DM_PM_SNIFF1_MIN 200
1265#define BTA_DM_PM_SNIFF1_ATTEMPT 4
1266#define BTA_DM_PM_SNIFF1_TIMEOUT 1
1267#endif
1268
1269#ifndef BTA_DM_PM_SNIFF2_MAX
1270#define BTA_DM_PM_SNIFF2_MAX 180
1271#define BTA_DM_PM_SNIFF2_MIN 150
1272#define BTA_DM_PM_SNIFF2_ATTEMPT 4
1273#define BTA_DM_PM_SNIFF2_TIMEOUT 1
1274#endif
1275
1276#ifndef BTA_DM_PM_SNIFF3_MAX
1277#define BTA_DM_PM_SNIFF3_MAX 150
1278#define BTA_DM_PM_SNIFF3_MIN 50
1279#define BTA_DM_PM_SNIFF3_ATTEMPT 4
1280#define BTA_DM_PM_SNIFF3_TIMEOUT 1
1281#endif
1282
1283#ifndef BTA_DM_PM_SNIFF4_MAX
1284#define BTA_DM_PM_SNIFF4_MAX 54
1285#define BTA_DM_PM_SNIFF4_MIN 30
1286#define BTA_DM_PM_SNIFF4_ATTEMPT 4
1287#define BTA_DM_PM_SNIFF4_TIMEOUT 1
1288#endif
1289
1290#ifndef BTA_DM_PM_PARK_MAX
1291#define BTA_DM_PM_PARK_MAX 800
1292#define BTA_DM_PM_PARK_MIN 400
1293#define BTA_DM_PM_PARK_ATTEMPT 0
1294#define BTA_DM_PM_PARK_TIMEOUT 0
1295#endif
1296
1297
The Android Open Source Project5738f832012-12-12 16:00:35 -08001298/* Switch callback events */
1299#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
1300
1301typedef UINT8 tBTA_DM_SWITCH_EVT;
1302typedef void (tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, tBTA_STATUS status);
1303
1304/* Audio routing out configuration */
1305#define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */
1306#define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */
1307#define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */
1308#define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */
1309#define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */
1310#define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */
1311#define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */
1312#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
1313#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
1314
1315typedef UINT8 tBTA_DM_ROUTE_PATH;
1316
1317
1318/* Device Identification (DI) data structure
1319*/
1320/* Used to set the DI record */
1321typedef tSDP_DI_RECORD tBTA_DI_RECORD;
1322/* Used to get the DI record */
1323typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD;
1324/* SDP discovery database */
1325typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB;
1326
1327#ifndef BTA_DI_NUM_MAX
1328#define BTA_DI_NUM_MAX 3
1329#endif
1330
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001331/* Device features mask definitions */
1332#define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE
1333#define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001334/* ACL type
1335*/
1336#define BTA_DM_LINK_TYPE_BR_EDR 0x01
1337#define BTA_DM_LINK_TYPE_LE 0x02
1338#define BTA_DM_LINK_TYPE_ALL 0xFF
1339typedef UINT8 tBTA_DM_LINK_TYPE;
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001340
Satya Calloji6e2d9db2014-07-08 16:18:58 -07001341#define IMMEDIATE_DELY_MODE 0x00
1342#define ONFOUND_DELY_MODE 0x01
1343#define BATCH_DELY_MODE 0x02
1344#define ALLOW_ALL_FILTER 0x00
1345#define LOWEST_RSSI_VALUE 129
1346
The Android Open Source Project5738f832012-12-12 16:00:35 -08001347/*****************************************************************************
1348** External Function Declarations
1349*****************************************************************************/
1350#ifdef __cplusplus
1351extern "C"
1352{
1353#endif
1354
1355/*******************************************************************************
1356**
1357** Function BTA_EnableBluetooth
1358**
1359** Description This function initializes BTA and prepares BTA and the
1360** Bluetooth protocol stack for use. This function is
1361** typically called at startup or when Bluetooth services
1362** are required by the phone. This function must be called
1363** before calling any other API function.
1364**
1365**
1366** Returns BTA_SUCCESS if successful.
1367** BTA_FAIL if internal failure.
1368**
1369*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001370extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001371
1372/*******************************************************************************
1373**
1374** Function BTA_DisableBluetooth
1375**
1376** Description This function disables BTA and the Bluetooth protocol
1377** stack. It is called when BTA is no longer being used
1378** by any application in the system.
1379**
1380**
1381** Returns void
1382**
1383*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001384extern tBTA_STATUS BTA_DisableBluetooth(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001385
1386/*******************************************************************************
1387**
1388** Function BTA_EnableTestMode
1389**
1390** Description Enables bluetooth device under test mode
1391**
1392**
1393** Returns tBTA_STATUS
1394**
1395*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001396extern tBTA_STATUS BTA_EnableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001397
1398/*******************************************************************************
1399**
1400** Function BTA_DisableTestMode
1401**
1402** Description Disable bluetooth device under test mode
1403**
1404**
1405** Returns None
1406**
1407*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001408extern void BTA_DisableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001409
1410/*******************************************************************************
1411**
1412** Function BTA_DmSetDeviceName
1413**
1414** Description This function sets the Bluetooth name of the local device.
1415**
1416**
1417** Returns void
1418**
1419*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001420extern void BTA_DmSetDeviceName(char *p_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001421
1422/*******************************************************************************
1423**
1424** Function BTA_DmSetVisibility
1425**
1426** Description This function sets the Bluetooth connectable,discoverable,
1427** pairable and conn paired only modesmodes of the local device.
1428** This controls whether other Bluetooth devices can find and connect to
1429** the local device.
1430**
1431**
1432** Returns void
1433**
1434*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001435extern 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 -08001436
1437/*******************************************************************************
1438**
1439** Function BTA_DmSearch
1440**
1441** Description This function searches for peer Bluetooth devices. It
1442** first performs an inquiry; for each device found from the
1443** inquiry it gets the remote name of the device. If
1444** parameter services is nonzero, service discovery will be
1445** performed on each device for the services specified.
1446**
1447**
1448** Returns void
1449**
1450*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001451extern void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services,
1452 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001453
1454/*******************************************************************************
1455**
1456** Function BTA_DmSearchCancel
1457**
1458** Description This function cancels a search that has been initiated
1459** by calling BTA_DmSearch().
1460**
1461**
1462** Returns void
1463**
1464*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001465extern void BTA_DmSearchCancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001466
1467/*******************************************************************************
1468**
1469** Function BTA_DmDiscover
1470**
1471** Description This function performs service discovery for the services
1472** of a particular peer device.
1473**
1474**
1475** Returns void
1476**
1477*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001478extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
1479 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001480
1481// btla-specific ++
1482/*******************************************************************************
1483**
1484** Function BTA_DmDiscoverUUID
1485**
1486** Description This function performs service discovery for the services
1487** of a particular peer device.
1488**
1489**
1490** Returns void
1491**
1492*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001493extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
1494 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001495
1496/*******************************************************************************
1497**
1498** Function BTA_DmGetCachedRemoteName
1499**
1500** Description Retieve cached remote name if available
1501**
1502** Returns BTA_SUCCESS if cached name was retrieved
1503** BTA_FAILURE if cached name is not available
1504**
1505*******************************************************************************/
1506tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, UINT8 **pp_cached_name);
1507// btla-specific --
1508
1509/*******************************************************************************
1510**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001511** Function BTA_DmBond
1512**
1513** Description This function initiates a bonding procedure with a peer
1514** device. The bonding procedure enables authentication
1515** and optionally encryption on the Bluetooth link.
1516**
1517**
1518** Returns void
1519**
1520*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001521extern void BTA_DmBond(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001522
1523/*******************************************************************************
1524**
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001525** Function BTA_DmBondByTransport
1526**
1527** Description This function initiates a bonding procedure with a peer
1528** device by designated transport. The bonding procedure enables
1529** authentication and optionally encryption on the Bluetooth link.
1530**
1531**
1532** Returns void
1533**
1534*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001535extern void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001536
1537
1538/*******************************************************************************
1539**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001540** Function BTA_DmBondCancel
1541**
1542** Description This function cancels a bonding procedure with a peer
1543** device.
1544**
1545**
1546** Returns void
1547**
1548*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001549extern void BTA_DmBondCancel(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001550
1551/*******************************************************************************
1552**
1553** Function BTA_DmPinReply
1554**
1555** Description This function provides a PIN when one is requested by DM
1556** during a bonding procedure. The application should call
1557** this function after the security callback is called with
1558** a BTA_DM_PIN_REQ_EVT.
1559**
1560**
1561** Returns void
1562**
1563*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001564extern void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len,
1565 UINT8 *p_pin);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001566
1567#if (BTM_OOB_INCLUDED == TRUE)
1568/*******************************************************************************
1569**
1570** Function BTA_DmLocalOob
1571**
1572** Description This function retrieves the OOB data from local controller.
1573** The result is reported by bta_dm_co_loc_oob().
1574**
1575** Returns void
1576**
1577*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001578extern void BTA_DmLocalOob(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001579#endif /* BTM_OOB_INCLUDED */
1580
1581/*******************************************************************************
1582**
1583** Function BTA_DmConfirm
1584**
1585** Description This function accepts or rejects the numerical value of the
1586** Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT
1587**
1588** Returns void
1589**
1590*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001591extern void BTA_DmConfirm(BD_ADDR bd_addr, BOOLEAN accept);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001592
1593/*******************************************************************************
1594**
1595** Function BTA_DmAddDevice
1596**
1597** Description This function adds a device to the security database list
1598** of peer devices. This function would typically be called
1599** at system startup to initialize the security database with
1600** known peer devices. This is a direct execution function
1601** that may lock task scheduling on some platforms.
1602**
1603** Returns void
1604**
1605*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001606extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class,
1607 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
1608 BOOLEAN is_trusted, UINT8 key_type,
1609 tBTA_IO_CAP io_cap);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001610
1611/*******************************************************************************
1612**
1613** Function BTA_DmRemoveDevice
1614**
1615** Description This function removes a device from the security database.
1616** This is a direct execution function that may lock task
1617** scheduling on some platforms.
1618**
1619**
1620** Returns BTA_SUCCESS if successful.
1621** BTA_FAIL if operation failed.
1622**
1623*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001624extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001625
1626/*******************************************************************************
1627**
1628** Function BTA_GetEirService
1629**
1630** Description This function is called to get BTA service mask from EIR.
1631**
1632** Parameters p_eir - pointer of EIR significant part
1633** p_services - return the BTA service mask
1634**
1635** Returns None
1636**
1637*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001638extern void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001639
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001640/*******************************************************************************
1641**
1642** Function BTA_DmGetConnectionState
1643**
1644** Description Returns whether the remote device is currently connected.
1645**
1646** Returns 0 if the device is NOT connected.
1647**
1648*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001649extern UINT16 BTA_DmGetConnectionState( BD_ADDR bd_addr );
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001650
The Android Open Source Project5738f832012-12-12 16:00:35 -08001651
1652/*******************************************************************************
1653**
1654** Function BTA_DmSetLocalDiRecord
1655**
1656** Description This function adds a DI record to the local SDP database.
1657**
1658** Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1659**
1660*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001661extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
1662 UINT32 *p_handle );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001663
1664/*******************************************************************************
1665**
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001666**
1667** Function BTA_DmCloseACL
1668**
1669** Description This function force to close an ACL connection and remove the
1670** device from the security database list of known devices.
1671**
1672** Parameters: bd_addr - Address of the peer device
1673** remove_dev - remove device or not after link down
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001674** transport - which transport to close
1675
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001676**
1677** Returns void.
1678**
1679*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001680extern void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001681
1682/*******************************************************************************
1683**
1684** Function bta_dmexecutecallback
1685**
1686** Description This function will request BTA to execute a call back in the context of BTU task
1687** This API was named in lower case because it is only intended
1688** for the internal customers(like BTIF).
1689**
1690** Returns void
1691**
1692*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001693extern void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK* p_callback, void * p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001694
1695#if (BTM_SCO_HCI_INCLUDED == TRUE)
1696/*******************************************************************************
1697**
1698** Function BTA_DmPcmInitSamples
1699**
1700** Description initialize the down sample converter.
1701**
1702** src_sps: original samples per second (source audio data)
1703** (ex. 44100, 48000)
1704** bits: number of bits per pcm sample (16)
1705** n_channels: number of channels (i.e. mono(1), stereo(2)...)
1706**
1707** Returns none
1708**
1709*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001710extern void BTA_DmPcmInitSamples (UINT32 src_sps, UINT32 bits, UINT32 n_channels);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001711
1712/**************************************************************************************
1713** Function BTA_DmPcmResample
1714**
1715** Description Down sampling utility to convert higher sampling rate into 8K/16bits
1716** PCM samples.
1717**
1718** Parameters p_src: pointer to the buffer where the original sampling PCM
1719** are stored.
1720** in_bytes: Length of the input PCM sample buffer in byte.
1721** p_dst: pointer to the buffer which is to be used to store
1722** the converted PCM samples.
1723**
1724**
1725** Returns INT32: number of samples converted.
1726**
1727**************************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001728extern INT32 BTA_DmPcmResample (void *p_src, UINT32 in_bytes, void *p_dst);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001729#endif
1730
1731#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
1732/* BLE related API functions */
1733/*******************************************************************************
1734**
1735** Function BTA_DmBleSecurityGrant
1736**
1737** Description Grant security request access.
1738**
1739** Parameters: bd_addr - BD address of the peer
1740** res - security grant status.
1741**
1742** Returns void
1743**
1744*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001745extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001746
1747
1748
1749/*******************************************************************************
1750**
1751** Function BTA_DmBleSetBgConnType
1752**
1753** Description This function is called to set BLE connectable mode for a
1754** peripheral device.
1755**
1756** Parameters bg_conn_type: it can be auto connection, or selective connection.
1757** p_select_cback: callback function when selective connection procedure
1758** is being used.
1759**
1760** Returns void
1761**
1762*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001763extern 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 -08001764
1765/*******************************************************************************
1766**
1767** Function BTA_DmBlePasskeyReply
1768**
1769** Description Send BLE SMP passkey reply.
1770**
1771** Parameters: bd_addr - BD address of the peer
1772** accept - passkey entry sucessful or declined.
1773** passkey - passkey value, must be a 6 digit number,
1774** can be lead by 0.
1775**
1776** Returns void
1777**
1778*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001779extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, BOOLEAN accept, UINT32 passkey);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001780
1781/*******************************************************************************
1782**
Satya Calloji444a8da2015-03-06 10:38:22 -08001783** Function BTA_DmBleConfirmReply
1784**
1785** Description Send BLE SMP SC user confirmation reply.
1786**
1787** Parameters: bd_addr - BD address of the peer
1788** accept - numbers to compare are the same or different.
1789**
1790** Returns void
1791**
1792*******************************************************************************/
1793extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, BOOLEAN accept);
1794
1795/*******************************************************************************
1796**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001797** Function BTA_DmAddBleDevice
1798**
1799** Description Add a BLE device. This function will be normally called
1800** during host startup to restore all required information
1801** for a LE device stored in the NVRAM.
1802**
1803** Parameters: bd_addr - BD address of the peer
1804** dev_type - Remote device's device type.
1805** addr_type - LE device address type.
1806**
1807** Returns void
1808**
1809*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001810extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
1811 tBT_DEVICE_TYPE dev_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001812
1813
1814/*******************************************************************************
1815**
1816** Function BTA_DmAddBleKey
1817**
1818** Description Add/modify LE device information. This function will be
1819** normally called during host startup to restore all required
1820** information stored in the NVRAM.
1821**
1822** Parameters: bd_addr - BD address of the peer
1823** p_le_key - LE key values.
1824** key_type - LE SMP key type.
1825**
1826** Returns void
1827**
1828*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001829extern void BTA_DmAddBleKey (BD_ADDR bd_addr,
1830 tBTA_LE_KEY_VALUE *p_le_key,
1831 tBTA_LE_KEY_TYPE key_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001832
1833/*******************************************************************************
1834**
1835** Function BTA_DmSetBlePrefConnParams
1836**
1837** Description This function is called to set the preferred connection
1838** parameters when default connection parameter is not desired.
1839**
1840** Parameters: bd_addr - BD address of the peripheral
1841** min_conn_int - minimum preferred connection interval
1842** max_conn_int - maximum preferred connection interval
1843** slave_latency - preferred slave latency
1844** supervision_tout - preferred supervision timeout
1845**
1846**
1847** Returns void
1848**
1849*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001850extern void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr,
1851 UINT16 min_conn_int, UINT16 max_conn_int,
1852 UINT16 slave_latency, UINT16 supervision_tout );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001853
1854/*******************************************************************************
1855**
1856** Function BTA_DmSetBleConnScanParams
1857**
1858** Description This function is called to set scan parameters used in
1859** BLE connection request
1860**
Satya Calloji444a8da2015-03-06 10:38:22 -08001861** Parameters: scan_interval - scan interval
The Android Open Source Project5738f832012-12-12 16:00:35 -08001862** scan_window - scan window
1863**
1864** Returns void
1865**
1866*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07001867extern void BTA_DmSetBleConnScanParams(UINT32 scan_interval,
1868 UINT32 scan_window);
1869
1870/*******************************************************************************
1871**
1872** Function BTA_DmSetBleScanParams
1873**
1874** Description This function is called to set scan parameters
1875**
1876** Parameters: client_if - Client IF
1877** scan_interval - scan interval
1878** scan_window - scan window
1879** scan_mode - scan mode
1880** scan_param_setup_status_cback - Set scan param status callback
1881**
1882** Returns void
1883**
1884*******************************************************************************/
1885extern void BTA_DmSetBleScanParams(tGATT_IF client_if, UINT32 scan_interval,
1886 UINT32 scan_window, tBLE_SCAN_MODE scan_mode,
1887 tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_status_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001888
1889/*******************************************************************************
1890**
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001891** Function BTA_DmSetBleAdvParams
1892**
1893** Description This function sets the advertising parameters BLE functionality.
1894** It is to be called when device act in peripheral or broadcaster
1895** role.
1896**
1897** Parameters: adv_int_min - adv interval minimum
1898** adv_int_max - adv interval max
1899** p_dir_bda - directed adv initator address
1900**
1901** Returns void
1902**
1903*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001904extern void BTA_DmSetBleAdvParams (UINT16 adv_int_min, UINT16 adv_int_max,
1905 tBLE_BD_ADDR *p_dir_bda);
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001906/*******************************************************************************
1907**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001908** Function BTA_DmSearchExt
1909**
1910** Description This function searches for peer Bluetooth devices. It performs
1911** an inquiry and gets the remote name for devices. Service
1912** discovery is done if services is non zero
1913**
1914** Parameters p_dm_inq: inquiry conditions
1915** services: if service is not empty, service discovery will be done.
1916** for all GATT based service condition, put num_uuid, and
1917** p_uuid is the pointer to the list of UUID values.
1918** p_cback: callback functino when search is completed.
1919**
1920**
1921**
1922** Returns void
1923**
1924*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001925extern void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services,
1926 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001927
1928/*******************************************************************************
1929**
1930** Function BTA_DmDiscoverExt
1931**
1932** Description This function does service discovery for services of a
1933** peer device. When services.num_uuid is 0, it indicates all
1934** GATT based services are to be searched; other wise a list of
1935** UUID of interested services should be provided through
1936** services.p_uuid.
1937**
1938**
1939**
1940** Returns void
1941**
1942*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001943extern void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
1944 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001945
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001946/*******************************************************************************
1947**
1948** Function BTA_DmDiscoverByTransport
1949**
1950** Description This function does service discovery on particular transport
1951** for services of a
1952** peer device. When services.num_uuid is 0, it indicates all
1953** GATT based services are to be searched; other wise a list of
1954** UUID of interested services should be provided through
1955** p_services->p_uuid.
1956**
1957**
1958**
1959** Returns void
1960**
1961*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001962extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
1963 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search,
1964 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001965
1966/*******************************************************************************
1967**
1968** Function BTA_DmSetEncryption
1969**
1970** Description This function is called to ensure that connection is
1971** encrypted. Should be called only on an open connection.
1972** Typically only needed for connections that first want to
1973** bring up unencrypted links, then later encrypt them.
1974**
1975** Parameters: bd_addr - Address of the peer device
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001976** transport - transport of the link to be encruypted
The Android Open Source Project5738f832012-12-12 16:00:35 -08001977** p_callback - Pointer to callback function to indicat the
1978** link encryption status
1979** sec_act - This is the security action to indicate
1980** what knid of BLE security level is required for
1981** the BLE link if the BLE is supported
1982** Note: This parameter is ignored for the BR/EDR link
1983** or the BLE is not supported
1984**
1985** Returns void
1986**
1987**
1988*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001989extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
1990 tBTA_DM_ENCRYPT_CBACK *p_callback,
1991 tBTA_DM_BLE_SEC_ACT sec_act);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001992
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001993
1994/*******************************************************************************
1995**
1996** Function BTA_DmBleObserve
1997**
1998** Description This procedure keep the device listening for advertising
1999** events from a broadcast device.
2000**
2001** Parameters start: start or stop observe.
2002** duration : Duration of the scan. Continuous scan if 0 is passed
2003** p_results_cb: Callback to be called with scan results
2004**
2005** Returns void
2006**
2007*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002008extern void BTA_DmBleObserve(BOOLEAN start, UINT8 duration,
2009 tBTA_DM_SEARCH_CBACK *p_results_cb);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002010
2011
The Android Open Source Project5738f832012-12-12 16:00:35 -08002012#endif
2013
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002014#if BLE_INCLUDED == TRUE
The Android Open Source Project5738f832012-12-12 16:00:35 -08002015// btla-specific --
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002016/*******************************************************************************
2017**
2018** Function BTA_DmBleConfigLocalPrivacy
2019**
2020** Description Enable/disable privacy on the local device
2021**
2022** Parameters: privacy_enable - enable/disabe privacy on remote device.
2023**
2024** Returns void
2025**
2026*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002027extern void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002028
2029/*******************************************************************************
2030**
2031** Function BTA_DmBleEnableRemotePrivacy
2032**
2033** Description Enable/disable privacy on a remote device
2034**
2035** Parameters: bd_addr - BD address of the peer
2036** privacy_enable - enable/disabe privacy on remote device.
2037**
2038** Returns void
2039**
2040*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002041extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08002042
2043
2044/*******************************************************************************
2045**
2046** Function BTA_DmBleSetAdvConfig
2047**
2048** Description This function is called to override the BTA default ADV parameters.
2049**
2050** Parameters Pointer to User defined ADV data structure
2051**
2052** Returns None
2053**
2054*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002055extern void BTA_DmBleSetAdvConfig (tBTA_BLE_AD_MASK data_mask,
2056 tBTA_BLE_ADV_DATA *p_adv_cfg,
2057 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002058
2059/*******************************************************************************
2060**
2061** Function BTA_DmBleSetScanRsp
2062**
2063** Description This function is called to override the BTA scan response.
2064**
2065** Parameters Pointer to User defined ADV data structure
2066**
2067** Returns None
2068**
2069*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002070extern void BTA_DmBleSetScanRsp (tBTA_BLE_AD_MASK data_mask,
2071 tBTA_BLE_ADV_DATA *p_adv_cfg,
2072 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002073
2074/*******************************************************************************
2075**
2076** Function BTA_DmBleBroadcast
2077**
2078** Description This function starts or stops LE broadcasting.
2079**
2080** Parameters start: start or stop broadcast.
2081**
2082** Returns None
2083**
2084*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002085extern void BTA_DmBleBroadcast (BOOLEAN start);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002086
Wei Wanga6ce7752014-05-20 06:30:32 +00002087
2088/*******************************************************************************
2089**
2090** Function BTA_BleEnableAdvInstance
2091**
2092** Description This function enables the Multi ADV instance feature
2093**
2094** Parameters p_params Pointer to ADV param user defined structure
2095** p_cback Pointer to Multi ADV callback structure
2096** p_ref - Reference pointer
2097**
2098** Returns None
2099**
2100*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002101extern void BTA_BleEnableAdvInstance (tBTA_BLE_ADV_PARAMS *p_params,
Wei Wanga6ce7752014-05-20 06:30:32 +00002102 tBTA_BLE_MULTI_ADV_CBACK *p_cback,void *p_ref);
2103
2104/*******************************************************************************
2105**
2106** Function BTA_BleUpdateAdvInstParam
2107**
2108** Description This function updates the Multi ADV instance params
2109**
2110** Parameters inst_id Instance ID
2111** p_params Pointer to ADV param user defined structure
2112**
2113** Returns None
2114**
2115*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002116extern void BTA_BleUpdateAdvInstParam (UINT8 inst_id,
Wei Wanga6ce7752014-05-20 06:30:32 +00002117 tBTA_BLE_ADV_PARAMS *p_params);
2118
2119/*******************************************************************************
2120**
2121** Function BTA_BleCfgAdvInstData
2122**
2123** Description This function is called to configure the ADV instance data
2124**
2125** Parameters inst_id - Instance ID
2126** is_scan_rsp - Boolean value Scan response
2127** Pointer to User defined ADV data structure
2128** Returns None
2129**
2130*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002131extern void BTA_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp,
Wei Wanga6ce7752014-05-20 06:30:32 +00002132 tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_data);
2133
2134/*******************************************************************************
2135**
2136** Function BTA_BleDisableAdvInstance
2137**
2138** Description This function is called to disable the ADV instance
2139**
2140** Parameters inst_id - Instance ID to be disabled
2141**
2142** Returns None
2143**
2144*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002145extern void BTA_BleDisableAdvInstance(UINT8 inst_id);
Wei Wanga6ce7752014-05-20 06:30:32 +00002146
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07002147/*******************************************************************************
2148**
2149** Function BTA_DmBleUpdateConnectionParams
2150**
2151** Description Update connection parameters, can only be used when connection is up.
2152**
2153** Parameters: bd_addr - BD address of the peer
2154** min_int - minimum connection interval, [0x0004~ 0x4000]
2155** max_int - maximum connection interval, [0x0004~ 0x4000]
2156** latency - slave latency [0 ~ 500]
2157** timeout - supervision timeout [0x000a ~ 0xc80]
2158**
2159** Returns void
2160**
2161*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002162extern void BTA_DmBleUpdateConnectionParams(BD_ADDR bd_addr, UINT16 min_int,
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07002163 UINT16 max_int, UINT16 latency, UINT16 timeout);
Satya Callojic4e25962014-05-10 23:46:24 -07002164
2165/*******************************************************************************
2166**
Priti Aghera636d6712014-12-18 13:55:48 -08002167** Function BTA_DmBleSetDataLength
2168**
2169** Description This function is to set maximum LE data packet size
2170**
2171** Returns void
2172**
2173*******************************************************************************/
2174extern void BTA_DmBleSetDataLength(BD_ADDR remote_device, UINT16 tx_data_length);
2175
2176/*******************************************************************************
2177**
Satya Callojic4e25962014-05-10 23:46:24 -07002178** Function BTA_DmBleSetStorageParams
2179**
2180** Description This function is called to set the storage parameters
2181**
2182** Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning
2183** batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning
2184** batch_scan_notify_threshold - Setup notification level based on total space
2185** consumed by both pools. Setting it to 0 will disable threshold notification
2186** p_setup_cback - Setup callback
2187** p_thres_cback - Threshold callback
2188** p_rep_cback - Reports callback
Satya Calloji1acb61c2014-06-14 23:16:18 -07002189** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002190**
2191** Returns None
2192**
2193*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002194extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max,
Satya Callojic4e25962014-05-10 23:46:24 -07002195 UINT8 batch_scan_trunc_max,
2196 UINT8 batch_scan_notify_threshold,
2197 tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback,
2198 tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002199 tBTA_BLE_SCAN_REP_CBACK* p_rep_cback,
Satya Callojic4e25962014-05-10 23:46:24 -07002200 tBTA_DM_BLE_REF_VALUE ref_value);
2201
2202/*******************************************************************************
2203**
2204** Function BTA_DmBleEnableBatchScan
2205**
2206** Description This function is called to enable the batch scan
2207**
2208** Parameters scan_mode -Batch scan mode
2209** scan_interval - Scan interval
2210** scan_window - Scan window
2211** discard_rule -Discard rules
2212** addr_type - Address type
Satya Calloji1acb61c2014-06-14 23:16:18 -07002213** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002214**
2215** Returns None
2216**
2217*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002218extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
Satya Callojic4e25962014-05-10 23:46:24 -07002219 UINT32 scan_interval, UINT32 scan_window,
2220 tBTA_BLE_DISCARD_RULE discard_rule,
2221 tBLE_ADDR_TYPE addr_type,
2222 tBTA_DM_BLE_REF_VALUE ref_value);
2223
2224/*******************************************************************************
2225**
2226** Function BTA_DmBleReadScanReports
2227**
2228** Description This function is called to read the batch scan reports
2229**
2230** Parameters scan_mode -Batch scan mode
Satya Calloji1acb61c2014-06-14 23:16:18 -07002231** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002232**
2233** Returns None
2234**
2235*******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002236extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
Satya Callojic4e25962014-05-10 23:46:24 -07002237 tBTA_DM_BLE_REF_VALUE ref_value);
2238
2239/*******************************************************************************
2240**
2241** Function BTA_DmBleDisableBatchScan
2242**
2243** Description This function is called to disable the batch scanning
2244**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002245** Parameters ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002246**
2247** Returns None
2248**
2249*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002250extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002251
Satya Calloji1a9247a2014-06-05 13:15:15 -07002252/*******************************************************************************
2253**
2254** Function BTA_DmEnableScanFilter
2255**
2256** Description This function is called to enable the adv data payload filter
2257**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002258** Parameters action - enable or disable the APCF feature
2259** p_cmpl_cback - Command completed callback
2260** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002261**
2262** Returns void
2263**
2264*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002265extern void BTA_DmEnableScanFilter(UINT8 action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002266 tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
2267 tBTA_DM_BLE_REF_VALUE ref_value);
2268
2269/*******************************************************************************
2270**
2271** Function BTA_DmBleScanFilterSetup
2272**
2273** Description This function is called to setup the filter params
2274**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002275** Parameters p_target: enable the filter condition on a target device; if NULL
2276** filt_index - Filter index
2277** p_filt_params -Filter parameters
2278** ref_value - Reference value
2279** action - Add, delete or clear
2280** p_cmpl_back - Command completed callback
Satya Calloji1a9247a2014-06-05 13:15:15 -07002281**
2282** Returns void
2283**
2284*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002285extern void BTA_DmBleScanFilterSetup(UINT8 action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002286 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2287 tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
2288 tBLE_BD_ADDR *p_target,
2289 tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
2290 tBTA_DM_BLE_REF_VALUE ref_value);
2291
2292/*******************************************************************************
2293**
2294** Function BTA_DmBleCfgFilterCondition
2295**
2296** Description This function is called to configure the adv data payload filter
2297** condition.
2298**
2299** Parameters action: to read/write/clear
Satya Calloji1acb61c2014-06-14 23:16:18 -07002300** cond_type: filter condition type
2301** filt_index - Filter index
Satya Calloji1a9247a2014-06-05 13:15:15 -07002302** p_cond: filter condition parameter
Satya Calloji1acb61c2014-06-14 23:16:18 -07002303** p_cmpl_back - Command completed callback
2304** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002305**
2306** Returns void
2307**
2308*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002309extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002310 tBTA_DM_BLE_PF_COND_TYPE cond_type,
2311 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2312 tBTA_DM_BLE_PF_COND_PARAM *p_cond,
2313 tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
2314 tBTA_DM_BLE_REF_VALUE ref_value);
2315
Satya Calloji1acb61c2014-06-14 23:16:18 -07002316
2317/*******************************************************************************
2318**
2319** Function BTA_DmBleTrackAdvertiser
2320**
2321** Description This function is called to track the advertiser
2322**
2323** Parameters ref_value - Reference value
2324** p_track_adv_cback - ADV callback
2325**
2326** Returns None
2327**
2328*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002329extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
Satya Calloji1acb61c2014-06-14 23:16:18 -07002330 tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback);
2331
Satya Callojie5ba8842014-07-03 17:18:02 -07002332/*******************************************************************************
2333**
2334** Function BTA_DmBleGetEnergyInfo
2335**
2336** Description This function is called to obtain the energy info
2337**
2338** Parameters p_cmpl_cback - Command complete callback
2339**
2340** Returns void
2341**
2342*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002343extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback);
Satya Callojie5ba8842014-07-03 17:18:02 -07002344
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002345/*******************************************************************************
2346**
2347** Function BTA_BrcmInit
2348**
2349** Description This function initializes Broadcom specific VS handler in BTA
2350**
2351** Returns void
2352**
2353*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002354extern void BTA_VendorInit (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002355
2356/*******************************************************************************
2357**
2358** Function BTA_BrcmCleanup
2359**
2360** Description This function frees up Broadcom specific VS specific dynamic memory
2361**
2362** Returns void
2363**
2364*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002365extern void BTA_VendorCleanup (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002366
Matthew Xiefc4b2f12013-05-06 20:51:02 -07002367#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -08002368
2369#ifdef __cplusplus
2370}
2371#endif
2372
2373#endif /* BTA_API_H */