blob: f9d137fd25ded39fe188aba37bc43f4e29396437 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
Satya Callojic4e25962014-05-10 23:46:24 -07003 * Copyright (C) 2003-2014 Broadcom Corporation
The Android Open Source Project5738f832012-12-12 16:00:35 -08004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19/******************************************************************************
20 *
21 * This is the public interface file for BTA, Broadcom's Bluetooth
22 * application layer for mobile phones.
23 *
24 ******************************************************************************/
25#ifndef BTA_API_H
26#define BTA_API_H
27
The Android Open Source Project5738f832012-12-12 16:00:35 -080028#include "bt_target.h"
29#include "bt_types.h"
30#include "btm_api.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080031
Marie Janssene9e58ce2016-06-17 14:12:17 -070032#if (BLE_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080033#include "btm_ble_api.h"
34#endif
35
Bryce Lee3d6accf2016-05-10 17:10:09 -070036#ifdef __cplusplus
37extern "C" {
38#endif
39
The Android Open Source Project5738f832012-12-12 16:00:35 -080040/*****************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -080041 * Constants and data types
42 ****************************************************************************/
The Android Open Source Project5738f832012-12-12 16:00:35 -080043
44/* Status Return Value */
Myles Watsoncd1fd072016-11-09 13:17:43 -080045#define BTA_SUCCESS 0 /* Successful operation. */
46#define BTA_FAILURE 1 /* Generic failure. */
47#define BTA_PENDING 2 /* API cannot be completed right now */
48#define BTA_BUSY 3
49#define BTA_NO_RESOURCES 4
50#define BTA_WRONG_MODE 5
The Android Open Source Project5738f832012-12-12 16:00:35 -080051
Marie Janssene9e58ce2016-06-17 14:12:17 -070052typedef uint8_t tBTA_STATUS;
The Android Open Source Project5738f832012-12-12 16:00:35 -080053
54/*
55 * Service ID
56 *
Myles Watsoncd1fd072016-11-09 13:17:43 -080057 * NOTES: When you add a new Service ID for BTA AND require to change the value
58 * of BTA_MAX_SERVICE_ID,
59 * make sure that the correct security ID of the new service from
60 * Security service definitions (btm_api.h)
61 * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in
62 * bta_dm_act.c.
The Android Open Source Project5738f832012-12-12 16:00:35 -080063 */
64
Myles Watsoncd1fd072016-11-09 13:17:43 -080065#define BTA_RES_SERVICE_ID 0 /* Reserved */
66#define BTA_SPP_SERVICE_ID 1 /* Serial port profile. */
67#define BTA_DUN_SERVICE_ID 2 /* Dial-up networking profile. */
68#define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */
69#define BTA_LAP_SERVICE_ID 4 /* LAN access profile. */
70#define BTA_HSP_SERVICE_ID 5 /* Headset profile. */
71#define BTA_HFP_SERVICE_ID 6 /* Hands-free profile. */
72#define BTA_OPP_SERVICE_ID 7 /* Object push */
73#define BTA_FTP_SERVICE_ID 8 /* File transfer */
74#define BTA_CTP_SERVICE_ID 9 /* Cordless Terminal */
75#define BTA_ICP_SERVICE_ID 10 /* Intercom Terminal */
76#define BTA_SYNC_SERVICE_ID 11 /* Synchronization */
77#define BTA_BPP_SERVICE_ID 12 /* Basic printing profile */
78#define BTA_BIP_SERVICE_ID 13 /* Basic Imaging profile */
79#define BTA_PANU_SERVICE_ID 14 /* PAN User */
80#define BTA_NAP_SERVICE_ID 15 /* PAN Network access point */
81#define BTA_GN_SERVICE_ID 16 /* PAN Group Ad-hoc networks */
82#define BTA_SAP_SERVICE_ID 17 /* SIM Access profile */
83#define BTA_A2DP_SINK_SERVICE_ID 18 /* A2DP Sink */
84#define BTA_AVRCP_SERVICE_ID 19 /* A/V remote control */
85#define BTA_HID_SERVICE_ID 20 /* HID */
86#define BTA_VDP_SERVICE_ID 21 /* Video distribution */
87#define BTA_PBAP_SERVICE_ID 22 /* PhoneBook Access Server*/
88#define BTA_HSP_HS_SERVICE_ID 23 /* HFP HS role */
89#define BTA_HFP_HS_SERVICE_ID 24 /* HSP HS role */
90#define BTA_MAP_SERVICE_ID 25 /* Message Access Profile */
91#define BTA_MN_SERVICE_ID 26 /* Message Notification Service */
92#define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */
93#define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/
94#define BTA_SDP_SERVICE_ID 29 /* SDP Search*/
Marie Janssene9e58ce2016-06-17 14:12:17 -070095#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -080096/* BLE profile service ID */
Myles Watsoncd1fd072016-11-09 13:17:43 -080097#define BTA_BLE_SERVICE_ID 30 /* GATT profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -080098
Myles Watsoncd1fd072016-11-09 13:17:43 -080099#define BTA_USER_SERVICE_ID 31 /* User requested UUID */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800100
Myles Watsoncd1fd072016-11-09 13:17:43 -0800101#define BTA_MAX_SERVICE_ID 32
The Android Open Source Project5738f832012-12-12 16:00:35 -0800102#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800103#define BTA_USER_SERVICE_ID 30 /* User requested UUID */
104#define BTA_MAX_SERVICE_ID 31
The Android Open Source Project5738f832012-12-12 16:00:35 -0800105#endif
106/* service IDs (BTM_SEC_SERVICE_FIRST_EMPTY + 1) to (BTM_SEC_MAX_SERVICES - 1)
107 * are used by BTA JV */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800108#define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1)
109#define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800110
Marie Janssene9e58ce2016-06-17 14:12:17 -0700111typedef uint8_t tBTA_SERVICE_ID;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800112
113/* Service ID Mask */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800114#define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */
115#define BTA_SPP_SERVICE_MASK 0x00000002 /* Serial port profile. */
116#define BTA_DUN_SERVICE_MASK 0x00000004 /* Dial-up networking profile. */
117#define BTA_FAX_SERVICE_MASK 0x00000008 /* Fax profile. */
118#define BTA_LAP_SERVICE_MASK 0x00000010 /* LAN access profile. */
119#define BTA_HSP_SERVICE_MASK 0x00000020 /* HSP AG role. */
120#define BTA_HFP_SERVICE_MASK 0x00000040 /* HFP AG role */
121#define BTA_OPP_SERVICE_MASK 0x00000080 /* Object push */
122#define BTA_FTP_SERVICE_MASK 0x00000100 /* File transfer */
123#define BTA_CTP_SERVICE_MASK 0x00000200 /* Cordless Terminal */
124#define BTA_ICP_SERVICE_MASK 0x00000400 /* Intercom Terminal */
125#define BTA_SYNC_SERVICE_MASK 0x00000800 /* Synchronization */
126#define BTA_BPP_SERVICE_MASK 0x00001000 /* Print server */
127#define BTA_BIP_SERVICE_MASK 0x00002000 /* Basic Imaging */
128#define BTA_PANU_SERVICE_MASK 0x00004000 /* PAN User */
129#define BTA_NAP_SERVICE_MASK 0x00008000 /* PAN Network access point */
130#define BTA_GN_SERVICE_MASK 0x00010000 /* PAN Group Ad-hoc networks */
131#define BTA_SAP_SERVICE_MASK 0x00020000 /* PAN Group Ad-hoc networks */
132#define BTA_A2DP_SERVICE_MASK 0x00040000 /* Advanced audio distribution */
133#define BTA_AVRCP_SERVICE_MASK 0x00080000 /* A/V remote control */
134#define BTA_HID_SERVICE_MASK 0x00100000 /* HID */
135#define BTA_VDP_SERVICE_MASK 0x00200000 /* Video distribution */
136#define BTA_PBAP_SERVICE_MASK 0x00400000 /* Phone Book Server */
137#define BTA_HSP_HS_SERVICE_MASK 0x00800000 /* HFP HS role */
138#define BTA_HFP_HS_SERVICE_MASK 0x01000000 /* HSP HS role */
139#define BTA_MAS_SERVICE_MASK 0x02000000 /* Message Access Profile */
140#define BTA_MN_SERVICE_MASK 0x04000000 /* Message Notification Profile */
141#define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */
142#define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800143
Marie Janssene9e58ce2016-06-17 14:12:17 -0700144#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800145#define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */
146#define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800147#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800148#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800149#endif
150
Marie Janssene9e58ce2016-06-17 14:12:17 -0700151#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800152#define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800153#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800154#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800155#endif
156
Marie Janssene9e58ce2016-06-17 14:12:17 -0700157typedef uint32_t tBTA_SERVICE_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800158
159/* extended service mask, including mask with one or more GATT UUID */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800160typedef struct {
161 tBTA_SERVICE_MASK srvc_mask;
162 uint8_t num_uuid;
163 tBT_UUID* p_uuid;
164} tBTA_SERVICE_MASK_EXT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800165
166/* Security Setting Mask */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800167#define BTA_SEC_NONE BTM_SEC_NONE /* No security. */
168#define BTA_SEC_AUTHORIZE \
169 (BTM_SEC_IN_AUTHORIZE) /* Authorization required (only needed for out \
170 going connection )*/
171#define BTA_SEC_AUTHENTICATE \
172 (BTM_SEC_IN_AUTHENTICATE | \
173 BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */
174#define BTA_SEC_ENCRYPT \
175 (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */
176#define BTA_SEC_MODE4_LEVEL4 \
177 (BTM_SEC_MODE4_LEVEL4) /* Mode 4 level 4 service, i.e. incoming/outgoing \
178 MITM and P-256 encryption */
179#define BTA_SEC_MITM \
180 (BTM_SEC_IN_MITM | BTM_SEC_OUT_MITM) /* Man-In-The_Middle protection */
181#define BTA_SEC_IN_16_DIGITS \
182 (BTM_SEC_IN_MIN_16_DIGIT_PIN) /* Min 16 digit for pin code */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800183
Marie Janssene9e58ce2016-06-17 14:12:17 -0700184typedef uint16_t tBTA_SEC;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800185
Myles Watsoncd1fd072016-11-09 13:17:43 -0800186/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only
187 * device modes */
188#define BTA_DM_IGNORE 0x00FF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800189
VenkatRaghavan VijayaRaghavan76356ae2015-04-21 11:32:29 -0700190/* Ignore for Discoverable, Connectable only for LE modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800191#define BTA_DM_LE_IGNORE 0xFF00
The Android Open Source Project5738f832012-12-12 16:00:35 -0800192
Myles Watsoncd1fd072016-11-09 13:17:43 -0800193#define BTA_APP_ID_PAN_MULTI 0xFE /* app id for pan multiple connection */
194#define BTA_ALL_APP_ID 0xFF
The Android Open Source Project5738f832012-12-12 16:00:35 -0800195
196/* Discoverable Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800197#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
198#define BTA_DM_GENERAL_DISC \
199 BTM_GENERAL_DISCOVERABLE /* General discoverable. \
200 */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700201#if (BLE_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800202#define BTA_DM_BLE_NON_DISCOVERABLE \
203 BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
204#define BTA_DM_BLE_GENERAL_DISCOVERABLE \
205 BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
206#define BTA_DM_BLE_LIMITED_DISCOVERABLE \
207 BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800208#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800209typedef uint16_t
210 tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and
211 LE mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800212
213/* Connectable Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800214#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
215#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700216#if (BLE_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800217#define BTA_DM_BLE_NON_CONNECTABLE \
218 BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
219#define BTA_DM_BLE_CONNECTABLE \
220 BTM_BLE_CONNECTABLE /* Device is LE connectable. */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800221#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800222
Marie Janssene9e58ce2016-06-17 14:12:17 -0700223typedef uint16_t tBTA_DM_CONN;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700224
Myles Watsoncd1fd072016-11-09 13:17:43 -0800225#define BTA_TRANSPORT_UNKNOWN 0
226#define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR
227#define BTA_TRANSPORT_LE BT_TRANSPORT_LE
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700228typedef tBT_TRANSPORT tBTA_TRANSPORT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800229
230/* Pairable Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800231#define BTA_DM_PAIRABLE 1
232#define BTA_DM_NON_PAIRABLE 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800233
234/* Connectable Paired Only Mode */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800235#define BTA_DM_CONN_ALL 0
236#define BTA_DM_CONN_PAIRED 1
The Android Open Source Project5738f832012-12-12 16:00:35 -0800237
238/* Inquiry Modes */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800239#define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */
240#define BTA_DM_GENERAL_INQUIRY \
241 BTM_GENERAL_INQUIRY /* Perform general inquiry. */
242#define BTA_DM_LIMITED_INQUIRY \
243 BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800244
Marie Janssene9e58ce2016-06-17 14:12:17 -0700245#if (BLE_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800246#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
247#define BTA_BLE_GENERAL_INQUIRY \
248 BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
249#define BTA_BLE_LIMITED_INQUIRY \
250 BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800251#endif
Marie Janssene9e58ce2016-06-17 14:12:17 -0700252typedef uint8_t tBTA_DM_INQ_MODE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800253
254/* Inquiry Filter Type */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800255#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
256#define BTA_DM_INQ_DEV_CLASS \
257 BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
258#define BTA_DM_INQ_BD_ADDR \
259 BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800260
Marie Janssene9e58ce2016-06-17 14:12:17 -0700261typedef uint8_t tBTA_DM_INQ_FILT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800262
263/* Authorize Response */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800264#define BTA_DM_AUTH_PERM \
265 0 /* Authorized for future connections to the service */
266#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
267#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800268
Marie Janssene9e58ce2016-06-17 14:12:17 -0700269typedef uint8_t tBTA_AUTH_RESP;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800270
271/* M/S preferred roles */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800272#define BTA_ANY_ROLE 0x00
273#define BTA_MASTER_ROLE_PREF 0x01
274#define BTA_MASTER_ROLE_ONLY 0x02
275#define BTA_SLAVE_ROLE_ONLY \
276 0x03 /* Used for PANU only, skip role switch to master */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800277
Marie Janssene9e58ce2016-06-17 14:12:17 -0700278typedef uint8_t tBTA_PREF_ROLES;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800279
Myles Watsoncd1fd072016-11-09 13:17:43 -0800280enum {
The Android Open Source Project5738f832012-12-12 16:00:35 -0800281
Myles Watsoncd1fd072016-11-09 13:17:43 -0800282 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
283 support "role switch during connection" for
284 an incoming connection, when it already has
285 another connection in master role */
286 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
287 simulateous connection in Master and Slave roles
288 for short period of time */
289 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
290 and slave roles */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800291
292};
293
The Android Open Source Project5738f832012-12-12 16:00:35 -0800294/* Inquiry filter device class condition */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800295typedef struct {
296 DEV_CLASS dev_class; /* device class of interest */
297 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of
298 interest */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800299} tBTA_DM_COD_COND;
300
The Android Open Source Project5738f832012-12-12 16:00:35 -0800301/* Inquiry Filter Condition */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800302typedef union {
303 BD_ADDR bd_addr; /* BD address of device to filter. */
304 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800305} tBTA_DM_INQ_COND;
306
307/* Inquiry Parameters */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800308typedef struct {
309 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
310 uint8_t duration; /* Inquiry duration in 1.28 sec units. */
311 uint8_t max_resps; /* Maximum inquiry responses. Set to zero for unlimited
312 responses. */
313 bool report_dup; /* report duplicated inquiry response with higher RSSI value
314 */
315 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
316 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700317#if (BTA_HOST_INTERLEAVE_SEARCH == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800318 uint8_t intl_duration
319 [4]; /*duration array storing the interleave scan's time portions*/
Matthew Xie7f3e4292013-09-30 12:44:10 -0700320#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800321} tBTA_DM_INQ;
322
Myles Watsoncd1fd072016-11-09 13:17:43 -0800323typedef struct {
324 uint8_t bta_dm_eir_min_name_len; /* minimum length of local name when it is
325 shortened */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800326#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800327 uint8_t bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
328 uint8_t* bta_dm_eir_uuid16; /* 16-bit UUIDs */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800329#else
Myles Watsoncd1fd072016-11-09 13:17:43 -0800330 uint32_t uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800331#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800332 int8_t* bta_dm_eir_inq_tx_power; /* Inquiry TX power */
333 uint8_t bta_dm_eir_flag_len; /* length of flags in bytes */
334 uint8_t* bta_dm_eir_flags; /* flags for EIR */
335 uint8_t bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in
336 bytes */
337 uint8_t* bta_dm_eir_manufac_spec; /* manufacturer specific */
338 uint8_t bta_dm_eir_additional_len; /* length of additional data in bytes */
339 uint8_t* bta_dm_eir_additional; /* additional data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800340} tBTA_DM_EIR_CONF;
341
Marie Janssene9e58ce2016-06-17 14:12:17 -0700342#if (BLE_INCLUDED == TRUE)
Wei Wanga6ce7752014-05-20 06:30:32 +0000343
Wei Wanga6ce7752014-05-20 06:30:32 +0000344/* advertising filter policy */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800345typedef tBTM_BLE_AFP tBTA_BLE_AFP;
Wei Wanga6ce7752014-05-20 06:30:32 +0000346
Myles Watsoncd1fd072016-11-09 13:17:43 -0800347enum {
348 BTA_BLE_BATCH_SCAN_MODE_PASS = 1,
349 BTA_BLE_BATCH_SCAN_MODE_ACTI = 2,
350 BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3
Satya Callojic4e25962014-05-10 23:46:24 -0700351};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700352typedef uint8_t tBTA_BLE_BATCH_SCAN_MODE;
Satya Callojic4e25962014-05-10 23:46:24 -0700353
Myles Watsoncd1fd072016-11-09 13:17:43 -0800354enum { BTA_BLE_DISCARD_OLD_ITEMS = 0, BTA_BLE_DISCARD_LOWER_RSSI_ITEMS = 1 };
Marie Janssene9e58ce2016-06-17 14:12:17 -0700355typedef uint8_t tBTA_BLE_DISCARD_RULE;
Satya Callojic4e25962014-05-10 23:46:24 -0700356
Myles Watsoncd1fd072016-11-09 13:17:43 -0800357enum { BTA_BLE_ADV_SEEN_FIRST_TIME = 0, BTA_BLE_ADV_TRACKING_TIMEOUT = 1 };
Marie Janssene9e58ce2016-06-17 14:12:17 -0700358typedef uint8_t tBTA_BLE_ADV_CHANGE_REASON;
Satya Callojic4e25962014-05-10 23:46:24 -0700359
Myles Watsoncd1fd072016-11-09 13:17:43 -0800360enum {
361 BTA_BLE_BATCH_SCAN_ENB_EVT = 1,
362 BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2,
363 BTA_BLE_BATCH_SCAN_DATA_EVT = 3,
364 BTA_BLE_BATCH_SCAN_THRES_EVT = 4,
365 BTA_BLE_BATCH_SCAN_PARAM_EVT = 5,
366 BTA_BLE_BATCH_SCAN_DIS_EVT = 6
Satya Callojic4e25962014-05-10 23:46:24 -0700367};
368typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
369
370typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800371#endif
372
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800373/* BLE customer specific feature function type definitions */
374/* data type used on customer specific feature for RSSI monitoring */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800375#define BTA_BLE_RSSI_ALERT_HI 0
376#define BTA_BLE_RSSI_ALERT_RANGE 1
377#define BTA_BLE_RSSI_ALERT_LO 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700378typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800379
Myles Watsoncd1fd072016-11-09 13:17:43 -0800380#define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */
381#define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */
382#define BTA_BLE_RSSI_ALERT_RANGE_BIT \
383 BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */
384#define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */
385typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_MASK;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800386
Myles Watsoncd1fd072016-11-09 13:17:43 -0800387typedef void(tBTA_DM_BLE_RSSI_CBACK)(BD_ADDR bd_addr,
388 tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type,
389 int8_t rssi);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800390
391/* max number of filter spot for different filter type */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800392#define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */
393#define BTA_DM_BLE_MAX_ADDR_FILTER BTM_BLE_MAX_ADDR_FILTER /* 8 */
394#define BTA_DM_BLE_PF_STR_COND_MAX \
395 BTM_BLE_PF_STR_COND_MAX /* 4 apply to manu data , or local name */
396#define BTA_DM_BLE_PF_STR_LEN_MAX \
397 BTM_BLE_PF_STR_LEN_MAX /* match for first 20 bytes */
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800398
Myles Watsoncd1fd072016-11-09 13:17:43 -0800399#define BTA_DM_BLE_PF_LOGIC_OR 0
400#define BTA_DM_BLE_PF_LOGIC_AND 1
Marie Janssene9e58ce2016-06-17 14:12:17 -0700401typedef uint8_t tBTA_DM_BLE_PF_LOGIC_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800402
Myles Watsoncd1fd072016-11-09 13:17:43 -0800403enum {
404 BTA_DM_BLE_SCAN_COND_ADD,
405 BTA_DM_BLE_SCAN_COND_DELETE,
406 BTA_DM_BLE_SCAN_COND_CLEAR = 2
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800407};
Marie Janssene9e58ce2016-06-17 14:12:17 -0700408typedef uint8_t tBTA_DM_BLE_SCAN_COND_OP;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800409
Satya Calloji1a9247a2014-06-05 13:15:15 -0700410/* ADV payload filtering vendor specific call event */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800411enum { BTA_BLE_SCAN_PF_ENABLE_EVT = 7, BTA_BLE_SCAN_PF_COND_EVT };
Satya Calloji1a9247a2014-06-05 13:15:15 -0700412
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800413/* filter selection bit index */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800414#define BTA_DM_BLE_PF_ADDR_FILTER BTM_BLE_PF_ADDR_FILTER
415#define BTA_DM_BLE_PF_SRVC_DATA BTM_BLE_PF_SRVC_DATA
416#define BTA_DM_BLE_PF_SRVC_UUID BTM_BLE_PF_SRVC_UUID
417#define BTA_DM_BLE_PF_SRVC_SOL_UUID BTM_BLE_PF_SRVC_SOL_UUID
418#define BTA_DM_BLE_PF_LOCAL_NAME BTM_BLE_PF_LOCAL_NAME
419#define BTA_DM_BLE_PF_MANU_DATA BTM_BLE_PF_MANU_DATA
420#define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN
421#define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL
422#define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX
423typedef uint8_t tBTA_DM_BLE_PF_COND_TYPE;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800424
Myles Watsoncd1fd072016-11-09 13:17:43 -0800425typedef union {
426 uint16_t uuid16_mask;
427 uint32_t uuid32_mask;
428 uint8_t uuid128_mask[LEN_UUID_128];
429} tBTA_DM_BLE_PF_COND_MASK;
Andre Eisenbachb203d472013-11-20 17:23:06 -0800430
Myles Watsoncd1fd072016-11-09 13:17:43 -0800431typedef struct {
432 tBLE_BD_ADDR*
433 p_target_addr; /* target address, if NULL, generic UUID filter */
434 tBT_UUID uuid; /* UUID condition */
435 tBTA_DM_BLE_PF_LOGIC_TYPE cond_logic; /* AND/OR */
436 tBTA_DM_BLE_PF_COND_MASK*
437 p_uuid_mask; /* UUID condition mask, if NULL, match exact as UUID
438 condition */
439} tBTA_DM_BLE_PF_UUID_COND;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800440
Myles Watsoncd1fd072016-11-09 13:17:43 -0800441typedef struct {
442 uint8_t data_len; /* <= 20 bytes */
443 uint8_t* p_data;
444} tBTA_DM_BLE_PF_LOCAL_NAME_COND;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800445
Myles Watsoncd1fd072016-11-09 13:17:43 -0800446typedef struct {
447 uint16_t company_id; /* company ID */
448 uint8_t data_len; /* <= 20 bytes */
449 uint8_t* p_pattern;
450 uint16_t company_id_mask; /* UUID value mask */
451 uint8_t*
452 p_pattern_mask; /* Manufacturer data matching mask, same length
453 as data pattern, set to all 0xff, match exact data */
454} tBTA_DM_BLE_PF_MANU_COND;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800455
Myles Watsoncd1fd072016-11-09 13:17:43 -0800456typedef struct {
457 uint16_t uuid; /* service ID */
458 uint8_t data_len; /* <= 20 bytes */
459 uint8_t* p_pattern;
460 uint8_t*
461 p_pattern_mask; /* Service data matching mask, same length
462 as data pattern, set to all 0xff, match exact data */
463} tBTA_DM_BLE_PF_SRVC_PATTERN_COND;
Andre Eisenbachb203d472013-11-20 17:23:06 -0800464
Myles Watsoncd1fd072016-11-09 13:17:43 -0800465typedef union {
466 tBLE_BD_ADDR target_addr;
467 tBTA_DM_BLE_PF_LOCAL_NAME_COND local_name; /* lcoal name filtering */
468 tBTA_DM_BLE_PF_MANU_COND manu_data; /* manufactuer data filtering */
469 tBTA_DM_BLE_PF_UUID_COND srvc_uuid; /* service UUID filtering */
470 tBTA_DM_BLE_PF_UUID_COND
471 solicitate_uuid; /* solicitated service UUID filtering */
472 tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */
473} tBTA_DM_BLE_PF_COND_PARAM;
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800474
Marie Janssene9e58ce2016-06-17 14:12:17 -0700475typedef uint8_t tBTA_DM_BLE_PF_FILT_INDEX;
476typedef uint8_t tBTA_DM_BLE_PF_AVBL_SPACE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700477
Marie Janssene9e58ce2016-06-17 14:12:17 -0700478typedef int8_t tBTA_DM_RSSI_VALUE;
479typedef uint8_t tBTA_DM_LINK_QUALITY_VALUE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800480
Marie Janssene9e58ce2016-06-17 14:12:17 -0700481typedef uint8_t tBTA_SIG_STRENGTH_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800482
The Android Open Source Project5738f832012-12-12 16:00:35 -0800483/* Security Callback Events */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800484#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
485#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
486#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
487#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
488#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
489#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
490#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
491#define BTA_DM_SIG_STRENGTH_EVT \
492 7 /* Signal strength for bluetooth connection \
493 */
494#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
495#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
496#define BTA_DM_SP_CFM_REQ_EVT \
497 10 /* Simple Pairing User Confirmation request. \
498 */
499#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
500#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
501#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
502#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
503#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
504#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
505#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
506#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
507#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
508#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
509#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
510#define BTA_DM_BLE_NC_REQ_EVT 22 /* SMP Numeric Comparison request event */
511#define BTA_DM_SP_RMT_OOB_EXT_EVT \
512 23 /* Simple Pairing Remote OOB Extended Data request. */
513#define BTA_DM_BLE_AUTH_CMPL_EVT 24 /* BLE Auth complete */
514#define BTA_DM_DEV_UNPAIRED_EVT 25
515#define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */
516#define BTA_DM_LE_FEATURES_READ \
517 27 /* Cotroller specific LE features are read \
518 */
519#define BTA_DM_ENER_INFO_READ 28 /* Energy info read */
520#define BTA_DM_BLE_SC_OOB_REQ_EVT 29 /* SMP SC OOB request event */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700521typedef uint8_t tBTA_DM_SEC_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800522
523/* Structure associated with BTA_DM_ENABLE_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800524typedef struct { tBTA_STATUS status; } tBTA_DM_ENABLE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800525
526/* Structure associated with BTA_DM_PIN_REQ_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800527typedef struct {
528 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
529 * order */
530 BD_ADDR bd_addr; /* BD address peer device. */
531 DEV_CLASS dev_class; /* Class of Device */
532 BD_NAME bd_name; /* Name of peer device. */
533 bool min_16_digit; /* true if the pin returned must be at least 16 digits */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800534} tBTA_DM_PIN_REQ;
535
536/* BLE related definition */
537
Myles Watsoncd1fd072016-11-09 13:17:43 -0800538#define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10)
Jacky Cheung07c78922016-07-06 15:11:30 -0700539
Myles Watsoncd1fd072016-11-09 13:17:43 -0800540/* Converts SMP error codes defined in smp_api.h to SMP auth fail reasons below.
541 */
542#define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x))
Jacky Cheung07c78922016-07-06 15:11:30 -0700543
Myles Watsoncd1fd072016-11-09 13:17:43 -0800544#define BTA_DM_AUTH_SMP_PASSKEY_FAIL \
545 (BTA_DM_AUTH_FAIL_BASE + SMP_PASSKEY_ENTRY_FAIL)
546#define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL)
547#define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL \
548 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL)
549#define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL \
550 (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR)
551#define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT \
552 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT)
553#define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE)
554#define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD)
555#define BTA_DM_AUTH_SMP_UNKNOWN_ERR \
556 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN)
557#define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT \
558 (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS)
559#define BTA_DM_AUTH_SMP_INVALID_PARAMETERS \
560 (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_PARAMETERS)
561#define BTA_DM_AUTH_SMP_INTERNAL_ERR \
562 (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR)
563#define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP)
564#define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL)
565#define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL)
566#define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY)
567#define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL)
568#define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT)
569#define BTA_DM_AUTH_SMP_CONN_TOUT (BTA_DM_AUTH_FAIL_BASE + SMP_CONN_TOUT)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800570
571/* connection parameter boundary value and dummy value */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800572#define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN
573#define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX
574#define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN
575#define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX
576#define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN
577#define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX
578#define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX
579#define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN
580#define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX
581#define BTA_DM_BLE_CONN_PARAM_UNDEF \
582 BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be \
583 overwritten */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800584
Myles Watsoncd1fd072016-11-09 13:17:43 -0800585#define BTA_LE_KEY_PENC \
586 BTM_LE_KEY_PENC /* encryption information of peer device */
587#define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */
588#define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */
589#define BTA_LE_KEY_LENC \
590 BTM_LE_KEY_LENC /* master role security information:div */
591#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
592#define BTA_LE_KEY_LCSRK \
593 BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700594typedef uint8_t tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800595
Myles Watsoncd1fd072016-11-09 13:17:43 -0800596typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800597typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS;
Myles Watsoncd1fd072016-11-09 13:17:43 -0800598typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS;
599typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS;
600typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800601
Myles Watsoncd1fd072016-11-09 13:17:43 -0800602typedef union {
603 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */
604 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */
605 tBTA_LE_PID_KEYS pid_key; /* peer device ID key */
606 tBTA_LE_LENC_KEYS
607 lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/
608 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/
609 tBTA_LE_PID_KEYS lid_key; /* local device ID key for the particular remote */
610} tBTA_LE_KEY_VALUE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800611
Myles Watsoncd1fd072016-11-09 13:17:43 -0800612#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
613#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700614typedef uint8_t tBTA_DM_BLE_LOCAL_KEY_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800615
Myles Watsoncd1fd072016-11-09 13:17:43 -0800616typedef struct {
617 BT_OCTET16 ir;
618 BT_OCTET16 irk;
619 BT_OCTET16 dhk;
620} tBTA_BLE_LOCAL_ID_KEYS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800621
Myles Watsoncd1fd072016-11-09 13:17:43 -0800622#define BTA_DM_SEC_GRANTED BTA_SUCCESS
623#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
624#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
Marie Janssene9e58ce2016-06-17 14:12:17 -0700625typedef uint8_t tBTA_DM_BLE_SEC_GRANT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800626
Myles Watsoncd1fd072016-11-09 13:17:43 -0800627#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
628#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
629#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
Marie Janssene9e58ce2016-06-17 14:12:17 -0700630typedef uint8_t tBTA_DM_BLE_CONN_TYPE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800631
Myles Watsoncd1fd072016-11-09 13:17:43 -0800632typedef bool(tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, uint8_t* p_remote_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800633
634/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800635typedef struct {
636 BD_ADDR bd_addr; /* peer address */
637 BD_NAME bd_name; /* peer device name */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800638} tBTA_DM_BLE_SEC_REQ;
639
Myles Watsoncd1fd072016-11-09 13:17:43 -0800640typedef struct {
641 BD_ADDR bd_addr; /* peer address */
642 tBTM_LE_KEY_TYPE key_type;
643 tBTM_LE_KEY_VALUE* p_key_value;
644} tBTA_DM_BLE_KEY;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800645
646/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800647typedef struct {
648 BD_ADDR bd_addr; /* BD address peer device. */
649 BD_NAME bd_name; /* Name of peer device. */
650 bool key_present; /* Valid link key value in key element */
651 LINK_KEY key; /* Link key associated with peer device. */
652 uint8_t key_type; /* The type of Link Key */
653 bool success; /* true of authentication succeeded, false if failed. */
654 uint8_t fail_reason; /* The HCI reason/error code for when success=false */
655 tBLE_ADDR_TYPE addr_type; /* Peer device address type */
656 tBT_DEVICE_TYPE dev_type;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800657} tBTA_DM_AUTH_CMPL;
658
The Android Open Source Project5738f832012-12-12 16:00:35 -0800659/* Structure associated with BTA_DM_AUTHORIZE_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800660typedef struct {
661 BD_ADDR bd_addr; /* BD address peer device. */
662 BD_NAME bd_name; /* Name of peer device. */
663 tBTA_SERVICE_ID service; /* Service ID to authorize. */
664 DEV_CLASS dev_class;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800665} tBTA_DM_AUTHORIZE;
666
667/* Structure associated with BTA_DM_LINK_UP_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800668typedef struct {
669 BD_ADDR bd_addr; /* BD address peer device. */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700670#if (BLE_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800671 tBTA_TRANSPORT link_type;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700672#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800673} tBTA_DM_LINK_UP;
674
675/* Structure associated with BTA_DM_LINK_DOWN_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800676typedef struct {
677 BD_ADDR bd_addr; /* BD address peer device. */
678 uint8_t status; /* connection open/closed */
679 bool is_removed; /* true if device is removed when link is down */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700680#if (BLE_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800681 tBTA_TRANSPORT link_type;
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700682#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -0800683} tBTA_DM_LINK_DOWN;
684
685/* Structure associated with BTA_DM_ROLE_CHG_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800686typedef struct {
687 BD_ADDR bd_addr; /* BD address peer device. */
688 uint8_t new_role; /* the new connection role */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800689} tBTA_DM_ROLE_CHG;
690
The Android Open Source Project5738f832012-12-12 16:00:35 -0800691/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800692typedef struct {
693 uint8_t level; /* when paging or inquiring, level is 10.
694 Otherwise, the number of ACL links */
695 uint8_t level_flags; /* indicates individual flags */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800696} tBTA_DM_BUSY_LEVEL;
697
Myles Watsoncd1fd072016-11-09 13:17:43 -0800698#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
699#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
700#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
701#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
Marie Janssene9e58ce2016-06-17 14:12:17 -0700702#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800703#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
Satya Calloji444a8da2015-03-06 10:38:22 -0800704#endif
Myles Watsoncd1fd072016-11-09 13:17:43 -0800705typedef tBTM_IO_CAP tBTA_IO_CAP;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800706
Myles Watsoncd1fd072016-11-09 13:17:43 -0800707#define BTA_AUTH_SP_NO \
708 BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single \
709 Profile/non-bonding \
710 Numeric comparison with automatic accept allowed */
711#define BTA_AUTH_SP_YES \
712 BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding \
713 Use IO Capabilities to determine authentication procedure \
714 */
715#define BTA_AUTH_AP_NO \
716 BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated \
717 bonding \
718 Numeric comparison with automatic accept allowed */
719#define BTA_AUTH_AP_YES \
720 BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated \
721 bonding \
722 Use IO Capabilities to determine authentication procedure \
723 */
724#define BTA_AUTH_SPGB_NO \
725 BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general \
726 bonding \
727 Numeric comparison with automatic accept allowed */
728#define BTA_AUTH_SPGB_YES \
729 BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general \
730 bonding \
731 Use IO Capabilities to determine authentication \
732 procedure */
733typedef tBTM_AUTH_REQ tBTA_AUTH_REQ;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800734
Myles Watsoncd1fd072016-11-09 13:17:43 -0800735#define BTA_AUTH_DD_BOND \
736 BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */
737#define BTA_AUTH_GEN_BOND \
738 BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */
739#define BTA_AUTH_BONDS \
740 BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800741
Myles Watsoncd1fd072016-11-09 13:17:43 -0800742#define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/
743#define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */
744#define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */
Satya Calloji444a8da2015-03-06 10:38:22 -0800745
Myles Watsoncd1fd072016-11-09 13:17:43 -0800746#define BTA_LE_AUTH_REQ_SC_ONLY BTM_LE_AUTH_REQ_SC_ONLY /* 1 << 3 */
747#define BTA_LE_AUTH_REQ_SC_BOND BTM_LE_AUTH_REQ_SC_BOND /* 1001 */
748#define BTA_LE_AUTH_REQ_SC_MITM BTM_LE_AUTH_REQ_SC_MITM /* 1100 */
749#define BTA_LE_AUTH_REQ_SC_MITM_BOND BTM_LE_AUTH_REQ_SC_MITM_BOND /* 1101 */
750typedef tBTM_LE_AUTH_REQ
751 tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800752
Myles Watsoncd1fd072016-11-09 13:17:43 -0800753#define BTA_OOB_NONE BTM_OOB_NONE
754#define BTA_OOB_PRESENT BTM_OOB_PRESENT
755#define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN
Jakub Pawlowski175da702015-11-12 15:00:58 -0800756
Myles Watsoncd1fd072016-11-09 13:17:43 -0800757typedef tBTM_OOB_DATA tBTA_OOB_DATA;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800758
759/* Structure associated with BTA_DM_SP_CFM_REQ_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800760typedef struct {
761 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
762 * order */
763 BD_ADDR bd_addr; /* peer address */
764 DEV_CLASS dev_class; /* peer CoD */
765 BD_NAME bd_name; /* peer device name */
766 uint32_t num_val; /* the numeric value for comparison. If just_works, do not
767 show this number to UI */
768 bool just_works; /* true, if "Just Works" association model */
769 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
770 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
771 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
772 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800773} tBTA_DM_SP_CFM_REQ;
774
Myles Watsoncd1fd072016-11-09 13:17:43 -0800775enum {
776 BTA_SP_KEY_STARTED, /* passkey entry started */
777 BTA_SP_KEY_ENTERED, /* passkey digit entered */
778 BTA_SP_KEY_ERASED, /* passkey digit erased */
779 BTA_SP_KEY_CLEARED, /* passkey cleared */
780 BTA_SP_KEY_COMPLT /* passkey entry completed */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800781};
Myles Watsoncd1fd072016-11-09 13:17:43 -0800782typedef uint8_t tBTA_SP_KEY_TYPE;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800783
784/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800785typedef struct {
786 BD_ADDR bd_addr; /* peer address */
787 tBTA_SP_KEY_TYPE notif_type;
788} tBTA_DM_SP_KEY_PRESS;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800789
790/* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800791typedef struct {
792 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
793 * order */
794 BD_ADDR bd_addr; /* peer address */
795 DEV_CLASS dev_class; /* peer CoD */
796 BD_NAME bd_name; /* peer device name */
797 uint32_t passkey; /* the numeric value for comparison. If just_works, do not
798 show this number to UI */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800799} tBTA_DM_SP_KEY_NOTIF;
800
801/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800802typedef struct {
803 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in
804 * order */
805 BD_ADDR bd_addr; /* peer address */
806 DEV_CLASS dev_class; /* peer CoD */
807 BD_NAME bd_name; /* peer device name */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800808} tBTA_DM_SP_RMT_OOB;
809
810/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800811typedef struct {
812 tBTA_STATUS result; /* true of bond cancel succeeded, false if failed. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800813} tBTA_DM_BOND_CANCEL_CMPL;
814
815/* Union of all security callback structures */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800816typedef union {
817 tBTA_DM_ENABLE enable; /* BTA enabled */
818 tBTA_DM_PIN_REQ pin_req; /* PIN request. */
819 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */
820 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */
821 tBTA_DM_LINK_UP link_up; /* ACL connection down event */
822 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
823 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
824 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */
825 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */
826 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */
827 tBTA_DM_BOND_CANCEL_CMPL
828 bond_cancel_cmpl; /* Bond Cancel Complete indication */
829 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */
830 tBTA_DM_ROLE_CHG role_chg; /* role change event */
831 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */
832 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */
833 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */
834 BT_OCTET16 ble_er; /* ER event data */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800835} tBTA_DM_SEC;
836
837/* Security callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800838typedef void(tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800839
Marie Janssene9e58ce2016-06-17 14:12:17 -0700840typedef uint32_t tBTA_DM_BLE_REF_VALUE;
Wei Wanga6ce7752014-05-20 06:30:32 +0000841
Myles Watsoncd1fd072016-11-09 13:17:43 -0800842#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
843#define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG
Marie Janssene9e58ce2016-06-17 14:12:17 -0700844typedef uint8_t tBTA_DM_BLE_PF_EVT;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700845
Myles Watsoncd1fd072016-11-09 13:17:43 -0800846#define BTA_DM_BLE_PF_ENABLE 1
847#define BTA_DM_BLE_PF_CONFIG 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700848typedef uint8_t tBTA_DM_BLE_PF_ACTION;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700849
Satya Calloji1a9247a2014-06-05 13:15:15 -0700850/* Config callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800851typedef void(tBTA_DM_BLE_PF_CFG_CBACK)(tBTA_DM_BLE_PF_ACTION action,
852 tBTA_DM_BLE_PF_COND_TYPE cfg_cond,
853 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
854 tBTA_STATUS status,
855 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700856/* Param callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800857typedef void(tBTA_DM_BLE_PF_PARAM_CBACK)(uint8_t action_type,
858 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
859 tBTA_DM_BLE_REF_VALUE ref_value,
860 tBTA_STATUS status);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700861
862/* Status callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800863typedef void(tBTA_DM_BLE_PF_STATUS_CBACK)(uint8_t action, tBTA_STATUS status,
864 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -0700865
Myles Watsoncd1fd072016-11-09 13:17:43 -0800866#define BTA_DM_BLE_PF_BRDCAST_ADDR_FILT 1
Satya Calloji1a9247a2014-06-05 13:15:15 -0700867#define BTA_DM_BLE_PF_SERV_DATA_CHG_FILT 2
Myles Watsoncd1fd072016-11-09 13:17:43 -0800868#define BTA_DM_BLE_PF_SERV_UUID 4
869#define BTA_DM_BLE_PF_SERV_SOLC_UUID 8
870#define BTA_DM_BLE_PF_LOC_NAME_CHECK 16
871#define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32
872#define BTA_DM_BLE_PF_SERV_DATA_CHECK 64
Marie Janssene9e58ce2016-06-17 14:12:17 -0700873typedef uint16_t tBTA_DM_BLE_PF_FEAT_SEL;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700874
Myles Watsoncd1fd072016-11-09 13:17:43 -0800875#define BTA_DM_BLE_PF_LIST_LOGIC_OR 1
876#define BTA_DM_BLE_PF_LIST_LOGIC_AND 2
Marie Janssene9e58ce2016-06-17 14:12:17 -0700877typedef uint16_t tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700878
Myles Watsoncd1fd072016-11-09 13:17:43 -0800879#define BTA_DM_BLE_PF_FILT_LOGIC_OR 0
880#define BTA_DM_BLE_PF_FILT_LOGIC_AND 1
Marie Janssene9e58ce2016-06-17 14:12:17 -0700881typedef uint16_t tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700882
Myles Watsoncd1fd072016-11-09 13:17:43 -0800883typedef uint8_t tBTA_DM_BLE_PF_RSSI_THRESHOLD;
884typedef uint8_t tBTA_DM_BLE_PF_DELIVERY_MODE;
Marie Janssene9e58ce2016-06-17 14:12:17 -0700885typedef uint16_t tBTA_DM_BLE_PF_TIMEOUT;
Myles Watsoncd1fd072016-11-09 13:17:43 -0800886typedef uint8_t tBTA_DM_BLE_PF_TIMEOUT_CNT;
Marie Janssene9e58ce2016-06-17 14:12:17 -0700887typedef uint16_t tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700888
Myles Watsoncd1fd072016-11-09 13:17:43 -0800889typedef struct {
890 tBTA_DM_BLE_PF_FEAT_SEL feat_seln;
891 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE list_logic_type;
892 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE filt_logic_type;
893 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_high_thres;
894 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_low_thres;
895 tBTA_DM_BLE_PF_DELIVERY_MODE dely_mode;
896 tBTA_DM_BLE_PF_TIMEOUT found_timeout;
897 tBTA_DM_BLE_PF_TIMEOUT lost_timeout;
898 tBTA_DM_BLE_PF_TIMEOUT_CNT found_timeout_cnt;
899 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES num_of_tracking_entries;
Satya Calloji1a9247a2014-06-05 13:15:15 -0700900} tBTA_DM_BLE_PF_FILT_PARAMS;
901
The Android Open Source Project5738f832012-12-12 16:00:35 -0800902/* Search callback events */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800903#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
904#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
905#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
906#define BTA_DM_DISC_BLE_RES_EVT \
907 3 /* Discovery result for BLE GATT based servoce on a peer device. */
908#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
909#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
910#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800911
Marie Janssene9e58ce2016-06-17 14:12:17 -0700912typedef uint8_t tBTA_DM_SEARCH_EVT;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800913
Myles Watsoncd1fd072016-11-09 13:17:43 -0800914#define BTA_DM_INQ_RES_IGNORE_RSSI \
915 BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800916
917/* Structure associated with BTA_DM_INQ_RES_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800918typedef struct {
919 BD_ADDR bd_addr; /* BD address peer device. */
920 DEV_CLASS dev_class; /* Device class of peer device. */
921 bool remt_name_not_required; /* Application sets this flag if it already knows
922 the name of the device */
923 /* If the device name is known to application BTA skips the remote name
924 * request */
925 bool is_limited; /* true, if the limited inquiry bit is set in the CoD */
926 int8_t rssi; /* The rssi value */
927 uint8_t* p_eir; /* received EIR */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800928#if (BLE_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800929 uint8_t inq_result_type;
930 uint8_t ble_addr_type;
931 tBTM_BLE_EVT_TYPE ble_evt_type;
932 tBT_DEVICE_TYPE device_type;
933 uint8_t flag;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800934#endif
935
936} tBTA_DM_INQ_RES;
937
938/* Structure associated with BTA_DM_INQ_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800939typedef struct {
940 uint8_t num_resps; /* Number of inquiry responses. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800941} tBTA_DM_INQ_CMPL;
942
943/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800944typedef struct {
945 BD_ADDR bd_addr; /* BD address peer device. */
946 uint8_t num_record; /* Number of DI record */
947 tBTA_STATUS result;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800948} tBTA_DM_DI_DISC_CMPL;
949
950/* Structure associated with BTA_DM_DISC_RES_EVT */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800951typedef struct {
952 BD_ADDR bd_addr; /* BD address peer device. */
953 BD_NAME bd_name; /* Name of peer device. */
954 tBTA_SERVICE_MASK services; /* Services found on peer device. */
955 uint8_t* p_raw_data; /* Raw data for discovery DB */
956 uint32_t raw_data_size; /* size of raw data */
957 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
958 uint32_t num_uuids;
959 uint8_t* p_uuid_list;
960 tBTA_STATUS result;
The Android Open Source Project5738f832012-12-12 16:00:35 -0800961} tBTA_DM_DISC_RES;
962
963/* Structure associated with tBTA_DM_DISC_BLE_RES */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800964typedef struct {
965 BD_ADDR bd_addr; /* BD address peer device. */
966 BD_NAME bd_name; /* Name of peer device. */
967 tBT_UUID service; /* GATT based Services UUID found on peer device. */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800968} tBTA_DM_DISC_BLE_RES;
969
The Android Open Source Project5738f832012-12-12 16:00:35 -0800970/* Union of all search callback structures */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800971typedef union {
972 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
973 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
974 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
975 tBTA_DM_DISC_BLE_RES
976 disc_ble_res; /* discovery result for GATT based service */
977 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800978
979} tBTA_DM_SEARCH;
980
981/* Search callback */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800982typedef void(tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event,
983 tBTA_DM_SEARCH* p_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800984
985/* Execute call back */
Myles Watsoncd1fd072016-11-09 13:17:43 -0800986typedef void(tBTA_DM_EXEC_CBACK)(void* p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800987
988/* Encryption callback*/
Myles Watsoncd1fd072016-11-09 13:17:43 -0800989typedef void(tBTA_DM_ENCRYPT_CBACK)(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
990 tBTA_STATUS result);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800991
Myles Watsoncd1fd072016-11-09 13:17:43 -0800992#define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE
993#define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT
994#define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM
995#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
996typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
Satya Callojic4e25962014-05-10 23:46:24 -0700997
Marie Janssene9e58ce2016-06-17 14:12:17 -0700998#if (BLE_INCLUDED == TRUE)
Myles Watsoncd1fd072016-11-09 13:17:43 -0800999typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
1000typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
1001typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
1002typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED;
Satya Callojie5ba8842014-07-03 17:18:02 -07001003
Myles Watsoncd1fd072016-11-09 13:17:43 -08001004#define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */
1005#define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */
1006#define BTA_DM_CONTRL_SCAN \
1007 2 /* Scan state - paging/inquiry/trying to \
1008 connect*/
1009#define BTA_DM_CONTRL_IDLE \
1010 3 /* Idle state - page scan, LE advt, inquiry scan \
1011 */
Satya Callojie5ba8842014-07-03 17:18:02 -07001012
Marie Janssene9e58ce2016-06-17 14:12:17 -07001013typedef uint8_t tBTA_DM_CONTRL_STATE;
Satya Callojie5ba8842014-07-03 17:18:02 -07001014
Marie Janssene9e58ce2016-06-17 14:12:17 -07001015typedef uint8_t tBTA_DM_BLE_ADV_STATE;
1016typedef uint8_t tBTA_DM_BLE_ADV_INFO_PRESENT;
1017typedef uint8_t tBTA_DM_BLE_RSSI_VALUE;
1018typedef uint16_t tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
Satya Callojif5387072015-02-09 17:40:52 -08001019
1020typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA;
Satya Callojie5ba8842014-07-03 17:18:02 -07001021
Myles Watsoncd1fd072016-11-09 13:17:43 -08001022typedef void(tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojie5ba8842014-07-03 17:18:02 -07001023
Myles Watsoncd1fd072016-11-09 13:17:43 -08001024typedef void(tBTA_BLE_SCAN_REP_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value,
1025 uint8_t report_format,
1026 uint8_t num_records, uint16_t data_len,
1027 uint8_t* p_rep_data, tBTA_STATUS status);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001028
Myles Watsoncd1fd072016-11-09 13:17:43 -08001029typedef void(tBTA_BLE_SCAN_SETUP_CBACK)(tBTA_BLE_BATCH_SCAN_EVT evt,
1030 tBTA_DM_BLE_REF_VALUE ref_value,
1031 tBTA_STATUS status);
Satya Callojic4e25962014-05-10 23:46:24 -07001032
Myles Watsoncd1fd072016-11-09 13:17:43 -08001033typedef void(tBTA_BLE_TRACK_ADV_CMPL_CBACK)(
1034 int action, tBTA_STATUS status, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
1035 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001036
Myles Watsoncd1fd072016-11-09 13:17:43 -08001037typedef void(tBTA_BLE_TRACK_ADV_CBACK)(tBTA_DM_BLE_TRACK_ADV_DATA* p_adv_data);
Satya Calloji1acb61c2014-06-14 23:16:18 -07001038
Myles Watsoncd1fd072016-11-09 13:17:43 -08001039typedef void(tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time,
1040 tBTA_DM_BLE_RX_TIME_MS rx_time,
1041 tBTA_DM_BLE_IDLE_TIME_MS idle_time,
1042 tBTA_DM_BLE_ENERGY_USED energy_used,
1043 tBTA_DM_CONTRL_STATE ctrl_state,
1044 tBTA_STATUS status);
Satya Callojie5ba8842014-07-03 17:18:02 -07001045
The Android Open Source Project5738f832012-12-12 16:00:35 -08001046#else
Myles Watsoncd1fd072016-11-09 13:17:43 -08001047typedef uint8_t tBTA_DM_BLE_SEC_ACT;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001048#endif
1049
1050/* Maximum service name length */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001051#define BTA_SERVICE_NAME_LEN 35
1052#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
1053#define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN
The Android Open Source Project5738f832012-12-12 16:00:35 -08001054
1055/* link policy masks */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001056#define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH
1057#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
1058#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
1059#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
Marie Janssene9e58ce2016-06-17 14:12:17 -07001060typedef uint16_t tBTA_DM_LP_MASK;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001061
1062/* power mode actions */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001063#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
1064#define BTA_DM_PM_PARK 0x10 /* prefers park mode */
1065#define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */
1066#define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */
1067#define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */
1068#define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */
1069#define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */
1070#define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */
1071#define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */
1072#define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */
1073#define BTA_DM_PM_SNIFF_USER0 \
1074 0x28 /* prefers user-defined sniff0 mode (testtool only) */
1075#define BTA_DM_PM_SNIFF_USER1 \
1076 0x29 /* prefers user-defined sniff1 mode (testtool only) */
1077#define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */
1078#define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */
1079#define BTA_DM_PM_SUSPEND 0x04 /* prefers suspend mode */
1080#define BTA_DM_PM_NO_PREF \
1081 0x01 /* service has no prefernce on power mode setting. eg. connection to \
1082 service got closed */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001083
Marie Janssene9e58ce2016-06-17 14:12:17 -07001084typedef uint8_t tBTA_DM_PM_ACTION;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001085
1086/* index to bta_dm_ssr_spec */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001087#define BTA_DM_PM_SSR0 0
1088#define BTA_DM_PM_SSR1 \
1089 1 /* BTA_DM_PM_SSR1 will be dedicated for \
1090 HH SSR setting entry, no other profile can use it */
1091#define BTA_DM_PM_SSR2 2
1092#define BTA_DM_PM_SSR3 3
1093#define BTA_DM_PM_SSR4 4
1094#define BTA_DM_PM_SSR5 5
1095#define BTA_DM_PM_SSR6 6
The Android Open Source Project5738f832012-12-12 16:00:35 -08001096
Myles Watsoncd1fd072016-11-09 13:17:43 -08001097#define BTA_DM_PM_NUM_EVTS 9
The Android Open Source Project5738f832012-12-12 16:00:35 -08001098
1099#ifndef BTA_DM_PM_PARK_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001100#define BTA_DM_PM_PARK_IDX \
1101 5 /* the actual index to bta_dm_pm_md[] for PARK mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001102#endif
1103
Adam Hampson63399d92014-05-19 16:23:45 -07001104#ifndef BTA_DM_PM_SNIFF_A2DP_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001105#define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF
Adam Hampson63399d92014-05-19 16:23:45 -07001106#endif
1107
1108#ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001109#define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF2
Adam Hampson63399d92014-05-19 16:23:45 -07001110#endif
1111
1112#ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001113#define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3
Adam Hampson63399d92014-05-19 16:23:45 -07001114#endif
1115
1116#ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX
1117#define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF4
1118#endif
1119
1120#ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX
1121#define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF2
1122#endif
1123
1124#ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX
1125#define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF2
1126#endif
1127
1128#ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX
1129#define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF2
1130#endif
1131
Adam Hampson63399d92014-05-19 16:23:45 -07001132#ifndef BTA_DM_PM_HH_OPEN_DELAY
1133#define BTA_DM_PM_HH_OPEN_DELAY 30000
1134#endif
1135
1136#ifndef BTA_DM_PM_HH_ACTIVE_DELAY
1137#define BTA_DM_PM_HH_ACTIVE_DELAY 30000
1138#endif
1139
1140#ifndef BTA_DM_PM_HH_IDLE_DELAY
1141#define BTA_DM_PM_HH_IDLE_DELAY 30000
1142#endif
1143
1144/* The Sniff Parameters defined below must be ordered from highest
1145 * latency (biggest interval) to lowest latency. If there is a conflict
1146 * among the connected services the setting with the lowest latency will
1147 * be selected. If a device should override a sniff parameter then it
1148 * must insure that order is maintained.
1149 */
1150#ifndef BTA_DM_PM_SNIFF_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001151#define BTA_DM_PM_SNIFF_MAX 800
1152#define BTA_DM_PM_SNIFF_MIN 400
1153#define BTA_DM_PM_SNIFF_ATTEMPT 4
1154#define BTA_DM_PM_SNIFF_TIMEOUT 1
Adam Hampson63399d92014-05-19 16:23:45 -07001155#endif
1156
1157#ifndef BTA_DM_PM_SNIFF1_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001158#define BTA_DM_PM_SNIFF1_MAX 400
1159#define BTA_DM_PM_SNIFF1_MIN 200
Adam Hampson63399d92014-05-19 16:23:45 -07001160#define BTA_DM_PM_SNIFF1_ATTEMPT 4
1161#define BTA_DM_PM_SNIFF1_TIMEOUT 1
1162#endif
1163
1164#ifndef BTA_DM_PM_SNIFF2_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001165#define BTA_DM_PM_SNIFF2_MAX 180
1166#define BTA_DM_PM_SNIFF2_MIN 150
Adam Hampson63399d92014-05-19 16:23:45 -07001167#define BTA_DM_PM_SNIFF2_ATTEMPT 4
1168#define BTA_DM_PM_SNIFF2_TIMEOUT 1
1169#endif
1170
1171#ifndef BTA_DM_PM_SNIFF3_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001172#define BTA_DM_PM_SNIFF3_MAX 150
1173#define BTA_DM_PM_SNIFF3_MIN 50
Adam Hampson63399d92014-05-19 16:23:45 -07001174#define BTA_DM_PM_SNIFF3_ATTEMPT 4
1175#define BTA_DM_PM_SNIFF3_TIMEOUT 1
1176#endif
1177
1178#ifndef BTA_DM_PM_SNIFF4_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001179#define BTA_DM_PM_SNIFF4_MAX 54
1180#define BTA_DM_PM_SNIFF4_MIN 30
Adam Hampson63399d92014-05-19 16:23:45 -07001181#define BTA_DM_PM_SNIFF4_ATTEMPT 4
1182#define BTA_DM_PM_SNIFF4_TIMEOUT 1
1183#endif
1184
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -07001185#ifndef BTA_DM_PM_SNIFF5_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001186#define BTA_DM_PM_SNIFF5_MAX 36
1187#define BTA_DM_PM_SNIFF5_MIN 30
Pavlin Radoslavov1076b7b2015-07-22 22:49:26 -07001188#define BTA_DM_PM_SNIFF5_ATTEMPT 2
1189#define BTA_DM_PM_SNIFF5_TIMEOUT 0
1190#endif
1191
Adam Hampson63399d92014-05-19 16:23:45 -07001192#ifndef BTA_DM_PM_PARK_MAX
Myles Watsoncd1fd072016-11-09 13:17:43 -08001193#define BTA_DM_PM_PARK_MAX 800
1194#define BTA_DM_PM_PARK_MIN 400
1195#define BTA_DM_PM_PARK_ATTEMPT 0
1196#define BTA_DM_PM_PARK_TIMEOUT 0
Adam Hampson63399d92014-05-19 16:23:45 -07001197#endif
1198
The Android Open Source Project5738f832012-12-12 16:00:35 -08001199/* Switch callback events */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001200#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001201
Marie Janssene9e58ce2016-06-17 14:12:17 -07001202typedef uint8_t tBTA_DM_SWITCH_EVT;
Myles Watsoncd1fd072016-11-09 13:17:43 -08001203typedef void(tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event,
1204 tBTA_STATUS status);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001205
1206/* Audio routing out configuration */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001207#define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */
1208#define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */
1209#define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */
1210#define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */
1211#define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */
1212#define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */
1213#define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */
1214#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
1215#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
The Android Open Source Project5738f832012-12-12 16:00:35 -08001216
Marie Janssene9e58ce2016-06-17 14:12:17 -07001217typedef uint8_t tBTA_DM_ROUTE_PATH;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001218
The Android Open Source Project5738f832012-12-12 16:00:35 -08001219/* Device Identification (DI) data structure
1220*/
1221/* Used to set the DI record */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001222typedef tSDP_DI_RECORD tBTA_DI_RECORD;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001223/* Used to get the DI record */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001224typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001225/* SDP discovery database */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001226typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB;
The Android Open Source Project5738f832012-12-12 16:00:35 -08001227
Myles Watsoncd1fd072016-11-09 13:17:43 -08001228#ifndef BTA_DI_NUM_MAX
1229#define BTA_DI_NUM_MAX 3
The Android Open Source Project5738f832012-12-12 16:00:35 -08001230#endif
1231
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001232/* Device features mask definitions */
Myles Watsoncd1fd072016-11-09 13:17:43 -08001233#define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE
1234#define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001235/* ACL type
1236*/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001237#define BTA_DM_LINK_TYPE_BR_EDR 0x01
1238#define BTA_DM_LINK_TYPE_LE 0x02
1239#define BTA_DM_LINK_TYPE_ALL 0xFF
Marie Janssene9e58ce2016-06-17 14:12:17 -07001240typedef uint8_t tBTA_DM_LINK_TYPE;
Andre Eisenbach3aa60542013-03-22 18:00:51 -07001241
Myles Watsoncd1fd072016-11-09 13:17:43 -08001242#define IMMEDIATE_DELY_MODE 0x00
1243#define ONFOUND_DELY_MODE 0x01
1244#define BATCH_DELY_MODE 0x02
1245#define ALLOW_ALL_FILTER 0x00
1246#define LOWEST_RSSI_VALUE 129
Satya Calloji6e2d9db2014-07-08 16:18:58 -07001247
The Android Open Source Project5738f832012-12-12 16:00:35 -08001248/*****************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001249 * External Function Declarations
1250 ****************************************************************************/
The Android Open Source Project5738f832012-12-12 16:00:35 -08001251
1252/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001253 *
1254 * Function BTA_EnableBluetooth
1255 *
1256 * Description This function initializes BTA and prepares BTA and the
1257 * Bluetooth protocol stack for use. This function is
1258 * typically called at startup or when Bluetooth services
1259 * are required by the phone. This function must be called
1260 * before calling any other API function.
1261 *
1262 *
1263 * Returns BTA_SUCCESS if successful.
1264 * BTA_FAIL if internal failure.
1265 *
1266 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001267extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK* p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001268
1269/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001270 *
1271 * Function BTA_DisableBluetooth
1272 *
1273 * Description This function disables BTA and the Bluetooth protocol
1274 * stack. It is called when BTA is no longer being used
1275 * by any application in the system.
1276 *
1277 *
1278 * Returns void
1279 *
1280 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001281extern tBTA_STATUS BTA_DisableBluetooth(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001282
1283/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001284 *
1285 * Function BTA_EnableTestMode
1286 *
1287 * Description Enables bluetooth device under test mode
1288 *
1289 *
1290 * Returns tBTA_STATUS
1291 *
1292 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001293extern tBTA_STATUS BTA_EnableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001294
1295/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001296 *
1297 * Function BTA_DisableTestMode
1298 *
1299 * Description Disable bluetooth device under test mode
1300 *
1301 *
1302 * Returns None
1303 *
1304 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001305extern void BTA_DisableTestMode(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001306
1307/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001308 *
1309 * Function BTA_DmSetDeviceName
1310 *
1311 * Description This function sets the Bluetooth name of the local device.
1312 *
1313 *
1314 * Returns void
1315 *
1316 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001317extern void BTA_DmSetDeviceName(char* p_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001318
1319/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001320 *
1321 * Function BTA_DmSetVisibility
1322 *
1323 * Description This function sets the Bluetooth connectable,discoverable,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001324 * pairable and conn paired only modesmodes of the local
Myles Watson1baaae32016-11-09 14:25:23 -08001325 * device.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001326 * This controls whether other Bluetooth devices can find and
Myles Watson1baaae32016-11-09 14:25:23 -08001327 * connect to the local device.
Myles Watson8af480e2016-11-09 10:40:23 -08001328 *
1329 *
1330 * Returns void
1331 *
1332 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001333extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode,
1334 uint8_t pairable_mode, uint8_t conn_filter);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001335
1336/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001337 *
1338 * Function BTA_DmSearch
1339 *
1340 * Description This function searches for peer Bluetooth devices. It
1341 * first performs an inquiry; for each device found from the
1342 * inquiry it gets the remote name of the device. If
1343 * parameter services is nonzero, service discovery will be
1344 * performed on each device for the services specified.
1345 *
1346 *
1347 * Returns void
1348 *
1349 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001350extern void BTA_DmSearch(tBTA_DM_INQ* p_dm_inq, tBTA_SERVICE_MASK services,
1351 tBTA_DM_SEARCH_CBACK* p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001352
1353/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001354 *
1355 * Function BTA_DmSearchCancel
1356 *
1357 * Description This function cancels a search that has been initiated
1358 * by calling BTA_DmSearch().
1359 *
1360 *
1361 * Returns void
1362 *
1363 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001364extern void BTA_DmSearchCancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001365
1366/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001367 *
1368 * Function BTA_DmDiscover
1369 *
1370 * Description This function performs service discovery for the services
1371 * of a particular peer device.
1372 *
1373 *
1374 * Returns void
1375 *
1376 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001377extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001378 tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001379
The Android Open Source Project5738f832012-12-12 16:00:35 -08001380/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001381 *
1382 * Function BTA_DmDiscoverUUID
1383 *
1384 * Description This function performs service discovery for the services
1385 * of a particular peer device.
1386 *
1387 *
1388 * Returns void
1389 *
1390 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001391extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID* uuid,
1392 tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001393
1394/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001395 *
1396 * Function BTA_DmGetCachedRemoteName
1397 *
1398 * Description Retieve cached remote name if available
1399 *
1400 * Returns BTA_SUCCESS if cached name was retrieved
1401 * BTA_FAILURE if cached name is not available
1402 *
1403 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001404tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device,
1405 uint8_t** pp_cached_name);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001406
1407/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001408 *
1409 * Function BTA_DmBond
1410 *
1411 * Description This function initiates a bonding procedure with a peer
1412 * device. The bonding procedure enables authentication
1413 * and optionally encryption on the Bluetooth link.
1414 *
1415 *
1416 * Returns void
1417 *
1418 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001419extern void BTA_DmBond(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001420
1421/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001422 *
1423 * Function BTA_DmBondByTransport
1424 *
1425 * Description This function initiates a bonding procedure with a peer
Myles Watsoncd1fd072016-11-09 13:17:43 -08001426 * device by designated transport. The bonding procedure
Myles Watson1baaae32016-11-09 14:25:23 -08001427 * enables authentication and optionally encryption on the
1428 * Bluetooth link.
Myles Watson8af480e2016-11-09 10:40:23 -08001429 *
1430 *
1431 * Returns void
1432 *
1433 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001434extern void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001435
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001436/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001437 *
1438 * Function BTA_DmBondCancel
1439 *
1440 * Description This function cancels a bonding procedure with a peer
1441 * device.
1442 *
1443 *
1444 * Returns void
1445 *
1446 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001447extern void BTA_DmBondCancel(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001448
1449/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001450 *
1451 * Function BTA_DmPinReply
1452 *
1453 * Description This function provides a PIN when one is requested by DM
1454 * during a bonding procedure. The application should call
1455 * this function after the security callback is called with
1456 * a BTA_DM_PIN_REQ_EVT.
1457 *
1458 *
1459 * Returns void
1460 *
1461 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001462extern void BTA_DmPinReply(BD_ADDR bd_addr, bool accept, uint8_t pin_len,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001463 uint8_t* p_pin);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001464
The Android Open Source Project5738f832012-12-12 16:00:35 -08001465/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001466 *
1467 * Function BTA_DmLocalOob
1468 *
1469 * Description This function retrieves the OOB data from local controller.
1470 * The result is reported by bta_dm_co_loc_oob().
1471 *
1472 * Returns void
1473 *
1474 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001475extern void BTA_DmLocalOob(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001476
1477/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001478 *
1479 * Function BTA_DmConfirm
1480 *
1481 * Description This function accepts or rejects the numerical value of the
1482 * Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT
1483 *
1484 * Returns void
1485 *
1486 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001487extern void BTA_DmConfirm(BD_ADDR bd_addr, bool accept);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001488
1489/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001490 *
1491 * Function BTA_DmAddDevice
1492 *
1493 * Description This function adds a device to the security database list
1494 * of peer devices. This function would typically be called
1495 * at system startup to initialize the security database with
1496 * known peer devices. This is a direct execution function
1497 * that may lock task scheduling on some platforms.
1498 *
1499 * Returns void
1500 *
1501 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001502extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class,
1503 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
Marie Janssene9e58ce2016-06-17 14:12:17 -07001504 bool is_trusted, uint8_t key_type,
1505 tBTA_IO_CAP io_cap, uint8_t pin_length);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001506
1507/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001508 *
1509 * Function BTA_DmRemoveDevice
1510 *
1511 * Description This function removes a device from the security database.
1512 * This is a direct execution function that may lock task
1513 * scheduling on some platforms.
1514 *
1515 *
1516 * Returns BTA_SUCCESS if successful.
1517 * BTA_FAIL if operation failed.
1518 *
1519 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001520extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001521
1522/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001523 *
1524 * Function BTA_GetEirService
1525 *
1526 * Description This function is called to get BTA service mask from EIR.
1527 *
1528 * Parameters p_eir - pointer of EIR significant part
1529 * p_services - return the BTA service mask
1530 *
1531 * Returns None
1532 *
1533 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001534extern void BTA_GetEirService(uint8_t* p_eir, tBTA_SERVICE_MASK* p_services);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001535
Andre Eisenbach5c0b0522014-06-18 12:20:37 -07001536/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001537 *
1538 * Function BTA_DmGetConnectionState
1539 *
1540 * Description Returns whether the remote device is currently connected.
1541 *
1542 * Returns 0 if the device is NOT connected.
1543 *
1544 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001545extern uint16_t BTA_DmGetConnectionState(const BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001546
1547/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001548 *
1549 * Function BTA_DmSetLocalDiRecord
1550 *
1551 * Description This function adds a DI record to the local SDP database.
1552 *
1553 * Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1554 *
1555 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001556extern tBTA_STATUS BTA_DmSetLocalDiRecord(tBTA_DI_RECORD* p_device_info,
1557 uint32_t* p_handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001558
1559/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001560 *
1561 *
1562 * Function BTA_DmCloseACL
1563 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001564 * Description This function force to close an ACL connection and remove
1565 the
Myles Watson8af480e2016-11-09 10:40:23 -08001566 * device from the security database list of known devices.
1567 *
1568 * Parameters: bd_addr - Address of the peer device
1569 * remove_dev - remove device or not after link down
1570 * transport - which transport to close
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001571
Myles Watson8af480e2016-11-09 10:40:23 -08001572 *
1573 * Returns void.
1574 *
1575 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001576extern void BTA_DmCloseACL(BD_ADDR bd_addr, bool remove_dev,
1577 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001578
1579/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001580 *
1581 * Function bta_dmexecutecallback
1582 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001583 * Description This function will request BTA to execute a call back in the
Myles Watson1baaae32016-11-09 14:25:23 -08001584 * context of BTU task.
Myles Watson8af480e2016-11-09 10:40:23 -08001585 * This API was named in lower case because it is only intended
1586 * for the internal customers(like BTIF).
1587 *
1588 * Returns void
1589 *
1590 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001591extern void bta_dmexecutecallback(tBTA_DM_EXEC_CBACK* p_callback,
1592 void* p_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001593
1594#if (BTM_SCO_HCI_INCLUDED == TRUE)
1595/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001596 *
1597 * Function BTA_DmPcmInitSamples
1598 *
1599 * Description initialize the down sample converter.
1600 *
1601 * src_sps: original samples per second (source audio data)
1602 * (ex. 44100, 48000)
1603 * bits: number of bits per pcm sample (16)
1604 * n_channels: number of channels (i.e. mono(1), stereo(2)...)
1605 *
1606 * Returns none
1607 *
1608 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001609extern void BTA_DmPcmInitSamples(uint32_t src_sps, uint32_t bits,
1610 uint32_t n_channels);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001611
1612/**************************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001613 * Function BTA_DmPcmResample
1614 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001615 * Description Down sampling utility to convert higher sampling rate into
Myles Watson1baaae32016-11-09 14:25:23 -08001616 * 8K/16bits
Myles Watson8af480e2016-11-09 10:40:23 -08001617 * PCM samples.
1618 *
1619 * Parameters p_src: pointer to the buffer where the original sampling PCM
1620 * are stored.
1621 * in_bytes: Length of the input PCM sample buffer in byte.
Myles Watson1baaae32016-11-09 14:25:23 -08001622 * p_dst: pointer to the buffer which is to be used to store
1623 * the converted PCM samples.
Myles Watson8af480e2016-11-09 10:40:23 -08001624 *
1625 *
1626 * Returns int32_t: number of samples converted.
1627 *
1628 *************************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001629extern int32_t BTA_DmPcmResample(void* p_src, uint32_t in_bytes, void* p_dst);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001630#endif
1631
Marie Janssene9e58ce2016-06-17 14:12:17 -07001632#if (BLE_INCLUDED == TRUE)
The Android Open Source Project5738f832012-12-12 16:00:35 -08001633/* BLE related API functions */
1634/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001635 *
1636 * Function BTA_DmBleSecurityGrant
1637 *
1638 * Description Grant security request access.
1639 *
1640 * Parameters: bd_addr - BD address of the peer
1641 * res - security grant status.
1642 *
1643 * Returns void
1644 *
1645 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001646extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001647
The Android Open Source Project5738f832012-12-12 16:00:35 -08001648/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001649 *
1650 * Function BTA_DmBleSetBgConnType
1651 *
1652 * Description This function is called to set BLE connectable mode for a
1653 * peripheral device.
1654 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001655 * Parameters bg_conn_type: it can be auto connection, or selective
Myles Watson1baaae32016-11-09 14:25:23 -08001656 * connection.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001657 * p_select_cback: callback function when selective connection
Myles Watson1baaae32016-11-09 14:25:23 -08001658 * procedure is being used.
Myles Watson8af480e2016-11-09 10:40:23 -08001659 *
1660 * Returns void
1661 *
1662 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001663extern void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type,
1664 tBTA_DM_BLE_SEL_CBACK* p_select_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001665
1666/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001667 *
1668 * Function BTA_DmBlePasskeyReply
1669 *
1670 * Description Send BLE SMP passkey reply.
1671 *
1672 * Parameters: bd_addr - BD address of the peer
1673 * accept - passkey entry sucessful or declined.
1674 * passkey - passkey value, must be a 6 digit number,
1675 * can be lead by 0.
1676 *
1677 * Returns void
1678 *
1679 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001680extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept,
1681 uint32_t passkey);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001682
1683/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001684 *
1685 * Function BTA_DmBleConfirmReply
1686 *
1687 * Description Send BLE SMP SC user confirmation reply.
1688 *
1689 * Parameters: bd_addr - BD address of the peer
Myles Watsoncd1fd072016-11-09 13:17:43 -08001690 * accept - numbers to compare are the same or
Myles Watson1baaae32016-11-09 14:25:23 -08001691 * different.
Myles Watson8af480e2016-11-09 10:40:23 -08001692 *
1693 * Returns void
1694 *
1695 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001696extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept);
Satya Calloji444a8da2015-03-06 10:38:22 -08001697
1698/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001699 *
1700 * Function BTA_DmAddBleDevice
1701 *
1702 * Description Add a BLE device. This function will be normally called
1703 * during host startup to restore all required information
1704 * for a LE device stored in the NVRAM.
1705 *
1706 * Parameters: bd_addr - BD address of the peer
1707 * dev_type - Remote device's device type.
1708 * addr_type - LE device address type.
1709 *
1710 * Returns void
1711 *
1712 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001713extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
1714 tBT_DEVICE_TYPE dev_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001715
The Android Open Source Project5738f832012-12-12 16:00:35 -08001716/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001717 *
1718 * Function BTA_DmAddBleKey
1719 *
1720 * Description Add/modify LE device information. This function will be
1721 * normally called during host startup to restore all required
1722 * information stored in the NVRAM.
1723 *
1724 * Parameters: bd_addr - BD address of the peer
1725 * p_le_key - LE key values.
1726 * key_type - LE SMP key type.
1727 *
1728 * Returns void
1729 *
1730 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001731extern void BTA_DmAddBleKey(BD_ADDR bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
1732 tBTA_LE_KEY_TYPE key_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001733
1734/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001735 *
1736 * Function BTA_DmSetBlePrefConnParams
1737 *
1738 * Description This function is called to set the preferred connection
1739 * parameters when default connection parameter is not desired.
1740 *
1741 * Parameters: bd_addr - BD address of the peripheral
1742 * min_conn_int - minimum preferred connection interval
1743 * max_conn_int - maximum preferred connection interval
1744 * slave_latency - preferred slave latency
1745 * supervision_tout - preferred supervision timeout
1746 *
1747 *
1748 * Returns void
1749 *
1750 ******************************************************************************/
Jakub Pawlowski063ca022016-04-25 10:43:02 -07001751extern void BTA_DmSetBlePrefConnParams(const BD_ADDR bd_addr,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001752 uint16_t min_conn_int,
1753 uint16_t max_conn_int,
1754 uint16_t slave_latency,
1755 uint16_t supervision_tout);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001756
1757/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001758 *
1759 * Function BTA_DmSetBleConnScanParams
1760 *
1761 * Description This function is called to set scan parameters used in
1762 * BLE connection request
1763 *
1764 * Parameters: scan_interval - scan interval
1765 * scan_window - scan window
1766 *
1767 * Returns void
1768 *
1769 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001770extern void BTA_DmSetBleConnScanParams(uint32_t scan_interval,
1771 uint32_t scan_window);
Satya Calloji5725fc62015-03-31 13:24:32 -07001772
1773/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001774 *
1775 * Function BTA_DmSetBleScanParams
1776 *
1777 * Description This function is called to set scan parameters
1778 *
1779 * Parameters: client_if - Client IF
1780 * scan_interval - scan interval
1781 * scan_window - scan window
1782 * scan_mode - scan mode
Myles Watsoncd1fd072016-11-09 13:17:43 -08001783 * scan_param_setup_status_cback - Set scan param status
Myles Watson1baaae32016-11-09 14:25:23 -08001784 * callback
Myles Watson8af480e2016-11-09 10:40:23 -08001785 *
1786 * Returns void
1787 *
1788 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001789extern void BTA_DmSetBleScanParams(
1790 tGATT_IF client_if, uint32_t scan_interval, uint32_t scan_window,
1791 tBLE_SCAN_MODE scan_mode,
1792 tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_status_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001793
1794/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001795 *
1796 * Function BTA_DmSetBleAdvParams
1797 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001798 * Description This function sets the advertising parameters BLE
Myles Watson1baaae32016-11-09 14:25:23 -08001799 * functionality.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001800 * It is to be called when device act in peripheral or
Myles Watson1baaae32016-11-09 14:25:23 -08001801 * broadcaster role.
Myles Watson8af480e2016-11-09 10:40:23 -08001802 *
1803 * Parameters: adv_int_min - adv interval minimum
1804 * adv_int_max - adv interval max
1805 * p_dir_bda - directed adv initator address
1806 *
1807 * Returns void
1808 *
1809 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001810extern void BTA_DmSetBleAdvParams(uint16_t adv_int_min, uint16_t adv_int_max,
1811 tBLE_BD_ADDR* p_dir_bda);
Andre Eisenbach5c44e452013-08-06 18:19:37 -07001812/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001813 *
1814 * Function BTA_DmSearchExt
1815 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001816 * Description This function searches for peer Bluetooth devices. It
Myles Watson1baaae32016-11-09 14:25:23 -08001817 * performs an inquiry and gets the remote name for devices.
1818 * Service discovery is done if services is non zero
Myles Watson8af480e2016-11-09 10:40:23 -08001819 *
1820 * Parameters p_dm_inq: inquiry conditions
Myles Watsoncd1fd072016-11-09 13:17:43 -08001821 * services: if service is not empty, service discovery will be
Myles Watson1baaae32016-11-09 14:25:23 -08001822 * done.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001823 * for all GATT based service condition, put
Myles Watson1baaae32016-11-09 14:25:23 -08001824 * num_uuid, and p_uuid is the pointer to the list of
1825 * UUID values.
Myles Watson8af480e2016-11-09 10:40:23 -08001826 * p_cback: callback functino when search is completed.
1827 *
1828 *
1829 *
1830 * Returns void
1831 *
1832 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001833extern void BTA_DmSearchExt(tBTA_DM_INQ* p_dm_inq,
1834 tBTA_SERVICE_MASK_EXT* p_services,
1835 tBTA_DM_SEARCH_CBACK* p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001836
1837/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001838 *
1839 * Function BTA_DmDiscoverExt
1840 *
1841 * Description This function does service discovery for services of a
1842 * peer device. When services.num_uuid is 0, it indicates all
1843 * GATT based services are to be searched; other wise a list of
1844 * UUID of interested services should be provided through
1845 * services.p_uuid.
1846 *
1847 *
1848 *
1849 * Returns void
1850 *
1851 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001852extern void BTA_DmDiscoverExt(BD_ADDR bd_addr,
1853 tBTA_SERVICE_MASK_EXT* p_services,
1854 tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001855
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -07001856/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001857 *
1858 * Function BTA_DmDiscoverByTransport
1859 *
1860 * Description This function does service discovery on particular transport
1861 * for services of a
1862 * peer device. When services.num_uuid is 0, it indicates all
1863 * GATT based services are to be searched; other wise a list of
1864 * UUID of interested services should be provided through
1865 * p_services->p_uuid.
1866 *
1867 *
1868 *
1869 * Returns void
1870 *
1871 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001872extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr,
1873 tBTA_SERVICE_MASK_EXT* p_services,
1874 tBTA_DM_SEARCH_CBACK* p_cback,
1875 bool sdp_search,
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001876 tBTA_TRANSPORT transport);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001877
1878/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001879 *
1880 * Function BTA_DmSetEncryption
1881 *
1882 * Description This function is called to ensure that connection is
1883 * encrypted. Should be called only on an open connection.
1884 * Typically only needed for connections that first want to
1885 * bring up unencrypted links, then later encrypt them.
1886 *
1887 * Parameters: bd_addr - Address of the peer device
1888 * transport - transport of the link to be encruypted
1889 * p_callback - Pointer to callback function to indicat the
1890 * link encryption status
1891 * sec_act - This is the security action to indicate
Myles Watson1baaae32016-11-09 14:25:23 -08001892 * what kind of BLE security level is required
1893 * for the BLE link if BLE is supported
1894 * Note: This parameter is ignored for
1895 * BR/EDR or if BLE is not supported.
Myles Watson8af480e2016-11-09 10:40:23 -08001896 *
1897 * Returns void
1898 *
1899 *
1900 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001901extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001902 tBTA_DM_ENCRYPT_CBACK* p_callback,
June R. Tate-Gans24933b52014-09-24 15:25:02 -07001903 tBTA_DM_BLE_SEC_ACT sec_act);
The Android Open Source Project5738f832012-12-12 16:00:35 -08001904
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001905/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001906 *
1907 * Function BTA_DmBleObserve
1908 *
1909 * Description This procedure keep the device listening for advertising
1910 * events from a broadcast device.
1911 *
1912 * Parameters start: start or stop observe.
Myles Watsoncd1fd072016-11-09 13:17:43 -08001913 * duration : Duration of the scan. Continuous scan if 0 is
Myles Watson1baaae32016-11-09 14:25:23 -08001914 * passed
Myles Watson8af480e2016-11-09 10:40:23 -08001915 * p_results_cb: Callback to be called with scan results
1916 *
1917 * Returns void
1918 *
1919 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001920extern void BTA_DmBleObserve(bool start, uint8_t duration,
Myles Watsoncd1fd072016-11-09 13:17:43 -08001921 tBTA_DM_SEARCH_CBACK* p_results_cb);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001922
The Android Open Source Project5738f832012-12-12 16:00:35 -08001923#endif
1924
Marie Janssene9e58ce2016-06-17 14:12:17 -07001925#if (BLE_INCLUDED == TRUE)
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001926/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001927 *
1928 * Function BTA_DmBleConfigLocalPrivacy
1929 *
1930 * Description Enable/disable privacy on the local device
1931 *
1932 * Parameters: privacy_enable - enable/disabe privacy on remote device.
1933 *
1934 * Returns void
1935 *
1936 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001937extern void BTA_DmBleConfigLocalPrivacy(bool privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001938
1939/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001940 *
1941 * Function BTA_DmBleEnableRemotePrivacy
1942 *
1943 * Description Enable/disable privacy on a remote device
1944 *
1945 * Parameters: bd_addr - BD address of the peer
1946 * privacy_enable - enable/disabe privacy on remote device.
1947 *
1948 * Returns void
1949 *
1950 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07001951extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, bool privacy_enable);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -08001952
Jakub Pawlowski6a966612016-08-16 03:25:45 -07001953/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001954 *
1955 * Function BTA_DmBleUpdateConnectionParams
1956 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001957 * Description Update connection parameters, can only be used when
Myles Watson1baaae32016-11-09 14:25:23 -08001958 * connection is up.
Myles Watson8af480e2016-11-09 10:40:23 -08001959 *
1960 * Parameters: bd_addr - BD address of the peer
Myles Watson1baaae32016-11-09 14:25:23 -08001961 * min_int - minimum connection interval, [0x0004 ~ 0x4000]
1962 * max_int - maximum connection interval, [0x0004 ~ 0x4000]
1963 * latency - slave latency [0 ~ 500]
1964 * timeout - supervision timeout [0x000a ~ 0xc80]
Myles Watson8af480e2016-11-09 10:40:23 -08001965 *
1966 * Returns void
1967 *
1968 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001969extern void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr,
1970 uint16_t min_int, uint16_t max_int,
1971 uint16_t latency, uint16_t timeout);
Satya Callojic4e25962014-05-10 23:46:24 -07001972
1973/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001974 *
1975 * Function BTA_DmBleSetDataLength
1976 *
1977 * Description This function is to set maximum LE data packet size
1978 *
1979 * Returns void
1980 *
1981 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08001982extern void BTA_DmBleSetDataLength(BD_ADDR remote_device,
1983 uint16_t tx_data_length);
Priti Aghera636d6712014-12-18 13:55:48 -08001984
1985/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08001986 *
1987 * Function BTA_DmBleSetStorageParams
1988 *
1989 * Description This function is called to set the storage parameters
1990 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08001991 * Parameters batch_scan_full_max -Max storage space (in %) allocated to
Myles Watson1baaae32016-11-09 14:25:23 -08001992 * full scanning
Myles Watsoncd1fd072016-11-09 13:17:43 -08001993 * batch_scan_trunc_max -Max storage space (in %) allocated to
Myles Watson1baaae32016-11-09 14:25:23 -08001994 * truncated scanning
Myles Watsoncd1fd072016-11-09 13:17:43 -08001995 * batch_scan_notify_threshold - Setup notification level based
Myles Watson1baaae32016-11-09 14:25:23 -08001996 * on total space consumed by
1997 * both pools. Setting it to 0
1998 * will disable threshold
1999 * notification
Myles Watson8af480e2016-11-09 10:40:23 -08002000 * p_setup_cback - Setup callback
2001 * p_thres_cback - Threshold callback
2002 * p_rep_cback - Reports callback
2003 * ref_value - Reference value
2004 *
2005 * Returns None
2006 *
2007 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002008extern void BTA_DmBleSetStorageParams(
2009 uint8_t batch_scan_full_max, uint8_t batch_scan_trunc_max,
2010 uint8_t batch_scan_notify_threshold,
2011 tBTA_BLE_SCAN_SETUP_CBACK* p_setup_cback,
2012 tBTA_BLE_SCAN_THRESHOLD_CBACK* p_thres_cback,
2013 tBTA_BLE_SCAN_REP_CBACK* p_rep_cback, tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002014
2015/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002016 *
2017 * Function BTA_DmBleEnableBatchScan
2018 *
2019 * Description This function is called to enable the batch scan
2020 *
2021 * Parameters scan_mode -Batch scan mode
2022 * scan_interval - Scan interval
2023 * scan_window - Scan window
2024 * discard_rule -Discard rules
2025 * addr_type - Address type
2026 * ref_value - Reference value
2027 *
2028 * Returns None
2029 *
2030 ******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002031extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002032 uint32_t scan_interval,
2033 uint32_t scan_window,
2034 tBTA_BLE_DISCARD_RULE discard_rule,
2035 tBLE_ADDR_TYPE addr_type,
2036 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002037
2038/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002039 *
2040 * Function BTA_DmBleReadScanReports
2041 *
2042 * Description This function is called to read the batch scan reports
2043 *
2044 * Parameters scan_mode -Batch scan mode
2045 * ref_value - Reference value
2046 *
2047 * Returns None
2048 *
2049 ******************************************************************************/
Satya Calloji5725fc62015-03-31 13:24:32 -07002050extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002051 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002052
2053/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002054 *
2055 * Function BTA_DmBleDisableBatchScan
2056 *
2057 * Description This function is called to disable the batch scanning
2058 *
2059 * Parameters ref_value - Reference value
2060 *
2061 * Returns None
2062 *
2063 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002064extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value);
Satya Callojic4e25962014-05-10 23:46:24 -07002065
Satya Calloji1a9247a2014-06-05 13:15:15 -07002066/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002067 *
2068 * Function BTA_DmEnableScanFilter
2069 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002070 * Description This function is called to enable the adv data payload
Myles Watson1baaae32016-11-09 14:25:23 -08002071 * filter
Myles Watson8af480e2016-11-09 10:40:23 -08002072 *
2073 * Parameters action - enable or disable the APCF feature
2074 * p_cmpl_cback - Command completed callback
2075 * ref_value - Reference value
2076 *
2077 * Returns void
2078 *
2079 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002080extern void BTA_DmEnableScanFilter(uint8_t action,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002081 tBTA_DM_BLE_PF_STATUS_CBACK* p_cmpl_cback,
2082 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -07002083
2084/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002085 *
2086 * Function BTA_DmBleScanFilterSetup
2087 *
2088 * Description This function is called to setup the filter params
2089 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002090 * Parameters p_target: enable the filter condition on a target device; if
Myles Watson1baaae32016-11-09 14:25:23 -08002091 * NULL
Myles Watson8af480e2016-11-09 10:40:23 -08002092 * filt_index - Filter index
2093 * p_filt_params -Filter parameters
2094 * ref_value - Reference value
2095 * action - Add, delete or clear
2096 * p_cmpl_back - Command completed callback
2097 *
2098 * Returns void
2099 *
2100 ******************************************************************************/
Marie Janssene9e58ce2016-06-17 14:12:17 -07002101extern void BTA_DmBleScanFilterSetup(uint8_t action,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002102 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2103 tBTA_DM_BLE_PF_FILT_PARAMS* p_filt_params,
2104 tBLE_BD_ADDR* p_target,
2105 tBTA_DM_BLE_PF_PARAM_CBACK* p_cmpl_cback,
2106 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1a9247a2014-06-05 13:15:15 -07002107
2108/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002109 *
2110 * Function BTA_DmBleCfgFilterCondition
2111 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002112 * Description This function is called to configure the adv data payload
Myles Watson1baaae32016-11-09 14:25:23 -08002113 * filter condition.
Myles Watson8af480e2016-11-09 10:40:23 -08002114 *
2115 * Parameters action: to read/write/clear
2116 * cond_type: filter condition type
2117 * filt_index - Filter index
2118 * p_cond: filter condition parameter
2119 * p_cmpl_back - Command completed callback
2120 * ref_value - Reference value
2121 *
2122 * Returns void
2123 *
2124 ******************************************************************************/
June R. Tate-Gans24933b52014-09-24 15:25:02 -07002125extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
Myles Watsoncd1fd072016-11-09 13:17:43 -08002126 tBTA_DM_BLE_PF_COND_TYPE cond_type,
2127 tBTA_DM_BLE_PF_FILT_INDEX filt_index,
2128 tBTA_DM_BLE_PF_COND_PARAM* p_cond,
2129 tBTA_DM_BLE_PF_CFG_CBACK* p_cmpl_cback,
2130 tBTA_DM_BLE_REF_VALUE ref_value);
Satya Calloji1acb61c2014-06-14 23:16:18 -07002131
2132/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002133 *
2134 * Function BTA_DmBleTrackAdvertiser
2135 *
2136 * Description This function is called to track the advertiser
2137 *
2138 * Parameters ref_value - Reference value
2139 * p_track_adv_cback - ADV callback
2140 *
2141 * Returns None
2142 *
2143 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002144extern void BTA_DmBleTrackAdvertiser(
2145 tBTA_DM_BLE_REF_VALUE ref_value,
2146 tBTA_BLE_TRACK_ADV_CBACK* p_track_adv_cback);
Satya Calloji1acb61c2014-06-14 23:16:18 -07002147
Satya Callojie5ba8842014-07-03 17:18:02 -07002148/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002149 *
2150 * Function BTA_DmBleGetEnergyInfo
2151 *
2152 * Description This function is called to obtain the energy info
2153 *
2154 * Parameters p_cmpl_cback - Command complete callback
2155 *
2156 * Returns void
2157 *
2158 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002159extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback);
Satya Callojie5ba8842014-07-03 17:18:02 -07002160
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002161/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002162 *
2163 * Function BTA_BrcmInit
2164 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002165 * Description This function initializes Broadcom specific VS handler in
Myles Watson1baaae32016-11-09 14:25:23 -08002166 * BTA
Myles Watson8af480e2016-11-09 10:40:23 -08002167 *
2168 * Returns void
2169 *
2170 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002171extern void BTA_VendorInit(void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002172
2173/*******************************************************************************
Myles Watson8af480e2016-11-09 10:40:23 -08002174 *
2175 * Function BTA_BrcmCleanup
2176 *
Myles Watsoncd1fd072016-11-09 13:17:43 -08002177 * Description This function frees up Broadcom specific VS specific dynamic
Myles Watson1baaae32016-11-09 14:25:23 -08002178 * memory
Myles Watson8af480e2016-11-09 10:40:23 -08002179 *
2180 * Returns void
2181 *
2182 ******************************************************************************/
Myles Watsoncd1fd072016-11-09 13:17:43 -08002183extern void BTA_VendorCleanup(void);
Prerepa Viswanadham16fe0822014-08-07 11:38:06 -07002184
Matthew Xiefc4b2f12013-05-06 20:51:02 -07002185#endif
The Android Open Source Project5738f832012-12-12 16:00:35 -08002186
2187#ifdef __cplusplus
2188}
2189#endif
2190
2191#endif /* BTA_API_H */