blob: e7c9f7337d5f3624c28f5e39858b081257411526 [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*/
88
89#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
90/* BLE profile service ID */
91#define BTA_BLE_SERVICE_ID 29 /* GATT profile */
92
93// btla-specific ++
94#define BTA_USER_SERVICE_ID 30 /* User requested UUID */
95
96#define BTA_MAX_SERVICE_ID 31
97// btla-specific --
98#else
99#define BTA_USER_SERVICE_ID 29 /* User requested UUID */
100#define BTA_MAX_SERVICE_ID 30
101#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. */
172
173typedef UINT8 tBTA_SEC;
174
175/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
176
177#define BTA_DM_IGNORE 0xFF
178
Andre Eisenbach781b5ad2013-05-28 15:11:43 +0900179#define BTA_ALL_APP_ID 0xFF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800180
181/* Discoverable Modes */
182#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
183#define BTA_DM_GENERAL_DISC BTM_GENERAL_DISCOVERABLE /* General discoverable. */
184#define BTA_DM_LIMITED_DISC BTM_LIMITED_DISCOVERABLE /* Limited discoverable. */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800185#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
186#define BTA_DM_BLE_NON_DISCOVERABLE BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
187#define BTA_DM_BLE_GENERAL_DISCOVERABLE BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
188#define BTA_DM_BLE_LIMITED_DISCOVERABLE BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
189#endif
190typedef 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 -0800191
192/* Connectable Modes */
193#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
194#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800195#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
196#define BTA_DM_BLE_NON_CONNECTABLE BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
197#define BTA_DM_BLE_CONNECTABLE BTM_BLE_CONNECTABLE /* Device is LE connectable. */
198#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800199
200// btla-specific ++
201typedef UINT16 tBTA_DM_CONN;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700202
203#define BTA_TRANSPORT_UNKNOWN 0
204#define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR
205#define BTA_TRANSPORT_LE BT_TRANSPORT_LE
206typedef tBT_TRANSPORT tBTA_TRANSPORT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800207
208/* Pairable Modes */
209#define BTA_DM_PAIRABLE 1
210#define BTA_DM_NON_PAIRABLE 0
211
212/* Connectable Paired Only Mode */
213#define BTA_DM_CONN_ALL 0
214#define BTA_DM_CONN_PAIRED 1
215
216/* Inquiry Modes */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800217#define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800218#define BTA_DM_GENERAL_INQUIRY BTM_GENERAL_INQUIRY /* Perform general inquiry. */
219#define BTA_DM_LIMITED_INQUIRY BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
220
221#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
222#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
223#define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
224#define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
225#endif
226typedef UINT8 tBTA_DM_INQ_MODE;
227
228/* Inquiry Filter Type */
229#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
230#define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
231#define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
232
233typedef UINT8 tBTA_DM_INQ_FILT;
234
235/* Authorize Response */
236#define BTA_DM_AUTH_PERM 0 /* Authorized for future connections to the service */
237#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
238#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
239
240typedef UINT8 tBTA_AUTH_RESP;
241
242/* M/S preferred roles */
243#define BTA_ANY_ROLE 0x00
244#define BTA_MASTER_ROLE_PREF 0x01
245#define BTA_MASTER_ROLE_ONLY 0x02
246
247typedef UINT8 tBTA_PREF_ROLES;
248
249enum
250{
251
252 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
253 support "role switch during connection" for
254 an incoming connection, when it already has
255 another connection in master role */
256 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
257 simulateous connection in Master and Slave roles
258 for short period of time */
259 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
260 and slave roles */
261
262};
263
264
265/* Inquiry filter device class condition */
266typedef struct
267{
268 DEV_CLASS dev_class; /* device class of interest */
269 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of interest */
270} tBTA_DM_COD_COND;
271
272
273/* Inquiry Filter Condition */
274typedef union
275{
276 BD_ADDR bd_addr; /* BD address of device to filter. */
277 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
278} tBTA_DM_INQ_COND;
279
280/* Inquiry Parameters */
281typedef struct
282{
283 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
284 UINT8 duration; /* Inquiry duration in 1.28 sec units. */
285 UINT8 max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
286 BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */
287 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
288 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
Matthew Xie7f3e4292013-09-30 12:44:10 -0700289#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE)
290 UINT8 intl_duration[4];/*duration array storing the interleave scan's time portions*/
291#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800292} tBTA_DM_INQ;
293
294typedef struct
295{
296 UINT8 bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */
297#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
298 UINT8 bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
299 UINT8 *bta_dm_eir_uuid16; /* 16-bit UUIDs */
300#else
301 UINT32 uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
302#endif
303 INT8 *bta_dm_eir_inq_tx_power; /* Inquiry TX power */
304 UINT8 bta_dm_eir_flag_len; /* length of flags in bytes */
305 UINT8 *bta_dm_eir_flags; /* flags for EIR */
306 UINT8 bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */
307 UINT8 *bta_dm_eir_manufac_spec; /* manufacturer specific */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800308 UINT8 bta_dm_eir_additional_len; /* length of additional data in bytes */
309 UINT8 *bta_dm_eir_additional; /* additional data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800310} tBTA_DM_EIR_CONF;
311
312#if BLE_INCLUDED == TRUE
313/* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */
314#define BTA_BLE_LIMIT_DISC_FLAG BTM_BLE_LIMIT_DISC_FLAG
315#define BTA_BLE_GEN_DISC_FLAG BTM_BLE_GEN_DISC_FLAG
316#define BTA_BLE_BREDR_NOT_SPT BTM_BLE_BREDR_NOT_SPT
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700317#define BTA_BLE_DMT_CONTROLLER_SPT BTM_BLE_DMT_CONTROLLER_SPT
318#define BTA_BLE_DMT_HOST_SPT BTM_BLE_DMT_HOST_SPT
The Android Open Source Project5738f832012-12-12 16:00:35 -0800319#define BTA_BLE_NON_LIMIT_DISC_FLAG BTM_BLE_NON_LIMIT_DISC_FLAG
320#define BTA_BLE_ADV_FLAG_MASK BTM_BLE_ADV_FLAG_MASK
321#define BTA_BLE_LIMIT_DISC_MASK BTM_BLE_LIMIT_DISC_MASK
322
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800323/* ADV data bit mask */
324#define BTA_BLE_AD_BIT_DEV_NAME BTM_BLE_AD_BIT_DEV_NAME
325#define BTA_BLE_AD_BIT_FLAGS BTM_BLE_AD_BIT_FLAGS
326#define BTA_BLE_AD_BIT_MANU BTM_BLE_AD_BIT_MANU
327#define BTA_BLE_AD_BIT_TX_PWR BTM_BLE_AD_BIT_TX_PWR
328#define BTA_BLE_AD_BIT_INT_RANGE BTM_BLE_AD_BIT_INT_RANGE
329#define BTA_BLE_AD_BIT_SERVICE BTM_BLE_AD_BIT_SERVICE
330#define BTA_BLE_AD_BIT_APPEARANCE BTM_BLE_AD_BIT_APPEARANCE
331#define BTA_BLE_AD_BIT_PROPRIETARY BTM_BLE_AD_BIT_PROPRIETARY
332#define BTA_DM_BLE_AD_BIT_SERVICE_SOL BTM_BLE_AD_BIT_SERVICE_SOL
333#define BTA_DM_BLE_AD_BIT_SERVICE_DATA BTM_BLE_AD_BIT_SERVICE_DATA
334#define BTA_DM_BLE_AD_BIT_SIGN_DATA BTM_BLE_AD_BIT_SIGN_DATA
335#define BTA_DM_BLE_AD_BIT_SERVICE_128SOL BTM_BLE_AD_BIT_SERVICE_128SOL
336#define BTA_DM_BLE_AD_BIT_PUBLIC_ADDR BTM_BLE_AD_BIT_PUBLIC_ADDR
337#define BTA_DM_BLE_AD_BIT_RANDOM_ADDR BTM_BLE_AD_BIT_RANDOM_ADDR
Wei Wanga6ce7752014-05-20 06:30:32 +0000338#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 -0800339
Wei Wanga6ce7752014-05-20 06:30:32 +0000340typedef tBTM_BLE_AD_MASK tBTA_BLE_AD_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800341
342/* slave preferred connection interval range */
343typedef struct
344{
345 UINT16 low;
346 UINT16 hi;
347
348}tBTA_BLE_INT_RANGE;
349
350/* Service tag supported in the device */
351typedef struct
352{
353 UINT8 num_service;
354 BOOLEAN list_cmpl;
355 UINT16 *p_uuid;
356}tBTA_BLE_SERVICE;
357
The Android Open Source Project5738f832012-12-12 16:00:35 -0800358
359typedef struct
360{
361 UINT8 len;
362 UINT8 *p_val;
363}tBTA_BLE_MANU;
364
365typedef struct
366{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800367 UINT8 adv_type;
368 UINT8 len;
369 UINT8 *p_val; /* number of len byte */
370}tBTA_BLE_PROP_ELEM;
371
372/* vendor proprietary adv type */
373typedef struct
374{
375 UINT8 num_elem;
376 tBTA_BLE_PROP_ELEM *p_elem;
377}tBTA_BLE_PROPRIETARY;
378
379typedef struct
380{
Wei Wanga6ce7752014-05-20 06:30:32 +0000381 tBT_UUID service_uuid;
382 UINT8 len;
383 UINT8 *p_val;
384}tBTA_BLE_SERVICE_DATA;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800385
Wei Wanga6ce7752014-05-20 06:30:32 +0000386typedef tBTM_BLE_128SERVICE tBTA_BLE_128SERVICE;
387typedef tBTM_BLE_32SERVICE tBTA_BLE_32SERVICE;
388
389typedef struct
390{
391 tBTA_BLE_INT_RANGE int_range; /* slave prefered conn interval range */
392 tBTA_BLE_MANU *p_manu; /* manufacturer data */
393 tBTA_BLE_SERVICE *p_services; /* 16 bits services */
394 tBTA_BLE_128SERVICE *p_services_128b; /* 128 bits service */
395 tBTA_BLE_32SERVICE *p_service_32b; /* 32 bits Service UUID */
396 tBTA_BLE_SERVICE *p_sol_services; /* 16 bits services Solicitation UUIDs */
397 tBTA_BLE_32SERVICE *p_sol_service_32b; /* List of 32 bit Service Solicitation UUIDs */
398 tBTA_BLE_128SERVICE *p_sol_service_128b;/* List of 128 bit Service Solicitation UUIDs */
399 tBTA_BLE_PROPRIETARY *p_proprietary; /* proprietary data */
400 tBTA_BLE_SERVICE_DATA *p_service_data; /* service data */
401 UINT16 appearance; /* appearance data */
402 UINT8 flag;
403 UINT8 tx_power;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800404}tBTA_BLE_ADV_DATA;
405
Wei Wanga6ce7752014-05-20 06:30:32 +0000406typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status);
407
408/* advertising channel map */
409#define BTA_BLE_ADV_CHNL_37 BTM_BLE_ADV_CHNL_37
410#define BTA_BLE_ADV_CHNL_38 BTM_BLE_ADV_CHNL_38
411#define BTA_BLE_ADV_CHNL_39 BTM_BLE_ADV_CHNL_39
412typedef tBTM_BLE_ADV_CHNL_MAP tBTA_BLE_ADV_CHNL_MAP; /* use as a bit mask */
413
414/* advertising filter policy */
415typedef tBTM_BLE_AFP tBTA_BLE_AFP;
416
417/* adv event type */
418#define BTA_BLE_CONNECT_EVT BTM_BLE_CONNECT_EVT /* Connectable undirected advertising */
419#define BTA_BLE_CONNECT_DIR_EVT BTM_BLE_CONNECT_DIR_EVT /* Connectable directed advertising */
420#define BTA_BLE_DISCOVER_EVT BTM_BLE_DISCOVER_EVT /* Scannable undirected advertising */
421#define BTA_BLE_NON_CONNECT_EVT BTM_BLE_NON_CONNECT_EVT /* Non connectable undirected advertising */
422typedef UINT8 tBTA_BLE_ADV_EVT;
423
424/* adv tx power level */
425#define BTA_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
426#define BTA_BLE_ADV_TX_POWER_LOW 1 /* low tx power */
427#define BTA_BLE_ADV_TX_POWER_MID 2 /* middle tx power */
428#define BTA_BLE_ADV_TX_POWER_UPPER 3 /* upper tx power */
429#define BTA_BLE_ADV_TX_POWER_MAX 4 /* maximum tx power */
430typedef UINT8 tBTA_BLE_ADV_TX_POWER;
431
432/* advertising instance parameters */
433typedef struct
434{
435 UINT16 adv_int_min; /* minimum adv interval */
436 UINT16 adv_int_max; /* maximum adv interval */
437 tBTA_BLE_ADV_EVT adv_type; /* adv event type */
438 tBTA_BLE_ADV_CHNL_MAP channel_map; /* adv channel map */
439 tBTA_BLE_AFP adv_filter_policy; /* advertising filter policy */
440 tBTA_BLE_ADV_TX_POWER tx_power; /* adv tx power */
441}tBTA_BLE_ADV_PARAMS;
442
The Android Open Source Project5738f832012-12-12 16:00:35 -0800443/* These are the fields returned in each device adv packet. It
444** is returned in the results callback if registered.
445*/
446typedef struct
447{
448 UINT8 conn_mode;
449 tBTA_BLE_AD_MASK ad_mask; /* mask of the valid adv data field */
450 UINT8 flag;
451 UINT8 tx_power_level;
452 UINT8 remote_name_len;
453 UINT8 *p_remote_name;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800454 tBTA_BLE_SERVICE service;
455} tBTA_BLE_INQ_DATA;
Satya Callojic4e25962014-05-10 23:46:24 -0700456
457enum
458{
459 BTA_BLE_SCAN_MODE_PASS=1,
460 BTA_BLE_SCAN_MODE_ACTI=2,
461 BTA_BLE_SCAN_MODE_PASS_ACTI=3
462};
463typedef UINT8 tBTA_BLE_SCAN_MODE;
464
465enum
466{
467 BTA_BLE_DISCARD_OLD_ITEMS=0,
468 BTA_BLE_DISCARD_LOWER_RSSI_ITEMS=1
469};
470typedef UINT8 tBTA_BLE_DISCARD_RULE;
471
472enum
473{
474 BTA_BLE_ADV_SEEN_FIRST_TIME=0,
475 BTA_BLE_ADV_TRACKING_TIMEOUT=1
476};
477typedef UINT8 tBTA_BLE_ADV_CHANGE_REASON;
478
479enum
480{
481 BTA_BLE_BATCH_SCAN_ENB_EVT = 1,
482 BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2,
483 BTA_BLE_BATCH_SCAN_DATA_EVT = 3,
484 BTA_BLE_BATCH_SCAN_THRES_EVT = 4,
485 BTA_BLE_BATCH_SCAN_PARAM_EVT = 5,
486 BTA_BLE_BATCH_SCAN_DIS_EVT = 6
487};
488typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
489
490typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800491#endif
492
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800493/* BLE customer specific feature function type definitions */
494/* data type used on customer specific feature for RSSI monitoring */
495#define BTA_BLE_RSSI_ALERT_HI 0
496#define BTA_BLE_RSSI_ALERT_RANGE 1
497#define BTA_BLE_RSSI_ALERT_LO 2
498typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_TYPE;
499
500#define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */
501#define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */
502#define BTA_BLE_RSSI_ALERT_RANGE_BIT BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */
503#define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */
504typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_MASK;
505
506
507typedef void (tBTA_DM_BLE_RSSI_CBACK) (BD_ADDR bd_addr, tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, INT8 rssi);
508
509/* max number of filter spot for different filter type */
510#define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */
511#define BTA_DM_BLE_MAX_ADDR_FILTER BTM_BLE_MAX_ADDR_FILTER /* 8 */
512#define BTA_DM_BLE_PF_STR_COND_MAX BTM_BLE_PF_STR_COND_MAX /* 4 apply to manu data , or local name */
513#define BTA_DM_BLE_PF_STR_LEN_MAX BTM_BLE_PF_STR_LEN_MAX /* match for first 20 bytes */
514
515#define BTA_DM_BLE_PF_LOGIC_OR 0
516#define BTA_DM_BLE_PF_LOGIC_AND 1
517typedef UINT8 tBTA_DM_BLE_PF_LOGIC_TYPE;
518
519enum
520{
521 BTA_DM_BLE_SCAN_COND_ADD,
522 BTA_DM_BLE_SCAN_COND_DELETE,
523 BTA_DM_BLE_SCAN_COND_CLEAR = 2
524};
525typedef UINT8 tBTA_DM_BLE_SCAN_COND_OP;
526
Satya Calloji1a9247a2014-06-05 13:15:15 -0700527/* ADV payload filtering vendor specific call event */
528enum
529{
530 BTA_BLE_SCAN_PF_ENABLE_EVT = 7,
531 BTA_BLE_SCAN_PF_COND_EVT
532};
533
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800534/* filter selection bit index */
535#define BTA_DM_BLE_PF_ADDR_FILTER BTM_BLE_PF_ADDR_FILTER
Andre Eisenbachb203d472013-11-20 17:23:06 -0800536#define BTA_DM_BLE_PF_SRVC_DATA BTM_BLE_PF_SRVC_DATA
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800537#define BTA_DM_BLE_PF_SRVC_UUID BTM_BLE_PF_SRVC_UUID
538#define BTA_DM_BLE_PF_SRVC_SOL_UUID BTM_BLE_PF_SRVC_SOL_UUID
539#define BTA_DM_BLE_PF_LOCAL_NAME BTM_BLE_PF_LOCAL_NAME
540#define BTA_DM_BLE_PF_MANU_DATA BTM_BLE_PF_MANU_DATA
Andre Eisenbachb203d472013-11-20 17:23:06 -0800541#define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN
Andre Eisenbach3aa60542013-03-22 18:00:51 -0700542#define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700543#define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800544typedef UINT8 tBTA_DM_BLE_PF_COND_TYPE;
545
Andre Eisenbachb203d472013-11-20 17:23:06 -0800546typedef union
547{
548 UINT16 uuid16_mask;
549 UINT32 uuid32_mask;
550 UINT8 uuid128_mask[LEN_UUID_128];
551}tBTA_DM_BLE_PF_COND_MASK;
552
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800553typedef struct
554{
555 tBLE_BD_ADDR *p_target_addr; /* target address, if NULL, generic UUID filter */
556 tBT_UUID uuid; /* UUID condition */
557 tBTA_DM_BLE_PF_LOGIC_TYPE cond_logic; /* AND/OR */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800558 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 -0800559}tBTA_DM_BLE_PF_UUID_COND;
560
561typedef struct
562{
563 UINT8 data_len; /* <= 20 bytes */
564 UINT8 *p_data;
565}tBTA_DM_BLE_PF_LOCAL_NAME_COND;
566
567typedef struct
568{
569 UINT16 company_id; /* company ID */
570 UINT8 data_len; /* <= 20 bytes */
571 UINT8 *p_pattern;
Andre Eisenbachb203d472013-11-20 17:23:06 -0800572 UINT16 company_id_mask; /* UUID value mask */
Satya Callojic4e25962014-05-10 23:46:24 -0700573 UINT8 *p_pattern_mask; /* Manufacturer data matching mask, same length
574 as data pattern, set to all 0xff, match exact data */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800575}tBTA_DM_BLE_PF_MANU_COND;
576
Andre Eisenbachb203d472013-11-20 17:23:06 -0800577typedef struct
578{
579 UINT16 uuid; /* service ID */
580 UINT8 data_len; /* <= 20 bytes */
581 UINT8 *p_pattern;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700582 UINT8 *p_pattern_mask; /* Service data matching mask, same length
583 as data pattern, set to all 0xff, match exact data */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800584}tBTA_DM_BLE_PF_SRVC_PATTERN_COND;
585
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800586typedef union
587{
588 tBLE_BD_ADDR target_addr;
589 tBTA_DM_BLE_PF_LOCAL_NAME_COND local_name; /* lcoal name filtering */
590 tBTA_DM_BLE_PF_MANU_COND manu_data; /* manufactuer data filtering */
591 tBTA_DM_BLE_PF_UUID_COND srvc_uuid; /* service UUID filtering */
592 tBTA_DM_BLE_PF_UUID_COND solicitate_uuid; /* solicitated service UUID filtering */
Andre Eisenbachb203d472013-11-20 17:23:06 -0800593 tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800594}tBTA_DM_BLE_PF_COND_PARAM;
595
Satya Calloji1a9247a2014-06-05 13:15:15 -0700596typedef UINT8 tBTA_DM_BLE_PF_FILT_INDEX;
597typedef UINT8 tBTA_DM_BLE_PF_AVBL_SPACE;
598
The Android Open Source Project5738f832012-12-12 16:00:35 -0800599typedef INT8 tBTA_DM_RSSI_VALUE;
600typedef UINT8 tBTA_DM_LINK_QUALITY_VALUE;
601
602
The Android Open Source Project5738f832012-12-12 16:00:35 -0800603typedef UINT8 tBTA_SIG_STRENGTH_MASK;
604
605
606/* Security Callback Events */
607#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
608#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
609#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
610#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
611#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
612#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
613#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
614#define BTA_DM_SIG_STRENGTH_EVT 7 /* Signal strength for bluetooth connection */
615#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
616#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
617#define BTA_DM_SP_CFM_REQ_EVT 10 /* Simple Pairing User Confirmation request. */
618#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
619#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
620#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
621#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
622#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
623#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
624#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
625#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
626#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
627#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
628#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
629// btla-specific ++
630#define BTA_DM_BLE_AUTH_CMPL_EVT 22 /* BLE Auth complete */
631// btla-specific --
632#define BTA_DM_DEV_UNPAIRED_EVT 23
633#define BTA_DM_HW_ERROR_EVT 24 /* BT Chip H/W error */
Ganesh Ganapathi Batta8d416912014-05-30 16:28:00 -0700634#define BTA_DM_LE_FEATURES_READ 25 /* Cotroller specific LE features are read */
Satya Callojie5ba8842014-07-03 17:18:02 -0700635#define BTA_DM_ENER_INFO_READ 26 /* Energy info read */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800636typedef UINT8 tBTA_DM_SEC_EVT;
637
638/* Structure associated with BTA_DM_ENABLE_EVT */
639typedef struct
640{
The Android Open Source Project5738f832012-12-12 16:00:35 -0800641 tBTA_STATUS status;
642} tBTA_DM_ENABLE;
643
644/* Structure associated with BTA_DM_PIN_REQ_EVT */
645typedef struct
646{
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700647 /* 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 -0800648 BD_ADDR bd_addr; /* BD address peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800649 DEV_CLASS dev_class; /* Class of Device */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800650 BD_NAME bd_name; /* Name of peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800651} tBTA_DM_PIN_REQ;
652
653/* BLE related definition */
654
655#define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10)
656#define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x))
657#define BTA_DM_AUTH_SMP_PASSKEY_FAIL BTA_DM_AUTH_CONVERT_SMP_CODE (SMP_PASSKEY_ENTRY_FAIL)
658#define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL)
659#define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL)
660#define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR)
661#define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT)
662#define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE)
663#define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD)
664#define BTA_DM_AUTH_SMP_UNKNOWN_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN)
665#define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS)
666#define BTA_DM_AUTH_SMP_INTERNAL_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR)
667#define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP)
668#define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL)
669#define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL)
670#define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY)
671#define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL)
672#define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT)
673
674/* connection parameter boundary value and dummy value */
675#define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN
676#define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX
677#define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN
678#define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX
679#define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN
680#define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX
681#define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX
682#define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN
683#define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX
684#define BTA_DM_BLE_CONN_PARAM_UNDEF BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be overwritten */
685
686
687#define BTA_LE_KEY_PENC BTM_LE_KEY_PENC /* encryption information of peer device */
688#define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */
689#define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */
690#define BTA_LE_KEY_LENC BTM_LE_KEY_LENC /* master role security information:div */
691#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
692#define BTA_LE_KEY_LCSRK BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
693typedef UINT8 tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
694
695
696typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS ;
697typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS;
698typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS ;
699typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS ;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800700typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS ;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800701
702typedef union
703{
704 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */
705 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800706 tBTA_LE_PID_KEYS pid_key; /* peer device ID key */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800707 tBTA_LE_LENC_KEYS lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/
708 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/
709}tBTA_LE_KEY_VALUE;
710
711#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
712#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
713typedef UINT8 tBTA_DM_BLE_LOCAL_KEY_MASK;
714
715typedef struct
716{
717 BT_OCTET16 ir;
718 BT_OCTET16 irk;
719 BT_OCTET16 dhk;
720}tBTA_BLE_LOCAL_ID_KEYS;
721
722#define BTA_DM_SEC_GRANTED BTA_SUCCESS
723#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
724#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
725typedef UINT8 tBTA_DM_BLE_SEC_GRANT;
726
727
728#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
729#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
730#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
731typedef UINT8 tBTA_DM_BLE_CONN_TYPE;
732
733typedef BOOLEAN (tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name);
734
735/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
736typedef struct
737{
738 BD_ADDR bd_addr; /* peer address */
739 BD_NAME bd_name; /* peer device name */
740} tBTA_DM_BLE_SEC_REQ;
741
742typedef struct
743{
744 BD_ADDR bd_addr; /* peer address */
745 tBTM_LE_KEY_TYPE key_type;
746 tBTM_LE_KEY_VALUE key_value;
747}tBTA_DM_BLE_KEY;
748
749/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
750typedef struct
751{
752 BD_ADDR bd_addr; /* BD address peer device. */
753 BD_NAME bd_name; /* Name of peer device. */
754 BOOLEAN key_present; /* Valid link key value in key element */
755 LINK_KEY key; /* Link key associated with peer device. */
756 UINT8 key_type; /* The type of Link Key */
757 BOOLEAN success; /* TRUE of authentication succeeded, FALSE if failed. */
758 UINT8 fail_reason; /* The HCI reason/error code for when success=FALSE */
759
760} tBTA_DM_AUTH_CMPL;
761
762
763/* Structure associated with BTA_DM_AUTHORIZE_EVT */
764typedef struct
765{
766 BD_ADDR bd_addr; /* BD address peer device. */
767 BD_NAME bd_name; /* Name of peer device. */
768 tBTA_SERVICE_ID service; /* Service ID to authorize. */
769// btla-specific ++
770 DEV_CLASS dev_class;
771// btla-specific --
772} tBTA_DM_AUTHORIZE;
773
774/* Structure associated with BTA_DM_LINK_UP_EVT */
775typedef struct
776{
777 BD_ADDR bd_addr; /* BD address peer device. */
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700778#if BLE_INCLUDED == TRUE
779 tBTA_TRANSPORT link_type;
780#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800781} tBTA_DM_LINK_UP;
782
783/* Structure associated with BTA_DM_LINK_DOWN_EVT */
784typedef struct
785{
786 BD_ADDR bd_addr; /* BD address peer device. */
787 UINT8 status; /* connection open/closed */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800788 BOOLEAN is_removed; /* TRUE if device is removed when link is down */
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700789#if BLE_INCLUDED == TRUE
790 tBTA_TRANSPORT link_type;
791#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800792} tBTA_DM_LINK_DOWN;
793
794/* Structure associated with BTA_DM_ROLE_CHG_EVT */
795typedef struct
796{
797 BD_ADDR bd_addr; /* BD address peer device. */
798 UINT8 new_role; /* the new connection role */
799} tBTA_DM_ROLE_CHG;
800
The Android Open Source Project5738f832012-12-12 16:00:35 -0800801/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
802typedef struct
803{
804 UINT8 level; /* when paging or inquiring, level is 10.
805 Otherwise, the number of ACL links */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800806 UINT8 level_flags; /* indicates individual flags */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800807} tBTA_DM_BUSY_LEVEL;
808
809#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* DisplayOnly */
810#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* DisplayYesNo */
811#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* KeyboardOnly */
812#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* NoInputNoOutput */
813typedef tBTM_IO_CAP tBTA_IO_CAP;
814
815#define BTA_AUTH_SP_NO BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single Profile/non-bonding
816 Numeric comparison with automatic accept allowed */
817#define BTA_AUTH_SP_YES BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding
818 Use IO Capabilities to determine authentication procedure */
819#define BTA_AUTH_AP_NO BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated bonding
820 Numeric comparison with automatic accept allowed */
821#define BTA_AUTH_AP_YES BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated bonding
822 Use IO Capabilities to determine authentication procedure */
823#define BTA_AUTH_SPGB_NO BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general bonding
824 Numeric comparison with automatic accept allowed */
825#define BTA_AUTH_SPGB_YES BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general bonding
826 Use IO Capabilities to determine authentication procedure */
827typedef tBTM_AUTH_REQ tBTA_AUTH_REQ;
828
829#define BTA_AUTH_DD_BOND BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */
830#define BTA_AUTH_GEN_BOND BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */
831#define BTA_AUTH_BONDS BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */
832
833#define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/
834#define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */
835#define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */
836typedef tBTM_LE_AUTH_REQ tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */
837
838#define BTA_OOB_NONE BTM_OOB_NONE
839#define BTA_OOB_PRESENT BTM_OOB_PRESENT
840#if BTM_OOB_INCLUDED == TRUE
841#define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN
842#endif
843typedef tBTM_OOB_DATA tBTA_OOB_DATA;
844
845/* Structure associated with BTA_DM_SP_CFM_REQ_EVT */
846typedef struct
847{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800848 /* 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 -0800849 BD_ADDR bd_addr; /* peer address */
850 DEV_CLASS dev_class; /* peer CoD */
851 BD_NAME bd_name; /* peer device name */
852 UINT32 num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */
853 BOOLEAN just_works; /* TRUE, if "Just Works" association model */
854 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
855 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
856 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
857 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */
858} tBTA_DM_SP_CFM_REQ;
859
860enum
861{
862 BTA_SP_KEY_STARTED, /* passkey entry started */
863 BTA_SP_KEY_ENTERED, /* passkey digit entered */
864 BTA_SP_KEY_ERASED, /* passkey digit erased */
865 BTA_SP_KEY_CLEARED, /* passkey cleared */
866 BTA_SP_KEY_COMPLT /* passkey entry completed */
867};
868typedef UINT8 tBTA_SP_KEY_TYPE;
869
870/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
871typedef struct
872{
873 BD_ADDR bd_addr; /* peer address */
874 tBTA_SP_KEY_TYPE notif_type;
875}tBTA_DM_SP_KEY_PRESS;
876
877/* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */
878typedef struct
879{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800880 /* 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 -0800881 BD_ADDR bd_addr; /* peer address */
882 DEV_CLASS dev_class; /* peer CoD */
883 BD_NAME bd_name; /* peer device name */
884 UINT32 passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */
885} tBTA_DM_SP_KEY_NOTIF;
886
887/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
888typedef struct
889{
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800890 /* 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 -0800891 BD_ADDR bd_addr; /* peer address */
892 DEV_CLASS dev_class; /* peer CoD */
893 BD_NAME bd_name; /* peer device name */
894} tBTA_DM_SP_RMT_OOB;
895
896/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
897typedef struct
898{
899 tBTA_STATUS result; /* TRUE of bond cancel succeeded, FALSE if failed. */
900} tBTA_DM_BOND_CANCEL_CMPL;
901
902/* Union of all security callback structures */
903typedef union
904{
905 tBTA_DM_ENABLE enable; /* BTA enabled */
906 tBTA_DM_PIN_REQ pin_req; /* PIN request. */
907 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */
908 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */
909 tBTA_DM_LINK_UP link_up; /* ACL connection down event */
910 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800911 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
912 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */
913 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */
914 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */
915 tBTA_DM_BOND_CANCEL_CMPL bond_cancel_cmpl; /* Bond Cancel Complete indication */
916 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */
917 tBTA_DM_ROLE_CHG role_chg; /* role change event */
918 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */
919 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */
920 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */
921 BT_OCTET16 ble_er; /* ER event data */
922} tBTA_DM_SEC;
923
924/* Security callback */
925typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
926
Wei Wanga6ce7752014-05-20 06:30:32 +0000927#define BTA_BLE_MULTI_ADV_ILLEGAL 0
928
929/* multi adv callback event */
930#define BTA_BLE_MULTI_ADV_ENB_EVT 1
931#define BTA_BLE_MULTI_ADV_DISABLE_EVT 2
932#define BTA_BLE_MULTI_ADV_PARAM_EVT 3
933#define BTA_BLE_MULTI_ADV_DATA_EVT 4
934
935typedef UINT8 tBTA_BLE_MULTI_ADV_EVT;
936
937/* multi adv callback */
938typedef void (tBTA_BLE_MULTI_ADV_CBACK)(tBTA_BLE_MULTI_ADV_EVT event,
939 UINT8 inst_id, void *p_ref, tBTA_STATUS status);
Satya Callojie5ba8842014-07-03 17:18:02 -0700940typedef UINT32 tBTA_DM_BLE_REF_VALUE;
Wei Wanga6ce7752014-05-20 06:30:32 +0000941
Satya Calloji1a9247a2014-06-05 13:15:15 -0700942#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
943#define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG
944typedef UINT8 tBTA_DM_BLE_PF_EVT;
945
Satya Calloji1a9247a2014-06-05 13:15:15 -0700946#define BTA_DM_BLE_PF_ENABLE 1
947#define BTA_DM_BLE_PF_CONFIG 2
948typedef UINT8 tBTA_DM_BLE_PF_ACTION;
949
Satya Calloji1a9247a2014-06-05 13:15:15 -0700950/* Config callback */
951typedef void (tBTA_DM_BLE_PF_CFG_CBACK) (tBTA_DM_BLE_PF_ACTION action,
952 tBTA_DM_BLE_PF_COND_TYPE cfg_cond,
953 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, tBTA_STATUS status,
954 tBTA_DM_BLE_REF_VALUE ref_value);
955/* Param callback */
956typedef void (tBTA_DM_BLE_PF_PARAM_CBACK) (UINT8 action_type, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
957 tBTA_DM_BLE_REF_VALUE ref_value, tBTA_STATUS status);
958
959/* Status callback */
Satya Callojie5ba8842014-07-03 17:18:02 -0700960typedef void (tBTA_DM_BLE_PF_STATUS_CBACK) (UINT8 action, tBTA_STATUS status,
961 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700962
963
964#define BTA_DM_BLE_PF_BRDCAST_ADDR_FILT 1
965#define BTA_DM_BLE_PF_SERV_DATA_CHG_FILT 2
966#define BTA_DM_BLE_PF_SERV_UUID 4
967#define BTA_DM_BLE_PF_SERV_SOLC_UUID 8
968#define BTA_DM_BLE_PF_LOC_NAME_CHECK 16
969#define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32
970#define BTA_DM_BLE_PF_SERV_DATA_CHECK 64
971typedef UINT16 tBTA_DM_BLE_PF_FEAT_SEL;
972
973#define BTA_DM_BLE_PF_LIST_LOGIC_OR 1
974#define BTA_DM_BLE_PF_LIST_LOGIC_AND 2
975typedef UINT16 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
976
977#define BTA_DM_BLE_PF_FILT_LOGIC_OR 0
978#define BTA_DM_BLE_PF_FILT_LOGIC_AND 1
979typedef UINT16 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
980
981typedef UINT8 tBTA_DM_BLE_PF_RSSI_THRESHOLD;
982typedef UINT8 tBTA_DM_BLE_PF_DELIVERY_MODE;
983typedef UINT16 tBTA_DM_BLE_PF_TIMEOUT;
984typedef UINT8 tBTA_DM_BLE_PF_TIMEOUT_CNT;
985
986typedef struct
987{
988 tBTA_DM_BLE_PF_FEAT_SEL feat_seln;
989 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE list_logic_type;
990 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE filt_logic_type;
991 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_high_thres;
992 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_low_thres;
993 tBTA_DM_BLE_PF_DELIVERY_MODE dely_mode;
994 tBTA_DM_BLE_PF_TIMEOUT found_timeout;
995 tBTA_DM_BLE_PF_TIMEOUT lost_timeout;
996 tBTA_DM_BLE_PF_TIMEOUT_CNT found_timeout_cnt;
997} tBTA_DM_BLE_PF_FILT_PARAMS;
998
The Android Open Source Project5738f832012-12-12 16:00:35 -0800999/* Search callback events */
1000#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
1001#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
1002#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
1003#define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based servoce on a peer device. */
1004#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
1005#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
1006#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
1007
1008typedef UINT8 tBTA_DM_SEARCH_EVT;
1009
1010#define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
1011
1012/* Structure associated with BTA_DM_INQ_RES_EVT */
1013typedef struct
1014{
1015 BD_ADDR bd_addr; /* BD address peer device. */
1016 DEV_CLASS dev_class; /* Device class of peer device. */
1017 BOOLEAN remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
1018 /* If the device name is known to application BTA skips the remote name request */
1019 BOOLEAN is_limited; /* TRUE, if the limited inquiry bit is set in the CoD */
1020 INT8 rssi; /* The rssi value */
1021 UINT8 *p_eir; /* received EIR */
1022#if (BLE_INCLUDED == TRUE)
1023 UINT8 inq_result_type;
1024 UINT8 ble_addr_type;
1025 tBTM_BLE_EVT_TYPE ble_evt_type;
1026 tBT_DEVICE_TYPE device_type;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001027 UINT8 flag;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001028#endif
1029
1030} tBTA_DM_INQ_RES;
1031
1032/* Structure associated with BTA_DM_INQ_CMPL_EVT */
1033typedef struct
1034{
1035 UINT8 num_resps; /* Number of inquiry responses. */
1036} tBTA_DM_INQ_CMPL;
1037
1038/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
1039typedef struct
1040{
1041 BD_ADDR bd_addr; /* BD address peer device. */
1042 UINT8 num_record; /* Number of DI record */
1043 tBTA_STATUS result;
1044} tBTA_DM_DI_DISC_CMPL;
1045
1046/* Structure associated with BTA_DM_DISC_RES_EVT */
1047typedef struct
1048{
1049 BD_ADDR bd_addr; /* BD address peer device. */
1050 BD_NAME bd_name; /* Name of peer device. */
1051 tBTA_SERVICE_MASK services; /* Services found on peer device. */
1052// btla-specific ++
1053 UINT8 * p_raw_data; /* Raw data for discovery DB */
1054 UINT32 raw_data_size; /* size of raw data */
1055 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
1056 UINT32 num_uuids;
1057 UINT8 *p_uuid_list;
1058// btla-specific --
1059 tBTA_STATUS result;
1060} tBTA_DM_DISC_RES;
1061
1062/* Structure associated with tBTA_DM_DISC_BLE_RES */
1063typedef struct
1064{
1065 BD_ADDR bd_addr; /* BD address peer device. */
1066 BD_NAME bd_name; /* Name of peer device. */
1067 tBT_UUID service; /* GATT based Services UUID found on peer device. */
1068} tBTA_DM_DISC_BLE_RES;
1069
1070
1071/* Union of all search callback structures */
1072typedef union
1073{
1074 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
1075 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
1076 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
1077 tBTA_DM_DISC_BLE_RES disc_ble_res; /* discovery result for GATT based service */
1078 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
1079
1080} tBTA_DM_SEARCH;
1081
1082/* Search callback */
1083typedef void (tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data);
1084
1085/* Execute call back */
1086typedef void (tBTA_DM_EXEC_CBACK) (void * p_param);
1087
1088/* Encryption callback*/
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001089typedef 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 -08001090
1091#if BLE_INCLUDED == TRUE
1092#define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE
1093#define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT
1094#define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM
1095#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
1096typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
Satya Callojic4e25962014-05-10 23:46:24 -07001097
Satya Callojie5ba8842014-07-03 17:18:02 -07001098typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
1099typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
1100typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
1101typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED;
1102
1103#define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */
1104#define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */
1105#define BTA_DM_CONTRL_SCAN 2 /* Scan state - paging/inquiry/trying to connect*/
1106#define BTA_DM_CONTRL_IDLE 3 /* Idle state - page scan, LE advt, inquiry scan */
1107
1108typedef UINT8 tBTA_DM_CONTRL_STATE;
1109
1110
Satya Callojic4e25962014-05-10 23:46:24 -07001111typedef void (tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojie5ba8842014-07-03 17:18:02 -07001112
Satya Calloji1a9247a2014-06-05 13:15:15 -07001113typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, UINT8 report_format,
Satya Callojic4e25962014-05-10 23:46:24 -07001114 UINT8 num_records, UINT16 data_len,
1115 UINT8* p_rep_data, tBTA_STATUS status);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001116
Satya Callojie5ba8842014-07-03 17:18:02 -07001117typedef void (tBTA_BLE_SCAN_SETUP_CBACK) (tBTA_BLE_BATCH_SCAN_EVT evt,
1118 tBTA_DM_BLE_REF_VALUE ref_value,
Satya Callojic4e25962014-05-10 23:46:24 -07001119 tBTA_STATUS status);
1120
Satya Calloji1acb61c2014-06-14 23:16:18 -07001121typedef void (tBTA_BLE_TRACK_ADV_CMPL_CBACK)(int action, tBTA_STATUS status,
Satya Callojie5ba8842014-07-03 17:18:02 -07001122 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
1123 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001124
1125typedef void (tBTA_BLE_TRACK_ADV_CBACK)(int filt_index, tBLE_ADDR_TYPE addr_type, BD_ADDR bda,
1126 int adv_state, tBTA_DM_BLE_REF_VALUE ref_value);
1127
Satya Callojie5ba8842014-07-03 17:18:02 -07001128typedef void (tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
1129 tBTA_DM_BLE_RX_TIME_MS rx_time,
1130 tBTA_DM_BLE_IDLE_TIME_MS idle_time,
1131 tBTA_DM_BLE_ENERGY_USED energy_used,
1132 tBTA_DM_CONTRL_STATE ctrl_state,
1133 tBTA_STATUS status);
1134
The Android Open Source Project5738f832012-12-12 16:00:35 -08001135#else
1136typedef UINT8 tBTA_DM_BLE_SEC_ACT;
1137#endif
1138
1139/* Maximum service name length */
1140#define BTA_SERVICE_NAME_LEN 35
1141#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
1142#define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN
1143
1144
1145/* link policy masks */
1146#define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH
1147#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
1148#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
1149#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
1150typedef UINT16 tBTA_DM_LP_MASK;
1151
1152/* power mode actions */
1153#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
1154#define BTA_DM_PM_PARK 0x10 /* prefers park mode */
1155#define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */
1156#define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */
1157#define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */
1158#define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */
1159#define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */
1160#define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */
1161#define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */
1162#define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */
1163#define BTA_DM_PM_SNIFF_USER0 0x28 /* prefers user-defined sniff0 mode (testtool only) */
1164#define BTA_DM_PM_SNIFF_USER1 0x29 /* prefers user-defined sniff1 mode (testtool only) */
1165#define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */
1166#define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */
1167#define BTA_DM_PM_NO_PREF 0x01 /* service has no prefernce on power mode setting. eg. connection to service got closed */
1168
1169typedef UINT8 tBTA_DM_PM_ACTTION;
1170
1171/* index to bta_dm_ssr_spec */
1172#define BTA_DM_PM_SSR0 0
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001173#define BTA_DM_PM_SSR1 1 /* BTA_DM_PM_SSR1 will be dedicated for
1174 HH SSR setting entry, no other profile can use it */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001175#define BTA_DM_PM_SSR2 2
1176#define BTA_DM_PM_SSR3 3
1177#define BTA_DM_PM_SSR4 4
1178#define BTA_DM_PM_SSR5 5
1179#define BTA_DM_PM_SSR6 6
1180
1181#define BTA_DM_PM_NUM_EVTS 9
1182
1183#ifndef BTA_DM_PM_PARK_IDX
1184#define BTA_DM_PM_PARK_IDX 5 /* the actual index to bta_dm_pm_md[] for PARK mode */
1185#endif
1186
Adam Hampson63399d92014-05-19 16:23:45 -07001187#ifndef BTA_DM_PM_SNIFF_A2DP_IDX
1188#define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF
1189#endif
1190
1191#ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX
1192#define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF2
1193#endif
1194
1195#ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX
1196#define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3
1197#endif
1198
1199#ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX
1200#define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF4
1201#endif
1202
1203#ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX
1204#define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF2
1205#endif
1206
1207#ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX
1208#define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF2
1209#endif
1210
1211#ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX
1212#define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF2
1213#endif
1214
1215
1216#ifndef BTA_DM_PM_HH_OPEN_DELAY
1217#define BTA_DM_PM_HH_OPEN_DELAY 30000
1218#endif
1219
1220#ifndef BTA_DM_PM_HH_ACTIVE_DELAY
1221#define BTA_DM_PM_HH_ACTIVE_DELAY 30000
1222#endif
1223
1224#ifndef BTA_DM_PM_HH_IDLE_DELAY
1225#define BTA_DM_PM_HH_IDLE_DELAY 30000
1226#endif
1227
1228/* The Sniff Parameters defined below must be ordered from highest
1229 * latency (biggest interval) to lowest latency. If there is a conflict
1230 * among the connected services the setting with the lowest latency will
1231 * be selected. If a device should override a sniff parameter then it
1232 * must insure that order is maintained.
1233 */
1234#ifndef BTA_DM_PM_SNIFF_MAX
1235#define BTA_DM_PM_SNIFF_MAX 800
1236#define BTA_DM_PM_SNIFF_MIN 400
1237#define BTA_DM_PM_SNIFF_ATTEMPT 4
1238#define BTA_DM_PM_SNIFF_TIMEOUT 1
1239#endif
1240
1241#ifndef BTA_DM_PM_SNIFF1_MAX
1242#define BTA_DM_PM_SNIFF1_MAX 400
1243#define BTA_DM_PM_SNIFF1_MIN 200
1244#define BTA_DM_PM_SNIFF1_ATTEMPT 4
1245#define BTA_DM_PM_SNIFF1_TIMEOUT 1
1246#endif
1247
1248#ifndef BTA_DM_PM_SNIFF2_MAX
1249#define BTA_DM_PM_SNIFF2_MAX 180
1250#define BTA_DM_PM_SNIFF2_MIN 150
1251#define BTA_DM_PM_SNIFF2_ATTEMPT 4
1252#define BTA_DM_PM_SNIFF2_TIMEOUT 1
1253#endif
1254
1255#ifndef BTA_DM_PM_SNIFF3_MAX
1256#define BTA_DM_PM_SNIFF3_MAX 150
1257#define BTA_DM_PM_SNIFF3_MIN 50
1258#define BTA_DM_PM_SNIFF3_ATTEMPT 4
1259#define BTA_DM_PM_SNIFF3_TIMEOUT 1
1260#endif
1261
1262#ifndef BTA_DM_PM_SNIFF4_MAX
1263#define BTA_DM_PM_SNIFF4_MAX 54
1264#define BTA_DM_PM_SNIFF4_MIN 30
1265#define BTA_DM_PM_SNIFF4_ATTEMPT 4
1266#define BTA_DM_PM_SNIFF4_TIMEOUT 1
1267#endif
1268
1269#ifndef BTA_DM_PM_PARK_MAX
1270#define BTA_DM_PM_PARK_MAX 800
1271#define BTA_DM_PM_PARK_MIN 400
1272#define BTA_DM_PM_PARK_ATTEMPT 0
1273#define BTA_DM_PM_PARK_TIMEOUT 0
1274#endif
1275
1276
The Android Open Source Project5738f832012-12-12 16:00:35 -08001277/* Switch callback events */
1278#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
1279
1280typedef UINT8 tBTA_DM_SWITCH_EVT;
1281typedef void (tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, tBTA_STATUS status);
1282
1283/* Audio routing out configuration */
1284#define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */
1285#define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */
1286#define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */
1287#define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */
1288#define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */
1289#define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */
1290#define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */
1291#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
1292#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
1293
1294typedef UINT8 tBTA_DM_ROUTE_PATH;
1295
1296
1297/* Device Identification (DI) data structure
1298*/
1299/* Used to set the DI record */
1300typedef tSDP_DI_RECORD tBTA_DI_RECORD;
1301/* Used to get the DI record */
1302typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD;
1303/* SDP discovery database */
1304typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB;
1305
1306#ifndef BTA_DI_NUM_MAX
1307#define BTA_DI_NUM_MAX 3
1308#endif
1309
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001310/* Device features mask definitions */
1311#define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE
1312#define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001313/* ACL type
1314*/
1315#define BTA_DM_LINK_TYPE_BR_EDR 0x01
1316#define BTA_DM_LINK_TYPE_LE 0x02
1317#define BTA_DM_LINK_TYPE_ALL 0xFF
1318typedef UINT8 tBTA_DM_LINK_TYPE;
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001319
Satya Calloji6e2d9db2014-07-08 16:18:58 -07001320#define IMMEDIATE_DELY_MODE 0x00
1321#define ONFOUND_DELY_MODE 0x01
1322#define BATCH_DELY_MODE 0x02
1323#define ALLOW_ALL_FILTER 0x00
1324#define LOWEST_RSSI_VALUE 129
1325
The Android Open Source Project5738f832012-12-12 16:00:35 -08001326/*****************************************************************************
1327** External Function Declarations
1328*****************************************************************************/
1329#ifdef __cplusplus
1330extern "C"
1331{
1332#endif
1333
1334/*******************************************************************************
1335**
1336** Function BTA_EnableBluetooth
1337**
1338** Description This function initializes BTA and prepares BTA and the
1339** Bluetooth protocol stack for use. This function is
1340** typically called at startup or when Bluetooth services
1341** are required by the phone. This function must be called
1342** before calling any other API function.
1343**
1344**
1345** Returns BTA_SUCCESS if successful.
1346** BTA_FAIL if internal failure.
1347**
1348*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001349extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001350
1351/*******************************************************************************
1352**
1353** Function BTA_DisableBluetooth
1354**
1355** Description This function disables BTA and the Bluetooth protocol
1356** stack. It is called when BTA is no longer being used
1357** by any application in the system.
1358**
1359**
1360** Returns void
1361**
1362*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001363extern tBTA_STATUS BTA_DisableBluetooth(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001364
1365/*******************************************************************************
1366**
1367** Function BTA_EnableTestMode
1368**
1369** Description Enables bluetooth device under test mode
1370**
1371**
1372** Returns tBTA_STATUS
1373**
1374*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001375extern tBTA_STATUS BTA_EnableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001376
1377/*******************************************************************************
1378**
1379** Function BTA_DisableTestMode
1380**
1381** Description Disable bluetooth device under test mode
1382**
1383**
1384** Returns None
1385**
1386*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001387extern void BTA_DisableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001388
1389/*******************************************************************************
1390**
1391** Function BTA_DmSetDeviceName
1392**
1393** Description This function sets the Bluetooth name of the local device.
1394**
1395**
1396** Returns void
1397**
1398*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001399extern void BTA_DmSetDeviceName(char *p_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001400
1401/*******************************************************************************
1402**
1403** Function BTA_DmSetVisibility
1404**
1405** Description This function sets the Bluetooth connectable,discoverable,
1406** pairable and conn paired only modesmodes of the local device.
1407** This controls whether other Bluetooth devices can find and connect to
1408** the local device.
1409**
1410**
1411** Returns void
1412**
1413*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001414extern 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 -08001415
1416/*******************************************************************************
1417**
1418** Function BTA_DmSearch
1419**
1420** Description This function searches for peer Bluetooth devices. It
1421** first performs an inquiry; for each device found from the
1422** inquiry it gets the remote name of the device. If
1423** parameter services is nonzero, service discovery will be
1424** performed on each device for the services specified.
1425**
1426**
1427** Returns void
1428**
1429*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001430extern void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services,
1431 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001432
1433/*******************************************************************************
1434**
1435** Function BTA_DmSearchCancel
1436**
1437** Description This function cancels a search that has been initiated
1438** by calling BTA_DmSearch().
1439**
1440**
1441** Returns void
1442**
1443*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001444extern void BTA_DmSearchCancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001445
1446/*******************************************************************************
1447**
1448** Function BTA_DmDiscover
1449**
1450** Description This function performs service discovery for the services
1451** of a particular peer device.
1452**
1453**
1454** Returns void
1455**
1456*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001457extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
1458 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001459
1460// btla-specific ++
1461/*******************************************************************************
1462**
1463** Function BTA_DmDiscoverUUID
1464**
1465** Description This function performs service discovery for the services
1466** of a particular peer device.
1467**
1468**
1469** Returns void
1470**
1471*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001472extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
1473 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001474
1475/*******************************************************************************
1476**
1477** Function BTA_DmGetCachedRemoteName
1478**
1479** Description Retieve cached remote name if available
1480**
1481** Returns BTA_SUCCESS if cached name was retrieved
1482** BTA_FAILURE if cached name is not available
1483**
1484*******************************************************************************/
1485tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, UINT8 **pp_cached_name);
1486// btla-specific --
1487
1488/*******************************************************************************
1489**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001490** Function BTA_DmBond
1491**
1492** Description This function initiates a bonding procedure with a peer
1493** device. The bonding procedure enables authentication
1494** and optionally encryption on the Bluetooth link.
1495**
1496**
1497** Returns void
1498**
1499*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001500extern void BTA_DmBond(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001501
1502/*******************************************************************************
1503**
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001504** Function BTA_DmBondByTransport
1505**
1506** Description This function initiates a bonding procedure with a peer
1507** device by designated transport. The bonding procedure enables
1508** authentication and optionally encryption on the Bluetooth link.
1509**
1510**
1511** Returns void
1512**
1513*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001514extern void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001515
1516
1517/*******************************************************************************
1518**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001519** Function BTA_DmBondCancel
1520**
1521** Description This function cancels a bonding procedure with a peer
1522** device.
1523**
1524**
1525** Returns void
1526**
1527*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001528extern void BTA_DmBondCancel(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001529
1530/*******************************************************************************
1531**
1532** Function BTA_DmPinReply
1533**
1534** Description This function provides a PIN when one is requested by DM
1535** during a bonding procedure. The application should call
1536** this function after the security callback is called with
1537** a BTA_DM_PIN_REQ_EVT.
1538**
1539**
1540** Returns void
1541**
1542*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001543extern void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len,
1544 UINT8 *p_pin);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001545
1546#if (BTM_OOB_INCLUDED == TRUE)
1547/*******************************************************************************
1548**
1549** Function BTA_DmLocalOob
1550**
1551** Description This function retrieves the OOB data from local controller.
1552** The result is reported by bta_dm_co_loc_oob().
1553**
1554** Returns void
1555**
1556*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001557extern void BTA_DmLocalOob(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001558#endif /* BTM_OOB_INCLUDED */
1559
1560/*******************************************************************************
1561**
1562** Function BTA_DmConfirm
1563**
1564** Description This function accepts or rejects the numerical value of the
1565** Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT
1566**
1567** Returns void
1568**
1569*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001570extern void BTA_DmConfirm(BD_ADDR bd_addr, BOOLEAN accept);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001571
1572/*******************************************************************************
1573**
1574** Function BTA_DmAddDevice
1575**
1576** Description This function adds a device to the security database list
1577** of peer devices. This function would typically be called
1578** at system startup to initialize the security database with
1579** known peer devices. This is a direct execution function
1580** that may lock task scheduling on some platforms.
1581**
1582** Returns void
1583**
1584*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001585extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class,
1586 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
1587 BOOLEAN is_trusted, UINT8 key_type,
1588 tBTA_IO_CAP io_cap);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001589
1590/*******************************************************************************
1591**
1592** Function BTA_DmRemoveDevice
1593**
1594** Description This function removes a device from the security database.
1595** This is a direct execution function that may lock task
1596** scheduling on some platforms.
1597**
1598**
1599** Returns BTA_SUCCESS if successful.
1600** BTA_FAIL if operation failed.
1601**
1602*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001603extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001604
1605/*******************************************************************************
1606**
1607** Function BTA_GetEirService
1608**
1609** Description This function is called to get BTA service mask from EIR.
1610**
1611** Parameters p_eir - pointer of EIR significant part
1612** p_services - return the BTA service mask
1613**
1614** Returns None
1615**
1616*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001617extern void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001618
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001619/*******************************************************************************
1620**
1621** Function BTA_DmGetConnectionState
1622**
1623** Description Returns whether the remote device is currently connected.
1624**
1625** Returns 0 if the device is NOT connected.
1626**
1627*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001628extern UINT16 BTA_DmGetConnectionState( BD_ADDR bd_addr );
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001629
The Android Open Source Project5738f832012-12-12 16:00:35 -08001630
1631/*******************************************************************************
1632**
1633** Function BTA_DmSetLocalDiRecord
1634**
1635** Description This function adds a DI record to the local SDP database.
1636**
1637** Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1638**
1639*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001640extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
1641 UINT32 *p_handle );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001642
1643/*******************************************************************************
1644**
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001645**
1646** Function BTA_DmCloseACL
1647**
1648** Description This function force to close an ACL connection and remove the
1649** device from the security database list of known devices.
1650**
1651** Parameters: bd_addr - Address of the peer device
1652** remove_dev - remove device or not after link down
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001653** transport - which transport to close
1654
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001655**
1656** Returns void.
1657**
1658*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001659extern void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001660
1661/*******************************************************************************
1662**
1663** Function bta_dmexecutecallback
1664**
1665** Description This function will request BTA to execute a call back in the context of BTU task
1666** This API was named in lower case because it is only intended
1667** for the internal customers(like BTIF).
1668**
1669** Returns void
1670**
1671*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001672extern void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK* p_callback, void * p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001673
1674#if (BTM_SCO_HCI_INCLUDED == TRUE)
1675/*******************************************************************************
1676**
1677** Function BTA_DmPcmInitSamples
1678**
1679** Description initialize the down sample converter.
1680**
1681** src_sps: original samples per second (source audio data)
1682** (ex. 44100, 48000)
1683** bits: number of bits per pcm sample (16)
1684** n_channels: number of channels (i.e. mono(1), stereo(2)...)
1685**
1686** Returns none
1687**
1688*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001689extern void BTA_DmPcmInitSamples (UINT32 src_sps, UINT32 bits, UINT32 n_channels);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001690
1691/**************************************************************************************
1692** Function BTA_DmPcmResample
1693**
1694** Description Down sampling utility to convert higher sampling rate into 8K/16bits
1695** PCM samples.
1696**
1697** Parameters p_src: pointer to the buffer where the original sampling PCM
1698** are stored.
1699** in_bytes: Length of the input PCM sample buffer in byte.
1700** p_dst: pointer to the buffer which is to be used to store
1701** the converted PCM samples.
1702**
1703**
1704** Returns INT32: number of samples converted.
1705**
1706**************************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001707extern INT32 BTA_DmPcmResample (void *p_src, UINT32 in_bytes, void *p_dst);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001708#endif
1709
1710#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
1711/* BLE related API functions */
1712/*******************************************************************************
1713**
1714** Function BTA_DmBleSecurityGrant
1715**
1716** Description Grant security request access.
1717**
1718** Parameters: bd_addr - BD address of the peer
1719** res - security grant status.
1720**
1721** Returns void
1722**
1723*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001724extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001725
1726
1727
1728/*******************************************************************************
1729**
1730** Function BTA_DmBleSetBgConnType
1731**
1732** Description This function is called to set BLE connectable mode for a
1733** peripheral device.
1734**
1735** Parameters bg_conn_type: it can be auto connection, or selective connection.
1736** p_select_cback: callback function when selective connection procedure
1737** is being used.
1738**
1739** Returns void
1740**
1741*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001742extern 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 -08001743
1744/*******************************************************************************
1745**
1746** Function BTA_DmBlePasskeyReply
1747**
1748** Description Send BLE SMP passkey reply.
1749**
1750** Parameters: bd_addr - BD address of the peer
1751** accept - passkey entry sucessful or declined.
1752** passkey - passkey value, must be a 6 digit number,
1753** can be lead by 0.
1754**
1755** Returns void
1756**
1757*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001758extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, BOOLEAN accept, UINT32 passkey);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001759
1760/*******************************************************************************
1761**
1762** Function BTA_DmAddBleDevice
1763**
1764** Description Add a BLE device. This function will be normally called
1765** during host startup to restore all required information
1766** for a LE device stored in the NVRAM.
1767**
1768** Parameters: bd_addr - BD address of the peer
1769** dev_type - Remote device's device type.
1770** addr_type - LE device address type.
1771**
1772** Returns void
1773**
1774*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001775extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
1776 tBT_DEVICE_TYPE dev_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001777
1778
1779/*******************************************************************************
1780**
1781** Function BTA_DmAddBleKey
1782**
1783** Description Add/modify LE device information. This function will be
1784** normally called during host startup to restore all required
1785** information stored in the NVRAM.
1786**
1787** Parameters: bd_addr - BD address of the peer
1788** p_le_key - LE key values.
1789** key_type - LE SMP key type.
1790**
1791** Returns void
1792**
1793*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001794extern void BTA_DmAddBleKey (BD_ADDR bd_addr,
1795 tBTA_LE_KEY_VALUE *p_le_key,
1796 tBTA_LE_KEY_TYPE key_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001797
1798/*******************************************************************************
1799**
1800** Function BTA_DmSetBlePrefConnParams
1801**
1802** Description This function is called to set the preferred connection
1803** parameters when default connection parameter is not desired.
1804**
1805** Parameters: bd_addr - BD address of the peripheral
1806** min_conn_int - minimum preferred connection interval
1807** max_conn_int - maximum preferred connection interval
1808** slave_latency - preferred slave latency
1809** supervision_tout - preferred supervision timeout
1810**
1811**
1812** Returns void
1813**
1814*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001815extern void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr,
1816 UINT16 min_conn_int, UINT16 max_conn_int,
1817 UINT16 slave_latency, UINT16 supervision_tout );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001818
1819/*******************************************************************************
1820**
1821** Function BTA_DmSetBleConnScanParams
1822**
1823** Description This function is called to set scan parameters used in
1824** BLE connection request
1825**
1826** Parameters: bd_addr - BD address of the peripheral
1827** scan_interval - scan interval
1828** scan_window - scan window
1829**
1830** Returns void
1831**
1832*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001833extern void BTA_DmSetBleConnScanParams(UINT16 scan_interval,
1834 UINT16 scan_window );
The Android Open Source Project5738f832012-12-12 16:00:35 -08001835
1836/*******************************************************************************
1837**
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001838** Function BTA_DmSetBleAdvParams
1839**
1840** Description This function sets the advertising parameters BLE functionality.
1841** It is to be called when device act in peripheral or broadcaster
1842** role.
1843**
1844** Parameters: adv_int_min - adv interval minimum
1845** adv_int_max - adv interval max
1846** p_dir_bda - directed adv initator address
1847**
1848** Returns void
1849**
1850*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001851extern void BTA_DmSetBleAdvParams (UINT16 adv_int_min, UINT16 adv_int_max,
1852 tBLE_BD_ADDR *p_dir_bda);
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001853/*******************************************************************************
1854**
The Android Open Source Project5738f832012-12-12 16:00:35 -08001855** Function BTA_DmSearchExt
1856**
1857** Description This function searches for peer Bluetooth devices. It performs
1858** an inquiry and gets the remote name for devices. Service
1859** discovery is done if services is non zero
1860**
1861** Parameters p_dm_inq: inquiry conditions
1862** services: if service is not empty, service discovery will be done.
1863** for all GATT based service condition, put num_uuid, and
1864** p_uuid is the pointer to the list of UUID values.
1865** p_cback: callback functino when search is completed.
1866**
1867**
1868**
1869** Returns void
1870**
1871*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001872extern void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services,
1873 tBTA_DM_SEARCH_CBACK *p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001874
1875/*******************************************************************************
1876**
1877** Function BTA_DmDiscoverExt
1878**
1879** Description This function does service discovery for services of a
1880** peer device. When services.num_uuid is 0, it indicates all
1881** GATT based services are to be searched; other wise a list of
1882** UUID of interested services should be provided through
1883** services.p_uuid.
1884**
1885**
1886**
1887** Returns void
1888**
1889*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001890extern void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
1891 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001892
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001893/*******************************************************************************
1894**
1895** Function BTA_DmDiscoverByTransport
1896**
1897** Description This function does service discovery on particular transport
1898** for services of a
1899** peer device. When services.num_uuid is 0, it indicates all
1900** GATT based services are to be searched; other wise a list of
1901** UUID of interested services should be provided through
1902** p_services->p_uuid.
1903**
1904**
1905**
1906** Returns void
1907**
1908*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001909extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
1910 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search,
1911 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001912
1913/*******************************************************************************
1914**
1915** Function BTA_DmSetEncryption
1916**
1917** Description This function is called to ensure that connection is
1918** encrypted. Should be called only on an open connection.
1919** Typically only needed for connections that first want to
1920** bring up unencrypted links, then later encrypt them.
1921**
1922** Parameters: bd_addr - Address of the peer device
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001923** transport - transport of the link to be encruypted
The Android Open Source Project5738f832012-12-12 16:00:35 -08001924** p_callback - Pointer to callback function to indicat the
1925** link encryption status
1926** sec_act - This is the security action to indicate
1927** what knid of BLE security level is required for
1928** the BLE link if the BLE is supported
1929** Note: This parameter is ignored for the BR/EDR link
1930** or the BLE is not supported
1931**
1932** Returns void
1933**
1934**
1935*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001936extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
1937 tBTA_DM_ENCRYPT_CBACK *p_callback,
1938 tBTA_DM_BLE_SEC_ACT sec_act);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001939
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001940
1941/*******************************************************************************
1942**
1943** Function BTA_DmBleObserve
1944**
1945** Description This procedure keep the device listening for advertising
1946** events from a broadcast device.
1947**
1948** Parameters start: start or stop observe.
1949** duration : Duration of the scan. Continuous scan if 0 is passed
1950** p_results_cb: Callback to be called with scan results
1951**
1952** Returns void
1953**
1954*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001955extern void BTA_DmBleObserve(BOOLEAN start, UINT8 duration,
1956 tBTA_DM_SEARCH_CBACK *p_results_cb);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001957
1958
The Android Open Source Project5738f832012-12-12 16:00:35 -08001959#endif
1960
Andre Eisenbacheeeac992013-11-08 10:23:52 -08001961#if BLE_INCLUDED == TRUE
The Android Open Source Project5738f832012-12-12 16:00:35 -08001962// btla-specific --
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001963/*******************************************************************************
1964**
1965** Function BTA_DmBleConfigLocalPrivacy
1966**
1967** Description Enable/disable privacy on the local device
1968**
1969** Parameters: privacy_enable - enable/disabe privacy on remote device.
1970**
1971** Returns void
1972**
1973*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001974extern void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001975
1976/*******************************************************************************
1977**
1978** Function BTA_DmBleEnableRemotePrivacy
1979**
1980** Description Enable/disable privacy on a remote device
1981**
1982** Parameters: bd_addr - BD address of the peer
1983** privacy_enable - enable/disabe privacy on remote device.
1984**
1985** Returns void
1986**
1987*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001988extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001989
1990
1991/*******************************************************************************
1992**
1993** Function BTA_DmBleSetAdvConfig
1994**
1995** Description This function is called to override the BTA default ADV parameters.
1996**
1997** Parameters Pointer to User defined ADV data structure
1998**
1999** Returns None
2000**
2001*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002002extern void BTA_DmBleSetAdvConfig (tBTA_BLE_AD_MASK data_mask,
2003 tBTA_BLE_ADV_DATA *p_adv_cfg,
2004 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002005
2006/*******************************************************************************
2007**
2008** Function BTA_DmBleSetScanRsp
2009**
2010** Description This function is called to override the BTA scan response.
2011**
2012** Parameters Pointer to User defined ADV data structure
2013**
2014** Returns None
2015**
2016*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002017extern void BTA_DmBleSetScanRsp (tBTA_BLE_AD_MASK data_mask,
2018 tBTA_BLE_ADV_DATA *p_adv_cfg,
2019 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002020
2021/*******************************************************************************
2022**
2023** Function BTA_DmBleBroadcast
2024**
2025** Description This function starts or stops LE broadcasting.
2026**
2027** Parameters start: start or stop broadcast.
2028**
2029** Returns None
2030**
2031*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002032extern void BTA_DmBleBroadcast (BOOLEAN start);
Andre Eisenbacheeeac992013-11-08 10:23:52 -08002033
Wei Wanga6ce7752014-05-20 06:30:32 +00002034
2035/*******************************************************************************
2036**
2037** Function BTA_BleEnableAdvInstance
2038**
2039** Description This function enables the Multi ADV instance feature
2040**
2041** Parameters p_params Pointer to ADV param user defined structure
2042** p_cback Pointer to Multi ADV callback structure
2043** p_ref - Reference pointer
2044**
2045** Returns None
2046**
2047*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002048extern void BTA_BleEnableAdvInstance (tBTA_BLE_ADV_PARAMS *p_params,
Wei Wanga6ce7752014-05-20 06:30:32 +00002049 tBTA_BLE_MULTI_ADV_CBACK *p_cback,void *p_ref);
2050
2051/*******************************************************************************
2052**
2053** Function BTA_BleUpdateAdvInstParam
2054**
2055** Description This function updates the Multi ADV instance params
2056**
2057** Parameters inst_id Instance ID
2058** p_params Pointer to ADV param user defined structure
2059**
2060** Returns None
2061**
2062*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002063extern void BTA_BleUpdateAdvInstParam (UINT8 inst_id,
Wei Wanga6ce7752014-05-20 06:30:32 +00002064 tBTA_BLE_ADV_PARAMS *p_params);
2065
2066/*******************************************************************************
2067**
2068** Function BTA_BleCfgAdvInstData
2069**
2070** Description This function is called to configure the ADV instance data
2071**
2072** Parameters inst_id - Instance ID
2073** is_scan_rsp - Boolean value Scan response
2074** Pointer to User defined ADV data structure
2075** Returns None
2076**
2077*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002078extern void BTA_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp,
Wei Wanga6ce7752014-05-20 06:30:32 +00002079 tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_data);
2080
2081/*******************************************************************************
2082**
2083** Function BTA_BleDisableAdvInstance
2084**
2085** Description This function is called to disable the ADV instance
2086**
2087** Parameters inst_id - Instance ID to be disabled
2088**
2089** Returns None
2090**
2091*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002092extern void BTA_BleDisableAdvInstance(UINT8 inst_id);
Wei Wanga6ce7752014-05-20 06:30:32 +00002093
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07002094/*******************************************************************************
2095**
2096** Function BTA_DmBleUpdateConnectionParams
2097**
2098** Description Update connection parameters, can only be used when connection is up.
2099**
2100** Parameters: bd_addr - BD address of the peer
2101** min_int - minimum connection interval, [0x0004~ 0x4000]
2102** max_int - maximum connection interval, [0x0004~ 0x4000]
2103** latency - slave latency [0 ~ 500]
2104** timeout - supervision timeout [0x000a ~ 0xc80]
2105**
2106** Returns void
2107**
2108*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002109extern void BTA_DmBleUpdateConnectionParams(BD_ADDR bd_addr, UINT16 min_int,
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07002110 UINT16 max_int, UINT16 latency, UINT16 timeout);
Satya Callojic4e25962014-05-10 23:46:24 -07002111
2112/*******************************************************************************
2113**
2114** Function BTA_DmBleSetStorageParams
2115**
2116** Description This function is called to set the storage parameters
2117**
2118** Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning
2119** batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning
2120** batch_scan_notify_threshold - Setup notification level based on total space
2121** consumed by both pools. Setting it to 0 will disable threshold notification
2122** p_setup_cback - Setup callback
2123** p_thres_cback - Threshold callback
2124** p_rep_cback - Reports callback
Satya Calloji1acb61c2014-06-14 23:16:18 -07002125** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002126**
2127** Returns None
2128**
2129*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002130extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max,
Satya Callojic4e25962014-05-10 23:46:24 -07002131 UINT8 batch_scan_trunc_max,
2132 UINT8 batch_scan_notify_threshold,
2133 tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback,
2134 tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002135 tBTA_BLE_SCAN_REP_CBACK* p_rep_cback,
Satya Callojic4e25962014-05-10 23:46:24 -07002136 tBTA_DM_BLE_REF_VALUE ref_value);
2137
2138/*******************************************************************************
2139**
2140** Function BTA_DmBleEnableBatchScan
2141**
2142** Description This function is called to enable the batch scan
2143**
2144** Parameters scan_mode -Batch scan mode
2145** scan_interval - Scan interval
2146** scan_window - Scan window
2147** discard_rule -Discard rules
2148** addr_type - Address type
Satya Calloji1acb61c2014-06-14 23:16:18 -07002149** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002150**
2151** Returns None
2152**
2153*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002154extern void BTA_DmBleEnableBatchScan(tBTA_BLE_SCAN_MODE scan_mode,
Satya Callojic4e25962014-05-10 23:46:24 -07002155 UINT32 scan_interval, UINT32 scan_window,
2156 tBTA_BLE_DISCARD_RULE discard_rule,
2157 tBLE_ADDR_TYPE addr_type,
2158 tBTA_DM_BLE_REF_VALUE ref_value);
2159
2160/*******************************************************************************
2161**
2162** Function BTA_DmBleReadScanReports
2163**
2164** Description This function is called to read the batch scan reports
2165**
2166** Parameters scan_mode -Batch scan mode
Satya Calloji1acb61c2014-06-14 23:16:18 -07002167** ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002168**
2169** Returns None
2170**
2171*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002172extern void BTA_DmBleReadScanReports(tBTA_BLE_SCAN_MODE scan_type,
Satya Callojic4e25962014-05-10 23:46:24 -07002173 tBTA_DM_BLE_REF_VALUE ref_value);
2174
2175/*******************************************************************************
2176**
2177** Function BTA_DmBleDisableBatchScan
2178**
2179** Description This function is called to disable the batch scanning
2180**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002181** Parameters ref_value - Reference value
Satya Callojic4e25962014-05-10 23:46:24 -07002182**
2183** Returns None
2184**
2185*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002186extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002187
Satya Calloji1a9247a2014-06-05 13:15:15 -07002188/*******************************************************************************
2189**
2190** Function BTA_DmEnableScanFilter
2191**
2192** Description This function is called to enable the adv data payload filter
2193**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002194** Parameters action - enable or disable the APCF feature
2195** p_cmpl_cback - Command completed callback
2196** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002197**
2198** Returns void
2199**
2200*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002201extern void BTA_DmEnableScanFilter(UINT8 action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002202 tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
2203 tBTA_DM_BLE_REF_VALUE ref_value);
2204
2205/*******************************************************************************
2206**
2207** Function BTA_DmBleScanFilterSetup
2208**
2209** Description This function is called to setup the filter params
2210**
Satya Calloji1acb61c2014-06-14 23:16:18 -07002211** Parameters p_target: enable the filter condition on a target device; if NULL
2212** filt_index - Filter index
2213** p_filt_params -Filter parameters
2214** ref_value - Reference value
2215** action - Add, delete or clear
2216** p_cmpl_back - Command completed callback
Satya Calloji1a9247a2014-06-05 13:15:15 -07002217**
2218** Returns void
2219**
2220*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002221extern void BTA_DmBleScanFilterSetup(UINT8 action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002222 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2223 tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
2224 tBLE_BD_ADDR *p_target,
2225 tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
2226 tBTA_DM_BLE_REF_VALUE ref_value);
2227
2228/*******************************************************************************
2229**
2230** Function BTA_DmBleCfgFilterCondition
2231**
2232** Description This function is called to configure the adv data payload filter
2233** condition.
2234**
2235** Parameters action: to read/write/clear
Satya Calloji1acb61c2014-06-14 23:16:18 -07002236** cond_type: filter condition type
2237** filt_index - Filter index
Satya Calloji1a9247a2014-06-05 13:15:15 -07002238** p_cond: filter condition parameter
Satya Calloji1acb61c2014-06-14 23:16:18 -07002239** p_cmpl_back - Command completed callback
2240** ref_value - Reference value
Satya Calloji1a9247a2014-06-05 13:15:15 -07002241**
2242** Returns void
2243**
2244*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002245extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
Satya Calloji1a9247a2014-06-05 13:15:15 -07002246 tBTA_DM_BLE_PF_COND_TYPE cond_type,
2247 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2248 tBTA_DM_BLE_PF_COND_PARAM *p_cond,
2249 tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
2250 tBTA_DM_BLE_REF_VALUE ref_value);
2251
Satya Calloji1acb61c2014-06-14 23:16:18 -07002252
2253/*******************************************************************************
2254**
2255** Function BTA_DmBleTrackAdvertiser
2256**
2257** Description This function is called to track the advertiser
2258**
2259** Parameters ref_value - Reference value
2260** p_track_adv_cback - ADV callback
2261**
2262** Returns None
2263**
2264*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002265extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
Satya Calloji1acb61c2014-06-14 23:16:18 -07002266 tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback);
2267
Satya Callojie5ba8842014-07-03 17:18:02 -07002268/*******************************************************************************
2269**
2270** Function BTA_DmBleGetEnergyInfo
2271**
2272** Description This function is called to obtain the energy info
2273**
2274** Parameters p_cmpl_cback - Command complete callback
2275**
2276** Returns void
2277**
2278*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002279extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback);
Satya Callojie5ba8842014-07-03 17:18:02 -07002280
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002281/*******************************************************************************
2282**
2283** Function BTA_BrcmInit
2284**
2285** Description This function initializes Broadcom specific VS handler in BTA
2286**
2287** Returns void
2288**
2289*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002290extern void BTA_VendorInit (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002291
2292/*******************************************************************************
2293**
2294** Function BTA_BrcmCleanup
2295**
2296** Description This function frees up Broadcom specific VS specific dynamic memory
2297**
2298** Returns void
2299**
2300*******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002301extern void BTA_VendorCleanup (void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002302
Matthew Xiefc4b2f12013-05-06 20:51:02 -07002303#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -08002304
2305#ifdef __cplusplus
2306}
2307#endif
2308
2309#endif /* BTA_API_H */