NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
bta_api.h
1/******************************************************************************
2 *
3 * NOTICE OF CHANGES
4 * 2024/03/26:
5 * - Add power mode #defines for RVL target
6 *
7 * 2025/03/11:
8 * - Restore old function signatures
9 * - Change search callback event IDs
10 * - Change tBTA_DM_INQ_RES structure
11 *
12 * 2025/05/02:
13 * - Add BTA_DmSendHciReset
14 *
15 * Compile with REVOLUTION defined to include these changes.
16 *
17 ******************************************************************************/
18
19
20
21/******************************************************************************
22 *
23 * Copyright (C) 2003-2012 Broadcom Corporation
24 *
25 * Licensed under the Apache License, Version 2.0 (the "License");
26 * you may not use this file except in compliance with the License.
27 * You may obtain a copy of the License at:
28 *
29 * http://www.apache.org/licenses/LICENSE-2.0
30 *
31 * Unless required by applicable law or agreed to in writing, software
32 * distributed under the License is distributed on an "AS IS" BASIS,
33 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34 * See the License for the specific language governing permissions and
35 * limitations under the License.
36 *
37 ******************************************************************************/
38
39/******************************************************************************
40 *
41 * This is the public interface file for BTA, Broadcom's Bluetooth
42 * application layer for mobile phones.
43 *
44 ******************************************************************************/
45#ifndef BTA_API_H
46#define BTA_API_H
47
48#include "data_types.h"
49#include "bt_target.h"
50#include "bt_types.h"
51#include "btm_api.h"
52#include "uipc_msg.h"
53
54#if BLE_INCLUDED == TRUE
55#include "btm_ble_api.h"
56#endif
57
58/*****************************************************************************
59** Constants and data types
60*****************************************************************************/
61
62/* Status Return Value */
63#define BTA_SUCCESS 0 /* Successful operation. */
64#define BTA_FAILURE 1 /* Generic failure. */
65#define BTA_PENDING 2 /* API cannot be completed right now */
66#define BTA_BUSY 3
67#define BTA_NO_RESOURCES 4
68#define BTA_WRONG_MODE 5
69
70typedef UINT8 tBTA_STATUS;
71
72/*
73 * Service ID
74 *
75 * NOTES: When you add a new Service ID for BTA AND require to change the value of BTA_MAX_SERVICE_ID,
76 * make sure that the correct security ID of the new service from Security service definitions (btm_api.h)
77 * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in bta_dm_act.c.
78 */
79
80#define BTA_RES_SERVICE_ID 0 /* Reserved */
81#define BTA_SPP_SERVICE_ID 1 /* Serial port profile. */
82#define BTA_DUN_SERVICE_ID 2 /* Dial-up networking profile. */
83#define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */
84#define BTA_LAP_SERVICE_ID 4 /* LAN access profile. */
85#define BTA_HSP_SERVICE_ID 5 /* Headset profile. */
86#define BTA_HFP_SERVICE_ID 6 /* Hands-free profile. */
87#define BTA_OPP_SERVICE_ID 7 /* Object push */
88#define BTA_FTP_SERVICE_ID 8 /* File transfer */
89#define BTA_CTP_SERVICE_ID 9 /* Cordless Terminal */
90#define BTA_ICP_SERVICE_ID 10 /* Intercom Terminal */
91#define BTA_SYNC_SERVICE_ID 11 /* Synchronization */
92#define BTA_BPP_SERVICE_ID 12 /* Basic printing profile */
93#define BTA_BIP_SERVICE_ID 13 /* Basic Imaging profile */
94#define BTA_PANU_SERVICE_ID 14 /* PAN User */
95#define BTA_NAP_SERVICE_ID 15 /* PAN Network access point */
96#define BTA_GN_SERVICE_ID 16 /* PAN Group Ad-hoc networks */
97#define BTA_SAP_SERVICE_ID 17 /* SIM Access profile */
98#define BTA_A2DP_SERVICE_ID 18 /* A2DP Sink */
99#define BTA_AVRCP_SERVICE_ID 19 /* A/V remote control */
100#define BTA_HID_SERVICE_ID 20 /* HID */
101#define BTA_VDP_SERVICE_ID 21 /* Video distribution */
102#define BTA_PBAP_SERVICE_ID 22 /* PhoneBook Access Server*/
103#define BTA_HSP_HS_SERVICE_ID 23 /* HFP HS role */
104#define BTA_HFP_HS_SERVICE_ID 24 /* HSP HS role */
105#define BTA_MAP_SERVICE_ID 25 /* Message Access Profile */
106#define BTA_MN_SERVICE_ID 26 /* Message Notification Service */
107#define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */
108#define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/
109
110#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
111/* BLE profile service ID */
112#define BTA_BLE_SERVICE_ID 29 /* GATT profile */
113
114// btla-specific ++
115#define BTA_USER_SERVICE_ID 30 /* User requested UUID */
116
117#define BTA_MAX_SERVICE_ID 31
118// btla-specific --
119#else
120#define BTA_USER_SERVICE_ID 29 /* User requested UUID */
121#define BTA_MAX_SERVICE_ID 30
122#endif
123/* service IDs (BTM_SEC_SERVICE_FIRST_EMPTY + 1) to (BTM_SEC_MAX_SERVICES - 1)
124 * are used by BTA JV */
125#define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1)
126#define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1)
127
128typedef UINT8 tBTA_SERVICE_ID;
129
130/* Service ID Mask */
131#define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */
132#define BTA_SPP_SERVICE_MASK 0x00000002 /* Serial port profile. */
133#define BTA_DUN_SERVICE_MASK 0x00000004 /* Dial-up networking profile. */
134#define BTA_FAX_SERVICE_MASK 0x00000008 /* Fax profile. */
135#define BTA_LAP_SERVICE_MASK 0x00000010 /* LAN access profile. */
136#define BTA_HSP_SERVICE_MASK 0x00000020 /* HSP AG role. */
137#define BTA_HFP_SERVICE_MASK 0x00000040 /* HFP AG role */
138#define BTA_OPP_SERVICE_MASK 0x00000080 /* Object push */
139#define BTA_FTP_SERVICE_MASK 0x00000100 /* File transfer */
140#define BTA_CTP_SERVICE_MASK 0x00000200 /* Cordless Terminal */
141#define BTA_ICP_SERVICE_MASK 0x00000400 /* Intercom Terminal */
142#define BTA_SYNC_SERVICE_MASK 0x00000800 /* Synchronization */
143#define BTA_BPP_SERVICE_MASK 0x00001000 /* Print server */
144#define BTA_BIP_SERVICE_MASK 0x00002000 /* Basic Imaging */
145#define BTA_PANU_SERVICE_MASK 0x00004000 /* PAN User */
146#define BTA_NAP_SERVICE_MASK 0x00008000 /* PAN Network access point */
147#define BTA_GN_SERVICE_MASK 0x00010000 /* PAN Group Ad-hoc networks */
148#define BTA_SAP_SERVICE_MASK 0x00020000 /* PAN Group Ad-hoc networks */
149#define BTA_A2DP_SERVICE_MASK 0x00040000 /* Advanced audio distribution */
150#define BTA_AVRCP_SERVICE_MASK 0x00080000 /* A/V remote control */
151#define BTA_HID_SERVICE_MASK 0x00100000 /* HID */
152#define BTA_VDP_SERVICE_MASK 0x00200000 /* Video distribution */
153#define BTA_PBAP_SERVICE_MASK 0x00400000 /* Phone Book Server */
154#define BTA_HSP_HS_SERVICE_MASK 0x00800000 /* HFP HS role */
155#define BTA_HFP_HS_SERVICE_MASK 0x01000000 /* HSP HS role */
156#define BTA_MAS_SERVICE_MASK 0x02000000 /* Message Access Profile */
157#define BTA_MN_SERVICE_MASK 0x04000000 /* Message Notification Profile */
158#define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */
159#define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */
160
161#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
162#define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */
163// btla-specific ++
164#define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */
165// btla-specific --
166#else
167// btla-specific ++
168#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
169// btla-specific --
170#endif
171
172#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
173#define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */
174#else
175#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
176#endif
177
178typedef UINT32 tBTA_SERVICE_MASK;
179
180/* extended service mask, including mask with one or more GATT UUID */
181typedef struct
182{
183 tBTA_SERVICE_MASK srvc_mask;
184 UINT8 num_uuid;
185 tBT_UUID *p_uuid;
187
188/* Security Setting Mask */
189#define BTA_SEC_NONE BTM_SEC_NONE /* No security. */
190#define BTA_SEC_AUTHORIZE (BTM_SEC_IN_AUTHORIZE ) /* Authorization required (only needed for out going connection )*/
191#define BTA_SEC_AUTHENTICATE (BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */
192#define BTA_SEC_ENCRYPT (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */
193
194typedef UINT8 tBTA_SEC;
195
196/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
197
198#define BTA_DM_IGNORE 0xFF
199
200
201/* Discoverable Modes */
202#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
203#define BTA_DM_GENERAL_DISC BTM_GENERAL_DISCOVERABLE /* General discoverable. */
204#define BTA_DM_LIMITED_DISC BTM_LIMITED_DISCOVERABLE /* Limited discoverable. */
205
206// btla-specific ++
207typedef UINT16 tBTA_DM_DISC;
208// btla-specific --
209
210/* Connectable Modes */
211#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
212#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
213
214// btla-specific ++
215typedef UINT16 tBTA_DM_CONN;
216// btla-specific --
217
218/* Pairable Modes */
219#define BTA_DM_PAIRABLE 1
220#define BTA_DM_NON_PAIRABLE 0
221
222/* Connectable Paired Only Mode */
223#define BTA_DM_CONN_ALL 0
224#define BTA_DM_CONN_PAIRED 1
225
226/* Inquiry Modes */
227#define BTA_DM_GENERAL_INQUIRY BTM_GENERAL_INQUIRY /* Perform general inquiry. */
228#define BTA_DM_LIMITED_INQUIRY BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
229
230#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
231#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
232#define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
233#define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
234#endif
235typedef UINT8 tBTA_DM_INQ_MODE;
236
237/* Inquiry Filter Type */
238#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
239#define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
240#define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
241
242typedef UINT8 tBTA_DM_INQ_FILT;
243
244/* Authorize Response */
245#define BTA_DM_AUTH_PERM 0 /* Authorized for future connections to the service */
246#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
247#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
248
249typedef UINT8 tBTA_AUTH_RESP;
250
251/* M/S preferred roles */
252#define BTA_ANY_ROLE 0x00
253#define BTA_MASTER_ROLE_PREF 0x01
254#define BTA_MASTER_ROLE_ONLY 0x02
255
256typedef UINT8 tBTA_PREF_ROLES;
257
258enum
259{
260
261 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might
262 support "role switch during connection" for
263 an incoming connection, when it already has
264 another connection in master role */
265 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have
266 simulateous connection in Master and Slave roles
267 for short period of time */
268 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master
269 and slave roles */
270
271};
272
273
274/* Inquiry filter device class condition */
275typedef struct
276{
277 DEV_CLASS dev_class; /* device class of interest */
278 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of interest */
280
281
282/* Inquiry Filter Condition */
283typedef union
284{
285 BD_ADDR bd_addr; /* BD address of device to filter. */
286 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
288
289/* Inquiry Parameters */
290typedef struct
291{
292 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
293 UINT8 duration; /* Inquiry duration in 1.28 sec units. */
294 UINT8 max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
295 BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */
296 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
297 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
299
300typedef struct
301{
302 UINT8 bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */
303#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
304 UINT8 bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
305 UINT8 *bta_dm_eir_uuid16; /* 16-bit UUIDs */
306#else
307 UINT32 uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
308#endif
309 INT8 *bta_dm_eir_inq_tx_power; /* Inquiry TX power */
310 UINT8 bta_dm_eir_flag_len; /* length of flags in bytes */
311 UINT8 *bta_dm_eir_flags; /* flags for EIR */
312 UINT8 bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */
313 UINT8 *bta_dm_eir_manufac_spec; /* manufacturer specific */
315
316#if BLE_INCLUDED == TRUE
317/* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */
318#define BTA_BLE_LIMIT_DISC_FLAG BTM_BLE_LIMIT_DISC_FLAG
319#define BTA_BLE_GEN_DISC_FLAG BTM_BLE_GEN_DISC_FLAG
320#define BTA_BLE_BREDR_NOT_SPT BTM_BLE_BREDR_NOT_SPT
321#define BTA_BLE_NON_LIMIT_DISC_FLAG BTM_BLE_NON_LIMIT_DISC_FLAG
322#define BTA_BLE_ADV_FLAG_MASK BTM_BLE_ADV_FLAG_MASK
323#define BTA_BLE_LIMIT_DISC_MASK BTM_BLE_LIMIT_DISC_MASK
324
325#define BTA_BLE_AD_BIT_DEV_NAME BTM_BLE_AD_BIT_DEV_NAME
326#define BTA_BLE_AD_BIT_FLAGS BTM_BLE_AD_BIT_FLAGS
327#define BTA_BLE_AD_BIT_MANU BTM_BLE_AD_BIT_MANU
328#define BTA_BLE_AD_BIT_TX_PWR BTM_BLE_AD_BIT_TX_PWR
329#define BTA_BLE_AD_BIT_ATTR BTM_BLE_AD_BIT_ATTR
330#define BTA_BLE_AD_BIT_INT_RANGE BTM_BLE_AD_BIT_INT_RANGE
331#define BTA_BLE_AD_BIT_SERVICE BTM_BLE_AD_BIT_SERVICE
332#define BTA_BLE_AD_BIT_SERVICE_SOL BTM_BLE_AD_BIT_SERVICE_SOL
333#define BTA_BLE_AD_BIT_SERVICE_DATA BTM_BLE_AD_BIT_SERVICE_DATA
334#define BTA_BLE_AD_BIT_SIGN_DATA BTM_BLE_AD_BIT_SIGN_DATA
335typedef UINT16 tBTA_BLE_AD_MASK;
336
337/* slave preferred connection interval range */
338typedef struct
339{
340 UINT16 low;
341 UINT16 hi;
342
344
345/* Service tag supported in the device */
346typedef struct
347{
348 UINT8 num_service;
349 BOOLEAN list_cmpl;
350 UINT16 *p_uuid;
352
353/* attribute data */
354typedef struct
355{
356 UINT16 uuid;
357 UINT16 data_len;
358 UINT8 *p_data;
360
361#define BTA_BLE_NUM_AD_ATTR_MAX BTM_BLE_NUM_AD_ATTR_MAX
362
363/* attribute list contained in adv data */
364typedef struct
365{
366 UINT8 num_attr;
367 tBTA_BLE_ATTR attr_list[BTA_BLE_NUM_AD_ATTR_MAX];
369
370typedef struct
371{
372 UINT8 len;
373 UINT8 *p_val;
375
376typedef struct
377{
378 tBTA_BLE_MANU manu; /* manufactuer data */
379 tBTA_BLE_INT_RANGE int_range; /* slave prefered conn interval range */
380 tBTA_BLE_SERVICE services; /* services */
381 tBTA_BLE_ATTR_DATA attr; /* attribute data */
382 UINT8 flag;
384
385/* These are the fields returned in each device adv packet. It
386** is returned in the results callback if registered.
387*/
388typedef struct
389{
390 UINT8 conn_mode;
391 tBTA_BLE_AD_MASK ad_mask; /* mask of the valid adv data field */
392 UINT8 flag;
393 UINT8 tx_power_level;
394 UINT8 remote_name_len;
395 UINT8 *p_remote_name;
396 tBTA_BLE_ATTR_DATA attr_data;
397 tBTA_BLE_SERVICE service;
399#endif
400
401typedef INT8 tBTA_DM_RSSI_VALUE;
402typedef UINT8 tBTA_DM_LINK_QUALITY_VALUE;
403
404
405/* signal strength mask */
406#define BTA_SIG_STRENGTH_RSSI_MASK 1
407#define BTA_SIG_STRENGTH_LINK_QUALITY_MASK 2
408
409typedef UINT8 tBTA_SIG_STRENGTH_MASK;
410
411
412/* Security Callback Events */
413#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
414#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
415#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
416#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
417#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
418#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
419#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
420#define BTA_DM_SIG_STRENGTH_EVT 7 /* Signal strength for bluetooth connection */
421#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
422#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
423#define BTA_DM_SP_CFM_REQ_EVT 10 /* Simple Pairing User Confirmation request. */
424#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
425#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
426#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
427#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
428#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
429#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
430#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
431#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
432#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
433#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
434#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
435// btla-specific ++
436#define BTA_DM_BLE_AUTH_CMPL_EVT 22 /* BLE Auth complete */
437// btla-specific --
438#define BTA_DM_DEV_UNPAIRED_EVT 23
439#define BTA_DM_HW_ERROR_EVT 24 /* BT Chip H/W error */
440typedef UINT8 tBTA_DM_SEC_EVT;
441
442/* Structure associated with BTA_DM_ENABLE_EVT */
443typedef struct
444{
445 BD_ADDR bd_addr; /* BD address of local device. */
446 tBTA_STATUS status;
448
449/* Structure associated with BTA_DM_PIN_REQ_EVT */
450typedef struct
451{
452 BD_ADDR bd_addr; /* BD address peer device. */
453 BD_NAME bd_name; /* Name of peer device. */
454 DEV_CLASS dev_class; /* Class of Device */
456
457/* BLE related definition */
458
459#define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10)
460#define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x))
461#define BTA_DM_AUTH_SMP_PASSKEY_FAIL BTA_DM_AUTH_CONVERT_SMP_CODE (SMP_PASSKEY_ENTRY_FAIL)
462#define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL)
463#define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL)
464#define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR)
465#define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT)
466#define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE)
467#define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD)
468#define BTA_DM_AUTH_SMP_UNKNOWN_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN)
469#define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS)
470#define BTA_DM_AUTH_SMP_INTERNAL_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR)
471#define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP)
472#define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL)
473#define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL)
474#define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY)
475#define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL)
476#define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT)
477
478/* connection parameter boundary value and dummy value */
479#define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN
480#define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX
481#define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN
482#define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX
483#define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN
484#define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX
485#define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX
486#define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN
487#define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX
488#define BTA_DM_BLE_CONN_PARAM_UNDEF BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be overwritten */
489
490
491#define BTA_LE_KEY_PENC BTM_LE_KEY_PENC /* encryption information of peer device */
492#define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */
493#define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */
494#define BTA_LE_KEY_LENC BTM_LE_KEY_LENC /* master role security information:div */
495#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
496#define BTA_LE_KEY_LCSRK BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
497typedef UINT8 tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
498
499
500typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS ;
501typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS;
502typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS ;
503typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS ;
504
505typedef union
506{
507 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */
508 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */
509 BT_OCTET16 pid_key; /* peer device ID key */
510 tBTA_LE_LENC_KEYS lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/
511 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/
513
514#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
515#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
516typedef UINT8 tBTA_DM_BLE_LOCAL_KEY_MASK;
517
518typedef struct
519{
520 BT_OCTET16 ir;
521 BT_OCTET16 irk;
522 BT_OCTET16 dhk;
524
525#define BTA_DM_SEC_GRANTED BTA_SUCCESS
526#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
527#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
528typedef UINT8 tBTA_DM_BLE_SEC_GRANT;
529
530
531#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
532#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
533#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
534typedef UINT8 tBTA_DM_BLE_CONN_TYPE;
535
536typedef BOOLEAN (tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name);
537
538/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
539typedef struct
540{
541 BD_ADDR bd_addr; /* peer address */
542 BD_NAME bd_name; /* peer device name */
544
545typedef struct
546{
547 BD_ADDR bd_addr; /* peer address */
548 tBTM_LE_KEY_TYPE key_type;
549 tBTM_LE_KEY_VALUE key_value;
551
552/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
553typedef struct
554{
555 BD_ADDR bd_addr; /* BD address peer device. */
556 BD_NAME bd_name; /* Name of peer device. */
557 BOOLEAN key_present; /* Valid link key value in key element */
558 LINK_KEY key; /* Link key associated with peer device. */
559 UINT8 key_type; /* The type of Link Key */
560 BOOLEAN success; /* TRUE of authentication succeeded, FALSE if failed. */
561 UINT8 fail_reason; /* The HCI reason/error code for when success=FALSE */
562
564
565
566/* Structure associated with BTA_DM_AUTHORIZE_EVT */
567typedef struct
568{
569 BD_ADDR bd_addr; /* BD address peer device. */
570 BD_NAME bd_name; /* Name of peer device. */
571 tBTA_SERVICE_ID service; /* Service ID to authorize. */
572// btla-specific ++
573 DEV_CLASS dev_class;
574// btla-specific --
576
577/* Structure associated with BTA_DM_LINK_UP_EVT */
578typedef struct
579{
580 BD_ADDR bd_addr; /* BD address peer device. */
582
583/* Structure associated with BTA_DM_LINK_DOWN_EVT */
584typedef struct
585{
586 BD_ADDR bd_addr; /* BD address peer device. */
587 UINT8 status; /* connection open/closed */
589
590/* Structure associated with BTA_DM_ROLE_CHG_EVT */
591typedef struct
592{
593 BD_ADDR bd_addr; /* BD address peer device. */
594 UINT8 new_role; /* the new connection role */
596
597/* Structure associated with BTA_DM_SIG_STRENGTH_EVT */
598typedef struct
599{
600 BD_ADDR bd_addr; /* BD address peer device. */
601 tBTA_SIG_STRENGTH_MASK mask; /* mask for the values that are valid */
602 tBTA_DM_RSSI_VALUE rssi_value;
603 tBTA_DM_LINK_QUALITY_VALUE link_quality_value;
604
606
607/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
608typedef struct
609{
610 UINT8 level; /* when paging or inquiring, level is 10.
611 Otherwise, the number of ACL links */
613
614#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* DisplayOnly */
615#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* DisplayYesNo */
616#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* KeyboardOnly */
617#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* NoInputNoOutput */
618typedef tBTM_IO_CAP tBTA_IO_CAP;
619
620#define BTA_AUTH_SP_NO BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single Profile/non-bonding
621 Numeric comparison with automatic accept allowed */
622#define BTA_AUTH_SP_YES BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding
623 Use IO Capabilities to determine authentication procedure */
624#define BTA_AUTH_AP_NO BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated bonding
625 Numeric comparison with automatic accept allowed */
626#define BTA_AUTH_AP_YES BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated bonding
627 Use IO Capabilities to determine authentication procedure */
628#define BTA_AUTH_SPGB_NO BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general bonding
629 Numeric comparison with automatic accept allowed */
630#define BTA_AUTH_SPGB_YES BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general bonding
631 Use IO Capabilities to determine authentication procedure */
632typedef tBTM_AUTH_REQ tBTA_AUTH_REQ;
633
634#define BTA_AUTH_DD_BOND BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */
635#define BTA_AUTH_GEN_BOND BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */
636#define BTA_AUTH_BONDS BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */
637
638#define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/
639#define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */
640#define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */
641typedef tBTM_LE_AUTH_REQ tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */
642
643#define BTA_OOB_NONE BTM_OOB_NONE
644#define BTA_OOB_PRESENT BTM_OOB_PRESENT
645#if BTM_OOB_INCLUDED == TRUE
646#define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN
647#endif
648typedef tBTM_OOB_DATA tBTA_OOB_DATA;
649
650/* Structure associated with BTA_DM_SP_CFM_REQ_EVT */
651typedef struct
652{
653 BD_ADDR bd_addr; /* peer address */
654 DEV_CLASS dev_class; /* peer CoD */
655 BD_NAME bd_name; /* peer device name */
656 UINT32 num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */
657 BOOLEAN just_works; /* TRUE, if "Just Works" association model */
658 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
659 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
660 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
661 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */
663
664enum
665{
666 BTA_SP_KEY_STARTED, /* passkey entry started */
667 BTA_SP_KEY_ENTERED, /* passkey digit entered */
668 BTA_SP_KEY_ERASED, /* passkey digit erased */
669 BTA_SP_KEY_CLEARED, /* passkey cleared */
670 BTA_SP_KEY_COMPLT /* passkey entry completed */
671};
672typedef UINT8 tBTA_SP_KEY_TYPE;
673
674/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
675typedef struct
677 BD_ADDR bd_addr; /* peer address */
678 tBTA_SP_KEY_TYPE notif_type;
680
681/* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */
682typedef struct
683{
684 BD_ADDR bd_addr; /* peer address */
685 DEV_CLASS dev_class; /* peer CoD */
686 BD_NAME bd_name; /* peer device name */
687 UINT32 passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */
689
690/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
691typedef struct
692{
693 BD_ADDR bd_addr; /* peer address */
694 DEV_CLASS dev_class; /* peer CoD */
695 BD_NAME bd_name; /* peer device name */
697
698/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
699typedef struct
700{
701 tBTA_STATUS result; /* TRUE of bond cancel succeeded, FALSE if failed. */
703
704/* Union of all security callback structures */
705typedef union
706{
707 tBTA_DM_ENABLE enable; /* BTA enabled */
708 tBTA_DM_PIN_REQ pin_req; /* PIN request. */
709 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */
710 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */
711 tBTA_DM_LINK_UP link_up; /* ACL connection down event */
712 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
713 tBTA_DM_SIG_STRENGTH sig_strength; /* rssi and link quality value */
714 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
715 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */
716 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */
717 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */
718 tBTA_DM_BOND_CANCEL_CMPL bond_cancel_cmpl; /* Bond Cancel Complete indication */
719 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */
720 tBTA_DM_ROLE_CHG role_chg; /* role change event */
721 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */
722 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */
723 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */
724 BT_OCTET16 ble_er; /* ER event data */
726
727/* Security callback */
728typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
729
730/* Vendor Specific Command Callback */
731typedef tBTM_VSC_CMPL_CB tBTA_VENDOR_CMPL_CBACK;
732
733/* Search callback events */
734#ifdef REVOLUTION
735#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
736#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
737#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
738#define BTA_DM_DISC_CMPL_EVT 3 /* Discovery complete. */
739#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 4 /* Search cancelled */
740#else
741#define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */
742#define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */
743#define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */
744#define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based servoce on a peer device. */
745#define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */
746#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
747#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
748#endif
750typedef UINT8 tBTA_DM_SEARCH_EVT;
751
752#define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
753
754/* Structure associated with BTA_DM_INQ_RES_EVT */
755typedef struct
756{
757 BD_ADDR bd_addr; /* BD address peer device. */
758 DEV_CLASS dev_class; /* Device class of peer device. */
759#ifndef REVOLUTION
760 BOOLEAN remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
761 /* If the device name is known to application BTA skips the remote name request */
762 BOOLEAN is_limited; /* TRUE, if the limited inquiry bit is set in the CoD */
763#endif
764 INT8 rssi; /* The rssi value */
765 UINT8 *p_eir; /* received EIR */
766#if (BLE_INCLUDED == TRUE)
767 UINT8 inq_result_type;
768 UINT8 ble_addr_type;
769 tBTM_BLE_EVT_TYPE ble_evt_type;
770 tBT_DEVICE_TYPE device_type;
771#endif
772
774
775/* Structure associated with BTA_DM_INQ_CMPL_EVT */
776typedef struct
777{
778 UINT8 num_resps; /* Number of inquiry responses. */
780
781/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
782typedef struct
783{
784 BD_ADDR bd_addr; /* BD address peer device. */
785 UINT8 num_record; /* Number of DI record */
786 tBTA_STATUS result;
788
789/* Structure associated with BTA_DM_DISC_RES_EVT */
790typedef struct
791{
792 BD_ADDR bd_addr; /* BD address peer device. */
793 BD_NAME bd_name; /* Name of peer device. */
794 tBTA_SERVICE_MASK services; /* Services found on peer device. */
795// btla-specific ++
796 UINT8 * p_raw_data; /* Raw data for discovery DB */
797 UINT32 raw_data_size; /* size of raw data */
798 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
799 UINT32 num_uuids;
800 UINT8 *p_uuid_list;
801// btla-specific --
802 tBTA_STATUS result;
804
805/* Structure associated with tBTA_DM_DISC_BLE_RES */
806typedef struct
807{
808 BD_ADDR bd_addr; /* BD address peer device. */
809 BD_NAME bd_name; /* Name of peer device. */
810 tBT_UUID service; /* GATT based Services UUID found on peer device. */
812
813
814/* Union of all search callback structures */
815typedef union
816{
817 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
818 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
819 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
820 tBTA_DM_DISC_BLE_RES disc_ble_res; /* discovery result for GATT based service */
821 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
822
824
825/* Search callback */
826typedef void (tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data);
827
828/* Execute call back */
829typedef void (tBTA_DM_EXEC_CBACK) (void * p_param);
830
831/* Encryption callback*/
832typedef void (tBTA_DM_ENCRYPT_CBACK) (BD_ADDR bd_addr, tBTA_STATUS result);
833
834#if BLE_INCLUDED == TRUE
835#define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE
836#define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT
837#define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM
838#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
839typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
840#else
841typedef UINT8 tBTA_DM_BLE_SEC_ACT;
842#endif
843
844/* Maximum service name length */
845#define BTA_SERVICE_NAME_LEN 35
846#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
847#define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN
848
849
850/* link policy masks */
851#define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH
852#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
853#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
854#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
855typedef UINT16 tBTA_DM_LP_MASK;
856
857/* power mode actions */
858#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
859#define BTA_DM_PM_PARK 0x10 /* prefers park mode */
860#define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */
861#define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */
862#define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */
863#define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */
864#define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */
865#define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */
866#define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */
867#define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */
868#define BTA_DM_PM_SNIFF_USER0 0x28 /* prefers user-defined sniff0 mode (testtool only) */
869#define BTA_DM_PM_SNIFF_USER1 0x29 /* prefers user-defined sniff1 mode (testtool only) */
870#define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */
871#define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */
872#define BTA_DM_PM_NO_PREF 0x01 /* service has no prefernce on power mode setting. eg. connection to service got closed */
873
874#ifdef REVOLUTION
875// Were these values previously reversed?
876#define BTA_DM_PM_SNIFF_RVL 0x02
877#define BTA_DM_PM_RETRY_RVL 0x08
878#endif
879
880typedef UINT8 tBTA_DM_PM_ACTTION;
881
882/* index to bta_dm_ssr_spec */
883#define BTA_DM_PM_SSR0 0
884#define BTA_DM_PM_SSR1 1
885#define BTA_DM_PM_SSR2 2
886#define BTA_DM_PM_SSR3 3
887#define BTA_DM_PM_SSR4 4
888#define BTA_DM_PM_SSR5 5
889#define BTA_DM_PM_SSR6 6
890
891#define BTA_DM_PM_NUM_EVTS 9
892
893#ifndef BTA_DM_PM_PARK_IDX
894#define BTA_DM_PM_PARK_IDX 5 /* the actual index to bta_dm_pm_md[] for PARK mode */
895#endif
896
897#define BTA_DM_SW_BB_TO_MM BTM_SW_BB_TO_MM
898#define BTA_DM_SW_MM_TO_BB BTM_SW_MM_TO_BB
899#define BTA_DM_SW_BB_TO_BTC BTM_SW_BB_TO_BTC
900#define BTA_DM_SW_BTC_TO_BB BTM_SW_BTC_TO_BB
901
902typedef tBTM_SW_DIR tBTA_DM_SW_DIR;
903
904/* Switch callback events */
905#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
906
907typedef UINT8 tBTA_DM_SWITCH_EVT;
908typedef void (tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, tBTA_STATUS status);
909
910/* Audio routing out configuration */
911#define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */
912#define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */
913#define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */
914#define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */
915#define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */
916#define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */
917#define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */
918#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
919#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
920
921typedef UINT8 tBTA_DM_ROUTE_PATH;
922
923
924/* Device Identification (DI) data structure
925*/
926/* Used to set the DI record */
927typedef tSDP_DI_RECORD tBTA_DI_RECORD;
928/* Used to get the DI record */
929typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD;
930/* SDP discovery database */
931typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB;
932
933#ifndef BTA_DI_NUM_MAX
934#define BTA_DI_NUM_MAX 3
935#endif
936
937/*****************************************************************************
938** External Function Declarations
939*****************************************************************************/
940#ifdef __cplusplus
941extern "C"
942{
943#endif
944
945/*******************************************************************************
946**
947** Function BTA_EnableBluetooth
948**
949** Description This function initializes BTA and prepares BTA and the
950** Bluetooth protocol stack for use. This function is
951** typically called at startup or when Bluetooth services
952** are required by the phone. This function must be called
953** before calling any other API function.
954**
955**
956** Returns BTA_SUCCESS if successful.
957** BTA_FAIL if internal failure.
958**
959*******************************************************************************/
960BTA_API extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback);
961
962/*******************************************************************************
963**
964** Function BTA_DisableBluetooth
965**
966** Description This function disables BTA and the Bluetooth protocol
967** stack. It is called when BTA is no longer being used
968** by any application in the system.
969**
970**
971** Returns void
972**
973*******************************************************************************/
974BTA_API extern tBTA_STATUS BTA_DisableBluetooth(void);
975
976/*******************************************************************************
977**
978** Function BTA_EnableTestMode
979**
980** Description Enables bluetooth device under test mode
981**
982**
983** Returns tBTA_STATUS
984**
985*******************************************************************************/
986BTA_API extern tBTA_STATUS BTA_EnableTestMode(void);
987
988/*******************************************************************************
989**
990** Function BTA_DisableTestMode
991**
992** Description Disable bluetooth device under test mode
993**
994**
995** Returns None
996**
997*******************************************************************************/
998BTA_API extern void BTA_DisableTestMode(void);
999
1000/*******************************************************************************
1001**
1002** Function BTA_DmIsDeviceUp
1003**
1004** Description This function tests whether the Bluetooth module is up
1005** and ready. This is a direct execution function that
1006** may lock task scheduling on some platforms.
1007**
1008**
1009** Returns TRUE if the module is ready.
1010** FALSE if the module is not ready.
1011**
1012*******************************************************************************/
1013BTA_API extern BOOLEAN BTA_DmIsDeviceUp(void);
1014
1015/*******************************************************************************
1016**
1017** Function BTA_DmSetDeviceName
1018**
1019** Description This function sets the Bluetooth name of the local device.
1020**
1021**
1022** Returns void
1023**
1024*******************************************************************************/
1025BTA_API extern void BTA_DmSetDeviceName(char *p_name);
1026
1027/*******************************************************************************
1028**
1029** Function BTA_DmSetVisibility
1030**
1031** Description This function sets the Bluetooth connectable,discoverable,
1032** pairable and conn paired only modesmodes of the local device.
1033** This controls whether other Bluetooth devices can find and connect to
1034** the local device.
1035**
1036**
1037** Returns void
1038**
1039*******************************************************************************/
1040#ifdef REVOLUTION
1041BTA_API extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode);
1042#else
1043BTA_API extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, UINT8 pairable_mode, UINT8 conn_filter);
1044#endif
1045
1046/*******************************************************************************
1047**
1048** Function BTA_DmSetScanParam
1049**
1050** Description This function sets the parameters for page scan and
1051** inquiry scan.
1052**
1053**
1054** Returns void
1055**
1056*******************************************************************************/
1057BTA_API extern void BTA_DmSetScanParam (UINT16 page_scan_interval, UINT16 page_scan_window,
1058 UINT16 inquiry_scan_interval, UINT16 inquiry_scan_window);
1059
1060/*******************************************************************************
1061**
1062** Function BTA_DmSetAfhChannels
1063**
1064** Description This function sets the AFH first and
1065** last disable channel, so channels within
1066** that range are disabled.
1067** In order to use this API, BTM_BYPASS_AMP_AUTO_AFH must be set
1068** to be TRUE
1069**
1070** Returns void
1071**
1072*******************************************************************************/
1073BTA_API extern void BTA_DmSetAfhChannels(UINT8 first, UINT8 last);
1074
1075
1076/*******************************************************************************
1077**
1078** Function BTA_DmVendorSpecificCommand
1079**
1080** Description This function sends the vendor specific command
1081** to the controller
1082**
1083**
1084** Returns tBTA_STATUS
1085**
1086*******************************************************************************/
1087BTA_API extern tBTA_STATUS BTA_DmVendorSpecificCommand (UINT16 opcode, UINT8 param_len,UINT8 *p_param_buf, tBTA_VENDOR_CMPL_CBACK *p_cback);
1088
1089
1090/*******************************************************************************
1091**
1092** Function BTA_DmSearch
1093**
1094** Description This function searches for peer Bluetooth devices. It
1095** first performs an inquiry; for each device found from the
1096** inquiry it gets the remote name of the device. If
1097** parameter services is nonzero, service discovery will be
1098** performed on each device for the services specified.
1099**
1100**
1101** Returns void
1102**
1103*******************************************************************************/
1104BTA_API extern void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services,
1105 tBTA_DM_SEARCH_CBACK *p_cback);
1106
1107/*******************************************************************************
1108**
1109** Function BTA_DmSearchCancel
1110**
1111** Description This function cancels a search that has been initiated
1112** by calling BTA_DmSearch().
1113**
1114**
1115** Returns void
1116**
1117*******************************************************************************/
1118BTA_API extern void BTA_DmSearchCancel(void);
1119
1120/*******************************************************************************
1121**
1122** Function BTA_DmDiscover
1123**
1124** Description This function performs service discovery for the services
1125** of a particular peer device.
1126**
1127**
1128** Returns void
1129**
1130*******************************************************************************/
1131BTA_API extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
1132 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
1133
1134// btla-specific ++
1135/*******************************************************************************
1136**
1137** Function BTA_DmDiscoverUUID
1138**
1139** Description This function performs service discovery for the services
1140** of a particular peer device.
1141**
1142**
1143** Returns void
1144**
1145*******************************************************************************/
1146BTA_API extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
1147 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
1148
1149/*******************************************************************************
1150**
1151** Function BTA_DmGetCachedRemoteName
1152**
1153** Description Retieve cached remote name if available
1154**
1155** Returns BTA_SUCCESS if cached name was retrieved
1156** BTA_FAILURE if cached name is not available
1157**
1158*******************************************************************************/
1159tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, UINT8 **pp_cached_name);
1160// btla-specific --
1161
1162/*******************************************************************************
1163**
1164** Function BTA_DmIsMaster
1165**
1166** Description This function checks if the local device is the master of
1167** the link to the given device
1168**
1169** Returns TRUE if master.
1170** FALSE if not.
1171**
1172*******************************************************************************/
1173BTA_API extern BOOLEAN BTA_DmIsMaster(BD_ADDR bd_addr);
1174
1175/*******************************************************************************
1176**
1177** Function BTA_DmBond
1178**
1179** Description This function initiates a bonding procedure with a peer
1180** device. The bonding procedure enables authentication
1181** and optionally encryption on the Bluetooth link.
1182**
1183**
1184** Returns void
1185**
1186*******************************************************************************/
1187BTA_API extern void BTA_DmBond(BD_ADDR bd_addr);
1188
1189/*******************************************************************************
1190**
1191** Function BTA_DmBondCancel
1192**
1193** Description This function cancels a bonding procedure with a peer
1194** device.
1195**
1196**
1197** Returns void
1198**
1199*******************************************************************************/
1200BTA_API extern void BTA_DmBondCancel(BD_ADDR bd_addr);
1201
1202/*******************************************************************************
1203**
1204** Function BTA_DmPinReply
1205**
1206** Description This function provides a PIN when one is requested by DM
1207** during a bonding procedure. The application should call
1208** this function after the security callback is called with
1209** a BTA_DM_PIN_REQ_EVT.
1210**
1211**
1212** Returns void
1213**
1214*******************************************************************************/
1215BTA_API extern void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len,
1216 UINT8 *p_pin);
1217
1218/*******************************************************************************
1219**
1220** Function BTA_DmLinkPolicy
1221**
1222** Description This function sets/clears the link policy mask to the given
1223** bd_addr.
1224** If clearing the sniff or park mode mask, the link is put
1225** in active mode.
1226**
1227** Returns void
1228**
1229*******************************************************************************/
1230BTA_API extern void BTA_DmLinkPolicy(BD_ADDR bd_addr, tBTA_DM_LP_MASK policy_mask,
1231 BOOLEAN set);
1232
1233#if (BTM_OOB_INCLUDED == TRUE)
1234/*******************************************************************************
1235**
1236** Function BTA_DmLocalOob
1237**
1238** Description This function retrieves the OOB data from local controller.
1239** The result is reported by bta_dm_co_loc_oob().
1240**
1241** Returns void
1242**
1243*******************************************************************************/
1244BTA_API extern void BTA_DmLocalOob(void);
1245#endif /* BTM_OOB_INCLUDED */
1246
1247/*******************************************************************************
1248**
1249** Function BTA_DmConfirm
1250**
1251** Description This function accepts or rejects the numerical value of the
1252** Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT
1253**
1254** Returns void
1255**
1256*******************************************************************************/
1257BTA_API extern void BTA_DmConfirm(BD_ADDR bd_addr, BOOLEAN accept);
1258
1259/*******************************************************************************
1260**
1261** Function BTA_DmPasskeyCancel
1262**
1263** Description This function is called to cancel the simple pairing process
1264** reported by BTA_DM_SP_KEY_NOTIF_EVT
1265**
1266** Returns void
1267**
1268*******************************************************************************/
1269BTA_API extern void BTA_DmPasskeyCancel(BD_ADDR bd_addr);
1270
1271/*******************************************************************************
1272**
1273** Function BTA_DmAddDevice
1274**
1275** Description This function adds a device to the security database list
1276** of peer devices. This function would typically be called
1277** at system startup to initialize the security database with
1278** known peer devices. This is a direct execution function
1279** that may lock task scheduling on some platforms.
1280**
1281** Returns void
1282**
1283*******************************************************************************/
1284#ifdef REVOLUTION
1285BTA_API extern tBTA_STATUS BTA_DmAddDevice(BD_ADDR bd_addr, LINK_KEY link_key,
1286 tBTA_SERVICE_MASK trusted_mask,
1287 BOOLEAN is_trusted);
1288#else
1289BTA_API extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class,
1290 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
1291 BOOLEAN is_trusted, UINT8 key_type,
1292 tBTA_IO_CAP io_cap);
1293#endif
1294
1295/*******************************************************************************
1296**
1297** Function BTA_DmAddDevWithName
1298**
1299** Description This function is newer version of BTA_DmAddDevice()
1300** which added bd_name and features as input parameters.
1301**
1302**
1303** Returns void
1304**
1305*******************************************************************************/
1306BTA_API extern void BTA_DmAddDevWithName (BD_ADDR bd_addr, DEV_CLASS dev_class,
1307 BD_NAME bd_name, BD_FEATURES features,
1308 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask,
1309 BOOLEAN is_trusted, UINT8 key_type, tBTA_IO_CAP io_cap);
1310
1311/*******************************************************************************
1312**
1313** Function BTA_DmRemoveDevice
1314**
1315** Description This function removes a device from the security database.
1316** This is a direct execution function that may lock task
1317** scheduling on some platforms.
1318**
1319**
1320** Returns BTA_SUCCESS if successful.
1321** BTA_FAIL if operation failed.
1322**
1323*******************************************************************************/
1324BTA_API extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr);
1325
1326/*******************************************************************************
1327**
1328** Function BTA_DmAuthorizeReply
1329**
1330** Description This function provides an authorization reply when
1331** authorization is requested by BTA. The application calls
1332** this function after the security callback is called with
1333** a BTA_DM_AUTHORIZE_EVT.
1334**
1335**
1336** Returns void
1337**
1338*******************************************************************************/
1339BTA_API extern void BTA_DmAuthorizeReply(BD_ADDR bd_addr, tBTA_SERVICE_ID service,
1340 tBTA_AUTH_RESP response);
1341
1342/*******************************************************************************
1343**
1344** Function BTA_DmSignalStrength
1345**
1346** Description This function initiates RSSI and channnel quality
1347** measurments. BTA_DM_SIG_STRENGTH_EVT is sent to
1348** application with the values of RSSI and channel
1349** quality
1350**
1351**
1352** Returns void
1353**
1354*******************************************************************************/
1355BTA_API extern void BTA_DmSignalStrength(tBTA_SIG_STRENGTH_MASK mask, UINT16 period, BOOLEAN start);
1356
1357#ifdef REVOLUTION
1358/*******************************************************************************
1359**
1360** Function BTA_DmSendHciReset
1361**
1362** Returns void
1363**
1364*******************************************************************************/
1365void BTA_DmSendHciReset(void);
1366#endif
1367
1368/*******************************************************************************
1369**
1370** Function BTA_DmWriteInqTxPower
1371**
1372** Description This command is used to write the inquiry transmit power level
1373** used to transmit the inquiry (ID) data packets.
1374**
1375** Parameters tx_power - tx inquiry power to use, valid value is -70 ~ 20
1376
1377** Returns void
1378**
1379*******************************************************************************/
1380BTA_API extern void BTA_DmWriteInqTxPower(INT8 tx_power);
1381
1382/*******************************************************************************
1383**
1384** Function BTA_DmEirAddUUID
1385**
1386** Description This function is called to add UUID into EIR.
1387**
1388** Parameters tBT_UUID - UUID
1389**
1390** Returns None
1391**
1392*******************************************************************************/
1393BTA_API extern void BTA_DmEirAddUUID (tBT_UUID *p_uuid);
1394
1395/*******************************************************************************
1396**
1397** Function BTA_DmEirRemoveUUID
1398**
1399** Description This function is called to remove UUID from EIR.
1400**
1401** Parameters tBT_UUID - UUID
1402**
1403** Returns None
1404**
1405*******************************************************************************/
1406BTA_API extern void BTA_DmEirRemoveUUID (tBT_UUID *p_uuid);
1407
1408/*******************************************************************************
1409**
1410** Function BTA_DmSetEIRConfig
1411**
1412** Description This function is called to override the BTA default EIR parameters.
1413** This funciton is only valid in a system where BTU & App task
1414** are in the same memory space.
1415**
1416** Parameters Pointer to User defined EIR config
1417**
1418** Returns None
1419**
1420*******************************************************************************/
1421BTA_API extern void BTA_DmSetEIRConfig (tBTA_DM_EIR_CONF *p_eir_cfg);
1422
1423/*******************************************************************************
1424**
1425** Function BTA_CheckEirData
1426**
1427** Description This function is called to get EIR data from significant part.
1428**
1429** Parameters p_eir - pointer of EIR significant part
1430** type - finding EIR data type
1431** p_length - return the length of EIR data
1432**
1433** Returns pointer of EIR data
1434**
1435*******************************************************************************/
1436BTA_API extern UINT8 *BTA_CheckEirData( UINT8 *p_eir, UINT8 tag, UINT8 *p_length );
1437
1438/*******************************************************************************
1439**
1440** Function BTA_GetEirService
1441**
1442** Description This function is called to get BTA service mask from EIR.
1443**
1444** Parameters p_eir - pointer of EIR significant part
1445** p_services - return the BTA service mask
1446**
1447** Returns None
1448**
1449*******************************************************************************/
1450BTA_API extern void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services );
1451
1452/*******************************************************************************
1453**
1454** Function BTA_DmUseSsr
1455**
1456** Description This function is called to check if the connected peer device
1457** supports SSR or not.
1458**
1459** Returns TRUE, if SSR is supported
1460**
1461*******************************************************************************/
1462BTA_API extern BOOLEAN BTA_DmUseSsr( BD_ADDR bd_addr );
1463
1464
1465/*******************************************************************************
1466**
1467** Function BTA_DmSetLocalDiRecord
1468**
1469** Description This function adds a DI record to the local SDP database.
1470**
1471** Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1472**
1473*******************************************************************************/
1474BTA_API extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
1475 UINT32 *p_handle );
1476
1477/*******************************************************************************
1478**
1479** Function BTA_DmGetLocalDiRecord
1480**
1481** Description Get a specified DI record to the local SDP database. If no
1482** record handle is provided, the primary DI record will be
1483** returned.
1484**
1485** Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
1486**
1487*******************************************************************************/
1488BTA_API extern tBTA_STATUS BTA_DmGetLocalDiRecord( tBTA_DI_GET_RECORD *p_device_info,
1489 UINT32 *p_handle );
1490
1491/*******************************************************************************
1492**
1493** Function BTA_DmDiDiscover
1494**
1495** Description This function queries a remote device for DI information.
1496**
1497** Returns None.
1498**
1499*******************************************************************************/
1500BTA_API extern void BTA_DmDiDiscover( BD_ADDR remote_device, tBTA_DISCOVERY_DB *p_db,
1501 UINT32 len, tBTA_DM_SEARCH_CBACK *p_cback );
1502
1503/*******************************************************************************
1504**
1505** Function BTA_DmGetDiRecord
1506**
1507** Description This function retrieves a remote device's DI record from
1508** the specified database.
1509**
1510** Returns None.
1511**
1512*******************************************************************************/
1513BTA_API extern tBTA_STATUS BTA_DmGetDiRecord( UINT8 get_record_index, tBTA_DI_GET_RECORD *p_device_info,
1514 tBTA_DISCOVERY_DB *p_db );
1515
1516/*******************************************************************************
1517**
1518** Function BTA_SysFeatures
1519**
1520** Description This function is called to set system features.
1521**
1522** Returns void
1523**
1524*******************************************************************************/
1525BTA_API extern void BTA_SysFeatures (UINT16 sys_features);
1526
1527/*******************************************************************************
1528**
1529** Function bta_dmexecutecallback
1530**
1531** Description This function will request BTA to execute a call back in the context of BTU task
1532** This API was named in lower case because it is only intended
1533** for the internal customers(like BTIF).
1534**
1535** Returns void
1536**
1537*******************************************************************************/
1538BTA_API extern void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK* p_callback, void * p_param);
1539
1540#if (BTM_SCO_HCI_INCLUDED == TRUE)
1541/*******************************************************************************
1542**
1543** Function BTA_DmPcmInitSamples
1544**
1545** Description initialize the down sample converter.
1546**
1547** src_sps: original samples per second (source audio data)
1548** (ex. 44100, 48000)
1549** bits: number of bits per pcm sample (16)
1550** n_channels: number of channels (i.e. mono(1), stereo(2)...)
1551**
1552** Returns none
1553**
1554*******************************************************************************/
1555BTA_API extern void BTA_DmPcmInitSamples (UINT32 src_sps, UINT32 bits, UINT32 n_channels);
1556
1557/**************************************************************************************
1558** Function BTA_DmPcmResample
1559**
1560** Description Down sampling utility to convert higher sampling rate into 8K/16bits
1561** PCM samples.
1562**
1563** Parameters p_src: pointer to the buffer where the original sampling PCM
1564** are stored.
1565** in_bytes: Length of the input PCM sample buffer in byte.
1566** p_dst: pointer to the buffer which is to be used to store
1567** the converted PCM samples.
1568**
1569**
1570** Returns INT32: number of samples converted.
1571**
1572**************************************************************************************/
1573BTA_API extern INT32 BTA_DmPcmResample (void *p_src, UINT32 in_bytes, void *p_dst);
1574#endif
1575
1576#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
1577/* BLE related API functions */
1578/*******************************************************************************
1579**
1580** Function BTA_DmBleSecurityGrant
1581**
1582** Description Grant security request access.
1583**
1584** Parameters: bd_addr - BD address of the peer
1585** res - security grant status.
1586**
1587** Returns void
1588**
1589*******************************************************************************/
1590BTA_API extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res);
1591
1592
1593
1594/*******************************************************************************
1595**
1596** Function BTA_DmBleSetBgConnType
1597**
1598** Description This function is called to set BLE connectable mode for a
1599** peripheral device.
1600**
1601** Parameters bg_conn_type: it can be auto connection, or selective connection.
1602** p_select_cback: callback function when selective connection procedure
1603** is being used.
1604**
1605** Returns void
1606**
1607*******************************************************************************/
1608BTA_API extern void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type, tBTA_DM_BLE_SEL_CBACK *p_select_cback);
1609
1610/*******************************************************************************
1611**
1612** Function BTA_DmBlePasskeyReply
1613**
1614** Description Send BLE SMP passkey reply.
1615**
1616** Parameters: bd_addr - BD address of the peer
1617** accept - passkey entry sucessful or declined.
1618** passkey - passkey value, must be a 6 digit number,
1619** can be lead by 0.
1620**
1621** Returns void
1622**
1623*******************************************************************************/
1624BTA_API extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, BOOLEAN accept, UINT32 passkey);
1625
1626/*******************************************************************************
1627**
1628** Function BTA_DmAddBleDevice
1629**
1630** Description Add a BLE device. This function will be normally called
1631** during host startup to restore all required information
1632** for a LE device stored in the NVRAM.
1633**
1634** Parameters: bd_addr - BD address of the peer
1635** dev_type - Remote device's device type.
1636** addr_type - LE device address type.
1637**
1638** Returns void
1639**
1640*******************************************************************************/
1641BTA_API extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
1642 tBT_DEVICE_TYPE dev_type);
1643
1644
1645/*******************************************************************************
1646**
1647** Function BTA_DmAddBleKey
1648**
1649** Description Add/modify LE device information. This function will be
1650** normally called during host startup to restore all required
1651** information stored in the NVRAM.
1652**
1653** Parameters: bd_addr - BD address of the peer
1654** p_le_key - LE key values.
1655** key_type - LE SMP key type.
1656**
1657** Returns void
1658**
1659*******************************************************************************/
1660BTA_API extern void BTA_DmAddBleKey (BD_ADDR bd_addr, tBTA_LE_KEY_VALUE *p_le_key,
1661 tBTA_LE_KEY_TYPE key_type);
1662
1663/*******************************************************************************
1664**
1665** Function BTA_DmSetBlePrefConnParams
1666**
1667** Description This function is called to set the preferred connection
1668** parameters when default connection parameter is not desired.
1669**
1670** Parameters: bd_addr - BD address of the peripheral
1671** min_conn_int - minimum preferred connection interval
1672** max_conn_int - maximum preferred connection interval
1673** slave_latency - preferred slave latency
1674** supervision_tout - preferred supervision timeout
1675**
1676**
1677** Returns void
1678**
1679*******************************************************************************/
1680BTA_API extern void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr,
1681 UINT16 min_conn_int, UINT16 max_conn_int,
1682 UINT16 slave_latency, UINT16 supervision_tout );
1683
1684/*******************************************************************************
1685**
1686** Function BTA_DmSetBleConnScanParams
1687**
1688** Description This function is called to set scan parameters used in
1689** BLE connection request
1690**
1691** Parameters: bd_addr - BD address of the peripheral
1692** scan_interval - scan interval
1693** scan_window - scan window
1694**
1695** Returns void
1696**
1697*******************************************************************************/
1698BTA_API extern void BTA_DmSetBleConnScanParams(UINT16 scan_interval,
1699 UINT16 scan_window );
1700
1701/*******************************************************************************
1702**
1703** Function BTA_DmSearchExt
1704**
1705** Description This function searches for peer Bluetooth devices. It performs
1706** an inquiry and gets the remote name for devices. Service
1707** discovery is done if services is non zero
1708**
1709** Parameters p_dm_inq: inquiry conditions
1710** services: if service is not empty, service discovery will be done.
1711** for all GATT based service condition, put num_uuid, and
1712** p_uuid is the pointer to the list of UUID values.
1713** p_cback: callback functino when search is completed.
1714**
1715**
1716**
1717** Returns void
1718**
1719*******************************************************************************/
1720BTA_API extern void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services,
1721 tBTA_DM_SEARCH_CBACK *p_cback);
1722
1723/*******************************************************************************
1724**
1725** Function BTA_DmDiscoverExt
1726**
1727** Description This function does service discovery for services of a
1728** peer device. When services.num_uuid is 0, it indicates all
1729** GATT based services are to be searched; other wise a list of
1730** UUID of interested services should be provided through
1731** services.p_uuid.
1732**
1733**
1734**
1735** Returns void
1736**
1737*******************************************************************************/
1738BTA_API extern void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
1739 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
1740
1741
1742/*******************************************************************************
1743**
1744** Function BTA_DmSetEncryption
1745**
1746** Description This function is called to ensure that connection is
1747** encrypted. Should be called only on an open connection.
1748** Typically only needed for connections that first want to
1749** bring up unencrypted links, then later encrypt them.
1750**
1751** Parameters: bd_addr - Address of the peer device
1752** p_callback - Pointer to callback function to indicat the
1753** link encryption status
1754** sec_act - This is the security action to indicate
1755** what knid of BLE security level is required for
1756** the BLE link if the BLE is supported
1757** Note: This parameter is ignored for the BR/EDR link
1758** or the BLE is not supported
1759**
1760** Returns void
1761**
1762**
1763*******************************************************************************/
1764BTA_API extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_DM_ENCRYPT_CBACK *p_callback,
1765 tBTA_DM_BLE_SEC_ACT sec_act);
1766
1767#endif
1768
1769// btla-specific ++
1770/*******************************************************************************
1771**
1772** Function BTA_DmSetAfhChannelAssessment
1773**
1774** Description This function is called to set the channel assessment mode on or off
1775**
1776** Returns status
1777**
1778*******************************************************************************/
1779BTA_API extern void BTA_DmSetAfhChannelAssessment (BOOLEAN enable_or_disable);
1780// btla-specific --
1781
1782#ifdef __cplusplus
1783}
1784#endif
1785
1786#endif /* BTA_API_H */