Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
bte.h
Go to the documentation of this file.
1#ifndef CONTEXT_BTE_H
2#define CONTEXT_BTE_H
3
4#include <stdint.h>
5#include "types.h"
6
7// taken from https://github.com/doldecomp/sdk_2009-12-11/blob/main/include/context_bte.h
8
9/* Contains the context of the BTE library that the WPAD library needs to
10 * compile.
11 *
12 * This is not the full context; the other half of the context is in
13 * <context_rvl.h>.
14 *
15 * Most of this code is copyright (C) 2003-2012 Broadcom Corporation under the
16 * Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0>. The original
17 * source can be found at
18 * <https://android.googlesource.com/platform/external/bluetooth/bluedroid>;
19 * specifically, I used the earliest commit available (late 2012, commit hash
20 * 5738f83aeb59361a0a2eda2460113f6dc9194271).
21 */
22
23/* License redistribution conditions
24 *
25 * a. You may obtain a copy of the License at
26 * <http://www.apache.org/licenses/LICENSE-2.0>.
27 * b. Some of the code is modified. Comments will be marked with my name
28 * (muff1n) to show what I modified and where.
29 * c. See the following comment block, which is copied verbatim from bluedroid
30 * source.
31 * d. No NOTICE file is present in the commit that I used.
32 */
33
34/******************************************************************************
35 *
36 * Copyright (C) 2003-2012 Broadcom Corporation
37 *
38 * Licensed under the Apache License, Version 2.0 (the "License");
39 * you may not use this file except in compliance with the License.
40 * You may obtain a copy of the License at:
41 *
42 * http://www.apache.org/licenses/LICENSE-2.0
43 *
44 * Unless required by applicable law or agreed to in writing, software
45 * distributed under the License is distributed on an "AS IS" BASIS,
46 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
47 * See the License for the specific language governing permissions and
48 * limitations under the License.
49 *
50 ******************************************************************************/
51
52// from bluedroid source
53
54typedef uint8_t UINT8;
55typedef uint16_t UINT16;
56typedef uint32_t UINT32;
57
58typedef int8_t INT8;
59
60typedef unsigned char BOOLEAN;
61
62/* muff1n: It seems like BTE_TRACE_LEVEL_VERBOSE did not exist at the time. Or
63 * maybe it was a different logging level. At the very least, one logging level
64 * is missing.
65 */
66#define MAX_TRACE_LEVEL 5
67
68#define BD_ADDR_LEN 6 /* Device address length */
69typedef UINT8 BD_ADDR[BD_ADDR_LEN]; /* Device address */
70typedef UINT8 *BD_ADDR_PTR; /* Pointer to Device Address */
71
72#define LINK_KEY_LEN 16
73typedef UINT8 LINK_KEY[LINK_KEY_LEN]; /* Link Key */
74
75#define DEV_CLASS_LEN 3
76typedef UINT8 DEV_CLASS[DEV_CLASS_LEN]; /* Device class */
77typedef UINT8 *DEV_CLASS_PTR; /* Pointer to Device class */
78
79/* muff1n: TODO: bta_dm_pin_cback looks mostly the same except that BD_NAME_LEN
80 * is 33 (or it was 32 and BD_NAME_LEN was not decreased by 1 in BCM_STRNCPY_S
81 * calls)?
82 * confirm this
83 *
84 * UPDATE: there is a case where it is 248
85 */
86#define BD_NAME_LEN 248
87typedef UINT8 BD_NAME[BD_NAME_LEN]; /* Device name */
88typedef UINT8 *BD_NAME_PTR; /* Pointer to Device name */
89
90#define BD_FEATURES_LEN 8
91typedef UINT8 BD_FEATURES[BD_FEATURES_LEN]; /* LMP features supported by device */
92
93#define BT_DEVICE_TYPE_BREDR 0x01
94#define BT_DEVICE_TYPE_BLE 0x02
95#define BT_DEVICE_TYPE_DUMO 0x03
97
98/* Maximum UUID size - 16 bytes, and structure to hold any type of UUID. */
99#define MAX_UUID_SIZE 16
100typedef struct
101{
102#define LEN_UUID_16 2
103#define LEN_UUID_32 4
104#define LEN_UUID_128 16
105
107
108 union
109 {
112 UINT8 uuid128[MAX_UUID_SIZE];
113 } uu;
114
115} tBT_UUID;
116
117/* Status Return Value */
118#define BTA_SUCCESS 0 /* Successful operation. */
119#define BTA_FAILURE 1 /* Generic failure. */
120#define BTA_PENDING 2 /* API cannot be completed right now */
121#define BTA_BUSY 3
122#define BTA_NO_RESOURCES 4
123#define BTA_WRONG_MODE 5
124
126
127/*
128 * Service ID
129 *
130 * NOTES: When you add a new Service ID for BTA AND require to change the value of BTA_MAX_SERVICE_ID,
131 * make sure that the correct security ID of the new service from Security service definitions (btm_api.h)
132 * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in bta_dm_act.c.
133 */
134
135#define BTA_RES_SERVICE_ID 0 /* Reserved */
136#define BTA_SPP_SERVICE_ID 1 /* Serial port profile. */
137#define BTA_DUN_SERVICE_ID 2 /* Dial-up networking profile. */
138#define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */
139#define BTA_LAP_SERVICE_ID 4 /* LAN access profile. */
140#define BTA_HSP_SERVICE_ID 5 /* Headset profile. */
141#define BTA_HFP_SERVICE_ID 6 /* Hands-free profile. */
142#define BTA_OPP_SERVICE_ID 7 /* Object push */
143#define BTA_FTP_SERVICE_ID 8 /* File transfer */
144#define BTA_CTP_SERVICE_ID 9 /* Cordless Terminal */
145#define BTA_ICP_SERVICE_ID 10 /* Intercom Terminal */
146#define BTA_SYNC_SERVICE_ID 11 /* Synchronization */
147#define BTA_BPP_SERVICE_ID 12 /* Basic printing profile */
148#define BTA_BIP_SERVICE_ID 13 /* Basic Imaging profile */
149#define BTA_PANU_SERVICE_ID 14 /* PAN User */
150#define BTA_NAP_SERVICE_ID 15 /* PAN Network access point */
151#define BTA_GN_SERVICE_ID 16 /* PAN Group Ad-hoc networks */
152#define BTA_SAP_SERVICE_ID 17 /* SIM Access profile */
153#define BTA_A2DP_SERVICE_ID 18 /* A2DP Sink */
154#define BTA_AVRCP_SERVICE_ID 19 /* A/V remote control */
155#define BTA_HID_SERVICE_ID 20 /* HID */
156#define BTA_VDP_SERVICE_ID 21 /* Video distribution */
157#define BTA_PBAP_SERVICE_ID 22 /* PhoneBook Access Server*/
158#define BTA_HSP_HS_SERVICE_ID 23 /* HFP HS role */
159#define BTA_HFP_HS_SERVICE_ID 24 /* HSP HS role */
160#define BTA_MAP_SERVICE_ID 25 /* Message Access Profile */
161#define BTA_MN_SERVICE_ID 26 /* Message Notification Service */
162#define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */
163#define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/
164
165#define BTA_USER_SERVICE_ID 29 /* User requested UUID */
166#define BTA_MAX_SERVICE_ID 30
167
168/* service IDs (BTM_SEC_SERVICE_FIRST_EMPTY + 1) to (BTM_SEC_MAX_SERVICES - 1)
169 * are used by BTA JV */
170#define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1)
171#define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1)
172
174
175/* Service ID Mask */
176#define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */
177#define BTA_SPP_SERVICE_MASK 0x00000002 /* Serial port profile. */
178#define BTA_DUN_SERVICE_MASK 0x00000004 /* Dial-up networking profile. */
179#define BTA_FAX_SERVICE_MASK 0x00000008 /* Fax profile. */
180#define BTA_LAP_SERVICE_MASK 0x00000010 /* LAN access profile. */
181#define BTA_HSP_SERVICE_MASK 0x00000020 /* HSP AG role. */
182#define BTA_HFP_SERVICE_MASK 0x00000040 /* HFP AG role */
183#define BTA_OPP_SERVICE_MASK 0x00000080 /* Object push */
184#define BTA_FTP_SERVICE_MASK 0x00000100 /* File transfer */
185#define BTA_CTP_SERVICE_MASK 0x00000200 /* Cordless Terminal */
186#define BTA_ICP_SERVICE_MASK 0x00000400 /* Intercom Terminal */
187#define BTA_SYNC_SERVICE_MASK 0x00000800 /* Synchronization */
188#define BTA_BPP_SERVICE_MASK 0x00001000 /* Print server */
189#define BTA_BIP_SERVICE_MASK 0x00002000 /* Basic Imaging */
190#define BTA_PANU_SERVICE_MASK 0x00004000 /* PAN User */
191#define BTA_NAP_SERVICE_MASK 0x00008000 /* PAN Network access point */
192#define BTA_GN_SERVICE_MASK 0x00010000 /* PAN Group Ad-hoc networks */
193#define BTA_SAP_SERVICE_MASK 0x00020000 /* PAN Group Ad-hoc networks */
194#define BTA_A2DP_SERVICE_MASK 0x00040000 /* Advanced audio distribution */
195#define BTA_AVRCP_SERVICE_MASK 0x00080000 /* A/V remote control */
196#define BTA_HID_SERVICE_MASK 0x00100000 /* HID */
197#define BTA_VDP_SERVICE_MASK 0x00200000 /* Video distribution */
198#define BTA_PBAP_SERVICE_MASK 0x00400000 /* Phone Book Server */
199#define BTA_HSP_HS_SERVICE_MASK 0x00800000 /* HFP HS role */
200#define BTA_HFP_HS_SERVICE_MASK 0x01000000 /* HSP HS role */
201#define BTA_MAS_SERVICE_MASK 0x02000000 /* Message Access Profile */
202#define BTA_MN_SERVICE_MASK 0x04000000 /* Message Notification Profile */
203#define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */
204#define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */
205
206// btla-specific ++
207#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
208// btla-specific --
209
210#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
211
213
214/* SW sub-systems */
215#define BTA_ID_SYS 0 /* system manager */
216/* BLUETOOTH PART - from 0 to BTA_ID_BLUETOOTH_MAX */
217#define BTA_ID_DM 1 /* device manager */
218#define BTA_ID_DM_SEARCH 2 /* device manager search */
219#define BTA_ID_DM_SEC 3 /* device manager security */
220#define BTA_ID_DG 4 /* data gateway */
221#define BTA_ID_AG 5 /* audio gateway */
222#define BTA_ID_OPC 6 /* object push client */
223#define BTA_ID_OPS 7 /* object push server */
224#define BTA_ID_FTS 8 /* file transfer server */
225#define BTA_ID_CT 9 /* cordless telephony terminal */
226#define BTA_ID_FTC 10 /* file transfer client */
227#define BTA_ID_SS 11 /* synchronization server */
228#define BTA_ID_PR 12 /* Printer client */
229#define BTA_ID_BIC 13 /* Basic Imaging Client */
230#define BTA_ID_PAN 14 /* Personal Area Networking */
231#define BTA_ID_BIS 15 /* Basic Imaging Server */
232#define BTA_ID_ACC 16 /* Advanced Camera Client */
233#define BTA_ID_SC 17 /* SIM Card Access server */
234#define BTA_ID_AV 18 /* Advanced audio/video */
235#define BTA_ID_AVK 19 /* Audio/video sink */
236#define BTA_ID_HD 20 /* HID Device */
237#define BTA_ID_CG 21 /* Cordless Gateway */
238#define BTA_ID_BP 22 /* Basic Printing Client */
239#define BTA_ID_HH 23 /* Human Interface Device Host */
240#define BTA_ID_PBS 24 /* Phone Book Access Server */
241#define BTA_ID_PBC 25 /* Phone Book Access Client */
242#define BTA_ID_JV 26 /* Java */
243#define BTA_ID_HS 27 /* Headset */
244#define BTA_ID_MSE 28 /* Message Server Equipment */
245#define BTA_ID_MCE 29 /* Message Client Equipment */
246#define BTA_ID_HL 30 /* Health Device Profile*/
247#define BTA_ID_GATTC 31 /* GATT Client */
248#define BTA_ID_GATTS 32 /* GATT Client */
249#define BTA_ID_BLUETOOTH_MAX 33 /* last BT profile */
250
251/* FM */
252#define BTA_ID_FM 34 /* FM */
253#define BTA_ID_FMTX 35 /* FM TX */
254
255/* SENSOR */
256#define BTA_ID_SSR 36 /* Sensor */
257
258/* GPS */
259#define BTA_ID_GPS 37 /* GPS */
260
261/* GENERIC */
262#define BTA_ID_PRM 38
263#define BTA_ID_SYSTEM 39 /* platform-specific */
264#define BTA_ID_SWRAP 40 /* Insight script wrapper */
265#define BTA_ID_MIP 41 /* Multicase Individual Polling */
266#define BTA_ID_RT 42 /* Audio Routing module: This module is always on. */
267
268/* JV */
269#define BTA_ID_JV1 43 /* JV1 */
270#define BTA_ID_JV2 44 /* JV2 */
271
272#define BTA_ID_MAX (43 + BTA_DM_NUM_JV_ID)
273
275
276enum
277{
278 BTM_SUCCESS = 0, /* 0 Command succeeded */
279 BTM_CMD_STARTED, /* 1 Command started OK. */
280 BTM_BUSY, /* 2 Device busy with another command */
281 BTM_NO_RESOURCES, /* 3 No resources to issue command */
282 BTM_MODE_UNSUPPORTED, /* 4 Request for 1 or more unsupported modes */
283 BTM_ILLEGAL_VALUE, /* 5 Illegal parameter value */
284 BTM_WRONG_MODE, /* 6 Device in wrong mode for request */
285 BTM_UNKNOWN_ADDR, /* 7 Unknown remote BD address */
286 BTM_DEVICE_TIMEOUT, /* 8 Device timeout */
287 BTM_BAD_VALUE_RET, /* 9 A bad value was received from HCI */
288 BTM_ERR_PROCESSING, /* 10 Generic error */
289 BTM_NOT_AUTHORIZED, /* 11 Authorization failed */
290 BTM_DEV_RESET, /* 12 Device has been reset */
291 BTM_CMD_STORED, /* 13 request is stored in control block */
292 BTM_ILLEGAL_ACTION, /* 14 state machine gets illegal command */
293 BTM_DELAY_CHECK, /* 15 delay the check on encryption */
294 BTM_SCO_BAD_LENGTH, /* 16 Bad SCO over HCI data length */
295 BTM_SUCCESS_NO_SECURITY, /* 17 security passed, no security set */
296 BTM_FAILED_ON_SECURITY , /* 18 security failed */
297 BTM_REPEATED_ATTEMPTS /* 19 repeated attempts for LE security requests */
300
308
309#define BT_HDR_SIZE (sizeof (BT_HDR))
310
311/* Security Service Levels [bit mask] (BTM_SetSecurityLevel)
312** Encryption should not be used without authentication
313*/
314#define BTM_SEC_NONE 0x0000 /* Nothing required */
315#define BTM_SEC_IN_AUTHORIZE 0x0001 /* Inbound call requires authorization */
316#define BTM_SEC_IN_AUTHENTICATE 0x0002 /* Inbound call requires authentication */
317#define BTM_SEC_IN_ENCRYPT 0x0004 /* Inbound call requires encryption */
318#define BTM_SEC_OUT_AUTHORIZE 0x0008 /* Outbound call requires authorization */
319#define BTM_SEC_OUT_AUTHENTICATE 0x0010 /* Outbound call requires authentication */
320#define BTM_SEC_OUT_ENCRYPT 0x0020 /* Outbound call requires encryption */
321#define BTM_SEC_BOND 0x0040 /* Bonding */
322#define BTM_SEC_BOND_CONN 0x0080 /* bond_created_connection */
323#define BTM_SEC_FORCE_MASTER 0x0100 /* Need to switch connection to be master */
324#define BTM_SEC_ATTEMPT_MASTER 0x0200 /* Try to switch connection to be master */
325#define BTM_SEC_FORCE_SLAVE 0x0400 /* Need to switch connection to be master */
326#define BTM_SEC_ATTEMPT_SLAVE 0x0800 /* Try to switch connection to be slave */
327#define BTM_SEC_IN_MITM 0x1000 /* inbound Do man in the middle protection */
328#define BTM_SEC_OUT_MITM 0x2000 /* outbound Do man in the middle protection */
329
330/* Security Setting Mask */
331#define BTA_SEC_NONE BTM_SEC_NONE /* No security. */
332#define BTA_SEC_AUTHORIZE (BTM_SEC_IN_AUTHORIZE ) /* Authorization required (only needed for out going connection )*/
333#define BTA_SEC_AUTHENTICATE (BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */
334#define BTA_SEC_ENCRYPT (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */
335
337
338/* Pairable Modes */
339#define BTA_DM_PAIRABLE 1
340#define BTA_DM_NON_PAIRABLE 0
341
342/* Connectable Paired Only Mode */
343#define BTA_DM_CONN_ALL 0
344#define BTA_DM_CONN_PAIRED 1
345
346/* Inquiry modes
347 * Note: These modes are associated with the inquiry active values (BTM_*ACTIVE) */
348#define BTM_GENERAL_INQUIRY 0
349#define BTM_LIMITED_INQUIRY 1
350#define BTM_BR_INQUIRY_MASK 0x0f
351/* high byte of inquiry mode for BLE inquiry mode */
352#define BTM_BLE_INQUIRY_NONE 0x00
353#define BTM_BLE_GENERAL_INQUIRY 0x10
354#define BTM_BLE_LIMITED_INQUIRY 0x20
355#define BTM_BLE_INQUIRY_MASK (BTM_BLE_GENERAL_INQUIRY|BTM_BLE_LIMITED_INQUIRY)
356
357#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
358#define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
359#define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
361
362/* Inquiry Filter Type */
363#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
364#define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
365#define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
366
368
369/* Inquiry filter device class condition */
370typedef struct
371{
372 DEV_CLASS dev_class; /* device class of interest */
373 DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of interest */
375
376/* Inquiry Filter Condition */
377typedef union
378{
379 BD_ADDR bd_addr; /* BD address of device to filter. */
380 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */
382
383/* Inquiry Parameters */
384typedef struct
385{
386 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
387 UINT8 duration; /* Inquiry duration in 1.28 sec units. */
388 UINT8 max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
389 BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */
390 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
391 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
393
394/* Security Callback Events */
395#define BTA_DM_ENABLE_EVT 0 /* Enable Event */
396#define BTA_DM_DISABLE_EVT 1 /* Disable Event */
397#define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */
398#define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */
399#define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */
400#define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */
401#define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */
402#define BTA_DM_SIG_STRENGTH_EVT 7 /* Signal strength for bluetooth connection */
403#define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */
404#define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */
405#define BTA_DM_SP_CFM_REQ_EVT 10 /* Simple Pairing User Confirmation request. */
406#define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */
407#define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */
408#define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */
409#define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */
410#define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */
411#define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */
412#define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */
413#define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */
414#define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */
415#define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */
416#define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */
417// btla-specific ++
418#define BTA_DM_BLE_AUTH_CMPL_EVT 22 /* BLE Auth complete */
419// btla-specific --
420#define BTA_DM_DEV_UNPAIRED_EVT 23
421#define BTA_DM_HW_ERROR_EVT 24 /* BT Chip H/W error */
423
424/* Structure associated with BTA_DM_ENABLE_EVT */
425typedef struct
426{
427 BD_ADDR bd_addr; /* BD address of local device. */
430
431/* Structure associated with BTA_DM_PIN_REQ_EVT */
432typedef struct
433{
434 BD_ADDR bd_addr; /* BD address peer device. */
435 BD_NAME bd_name; /* Name of peer device. */
436 DEV_CLASS dev_class; /* Class of Device */
438
439/* Link Key Notification Event (Key Type) definitions */
440#define HCI_LKEY_TYPE_COMBINATION 0x00
441#define HCI_LKEY_TYPE_LOCAL_UNIT 0x01
442#define HCI_LKEY_TYPE_REMOTE_UNIT 0x02
443#define HCI_LKEY_TYPE_DEBUG_COMB 0x03
444#define HCI_LKEY_TYPE_UNAUTH_COMB 0x04
445#define HCI_LKEY_TYPE_AUTH_COMB 0x05
446#define HCI_LKEY_TYPE_CHANGED_COMB 0x06
447
448/* Structure associated with BTA_DM_AUTH_CMPL_EVT */
449typedef struct
450{
451 BD_ADDR bd_addr; /* BD address peer device. */
452 BD_NAME bd_name; /* Name of peer device. */
453 BOOLEAN key_present; /* Valid link key value in key element */
454 LINK_KEY key; /* Link key associated with peer device. */
455 UINT8 key_type; /* The type of Link Key */
456 BOOLEAN success; /* TRUE of authentication succeeded, FALSE if failed. */
457 UINT8 fail_reason; /* The HCI reason/error code for when success=FALSE */
459
460/* Structure associated with BTA_DM_AUTHORIZE_EVT */
461typedef struct
462{
463 BD_ADDR bd_addr; /* BD address peer device. */
464 BD_NAME bd_name; /* Name of peer device. */
465 tBTA_SERVICE_ID service; /* Service ID to authorize. */
466// btla-specific ++
468// btla-specific --
470
471/* Structure associated with BTA_DM_LINK_UP_EVT */
472typedef struct
473{
474 BD_ADDR bd_addr; /* BD address peer device. */
476
477/*
478** Defentions for HCI Error Codes that are past in the events
479*/
480#define HCI_SUCCESS 0x00
481#define HCI_PENDING 0x00
482#define HCI_ERR_ILLEGAL_COMMAND 0x01
483#define HCI_ERR_NO_CONNECTION 0x02
484#define HCI_ERR_HW_FAILURE 0x03
485#define HCI_ERR_PAGE_TIMEOUT 0x04
486#define HCI_ERR_AUTH_FAILURE 0x05
487#define HCI_ERR_KEY_MISSING 0x06
488#define HCI_ERR_MEMORY_FULL 0x07
489#define HCI_ERR_CONNECTION_TOUT 0x08
490#define HCI_ERR_MAX_NUM_OF_CONNECTIONS 0x09
491#define HCI_ERR_MAX_NUM_OF_SCOS 0x0A
492#define HCI_ERR_CONNECTION_EXISTS 0x0B
493#define HCI_ERR_COMMAND_DISALLOWED 0x0C
494#define HCI_ERR_HOST_REJECT_RESOURCES 0x0D
495#define HCI_ERR_HOST_REJECT_SECURITY 0x0E
496#define HCI_ERR_HOST_REJECT_DEVICE 0x0F
497#define HCI_ERR_HOST_TIMEOUT 0x10
498#define HCI_ERR_UNSUPPORTED_VALUE 0x11
499#define HCI_ERR_ILLEGAL_PARAMETER_FMT 0x12
500#define HCI_ERR_PEER_USER 0x13
501#define HCI_ERR_PEER_LOW_RESOURCES 0x14
502#define HCI_ERR_PEER_POWER_OFF 0x15
503#define HCI_ERR_CONN_CAUSE_LOCAL_HOST 0x16
504#define HCI_ERR_REPEATED_ATTEMPTS 0x17
505#define HCI_ERR_PAIRING_NOT_ALLOWED 0x18
506#define HCI_ERR_UNKNOWN_LMP_PDU 0x19
507#define HCI_ERR_UNSUPPORTED_REM_FEATURE 0x1A
508#define HCI_ERR_SCO_OFFSET_REJECTED 0x1B
509#define HCI_ERR_SCO_INTERVAL_REJECTED 0x1C
510#define HCI_ERR_SCO_AIR_MODE 0x1D
511#define HCI_ERR_INVALID_LMP_PARAM 0x1E
512#define HCI_ERR_UNSPECIFIED 0x1F
513#define HCI_ERR_UNSUPPORTED_LMP_FEATURE 0x20
514#define HCI_ERR_ROLE_CHANGE_NOT_ALLOWED 0x21
515#define HCI_ERR_LMP_RESPONSE_TIMEOUT 0x22
516#define HCI_ERR_LMP_ERR_TRANS_COLLISION 0x23
517#define HCI_ERR_LMP_PDU_NOT_ALLOWED 0x24
518#define HCI_ERR_ENCRY_MODE_NOT_ACCEPTABLE 0x25
519#define HCI_ERR_UNIT_KEY_USED 0x26
520#define HCI_ERR_QOS_NOT_SUPPORTED 0x27
521#define HCI_ERR_INSTANT_PASSED 0x28
522#define HCI_ERR_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 0x29
523#define HCI_ERR_DIFF_TRANSACTION_COLLISION 0x2A
524#define HCI_ERR_UNDEFINED_0x2B 0x2B
525#define HCI_ERR_QOS_UNACCEPTABLE_PARAM 0x2C
526#define HCI_ERR_QOS_REJECTED 0x2D
527#define HCI_ERR_CHAN_CLASSIF_NOT_SUPPORTED 0x2E
528#define HCI_ERR_INSUFFCIENT_SECURITY 0x2F
529#define HCI_ERR_PARAM_OUT_OF_RANGE 0x30
530#define HCI_ERR_UNDEFINED_0x31 0x31
531#define HCI_ERR_ROLE_SWITCH_PENDING 0x32
532#define HCI_ERR_UNDEFINED_0x33 0x33
533#define HCI_ERR_RESERVED_SLOT_VIOLATION 0x34
534#define HCI_ERR_ROLE_SWITCH_FAILED 0x35
535#define HCI_ERR_INQ_RSP_DATA_TOO_LARGE 0x36
536#define HCI_ERR_SIMPLE_PAIRING_NOT_SUPPORTED 0x37
537#define HCI_ERR_HOST_BUSY_PAIRING 0x38
538#define HCI_ERR_REJ_NO_SUITABLE_CHANNEL 0x39
539#define HCI_ERR_CONTROLLER_BUSY 0x3A
540#define HCI_ERR_UNACCEPT_CONN_INTERVAL 0x3B
541#define HCI_ERR_DIRECTED_ADVERTISING_TIMEOUT 0x3C
542#define HCI_ERR_CONN_TOUT_DUE_TO_MIC_FAILURE 0x3D
543#define HCI_ERR_CONN_FAILED_ESTABLISHMENT 0x3E
544#define HCI_ERR_MAC_CONNECTION_FAILED 0x3F
545
546#define HCI_ERR_MAX_ERR 0x40
547
548#define HCI_HINT_TO_RECREATE_AMP_PHYS_LINK 0xFF
549
550/* Structure associated with BTA_DM_LINK_DOWN_EVT */
551typedef struct
552{
553 BD_ADDR bd_addr; /* BD address peer device. */
554 UINT8 status; /* connection open/closed */
556
559
560/* signal strength mask */
561#define BTA_SIG_STRENGTH_RSSI_MASK 1
562#define BTA_SIG_STRENGTH_LINK_QUALITY_MASK 2
563
565
566/* Structure associated with BTA_DM_SIG_STRENGTH_EVT */
567typedef struct
568{
569 BD_ADDR bd_addr; /* BD address peer device. */
570 tBTA_SIG_STRENGTH_MASK mask; /* mask for the values that are valid */
573
575
576/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
577typedef struct
578{
579 UINT8 level; /* when paging or inquiring, level is 10.
580 Otherwise, the number of ACL links */
582
583// muff1n: only filled with used members
584typedef union
585{
586 tBTA_DM_ENABLE enable; /* BTA enabled */
587 tBTA_DM_PIN_REQ pin_req; /* PIN request */
588 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication */
589 tBTA_DM_AUTHORIZE authorize; /* Authorization request */
590 tBTA_DM_LINK_UP link_up; /* ACL connection up event */
591 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */
592 tBTA_DM_SIG_STRENGTH sig_strength; /* rssi and link quality value */
593 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */
595
596typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
597
598/* Search callback events */
600 BTA_DM_INQ_RES_EVT, /* Inquiry result for a peer device. */
601 BTA_DM_INQ_CMPL_EVT, /* Inquiry complete. */
602 BTA_DM_DISC_RES_EVT, /* Discovery result for a peer device. */
603#if SDK_AUG2010
604 BTA_DM_DISC_BLE_RES_EVT, /* Discovery result for BLE GATT based service on a peer device. */
605#endif
606 BTA_DM_DISC_CMPL_EVT, /* Discovery complete. */
607#if SDK_AUG2010
608 BTA_DM_DI_DISC_CMPL_EVT, /* Discovery complete. */
609#endif
610 BTA_DM_SEARCH_CANCEL_CMPL_EVT, /* Search cancelled */
611};
612
614
615#define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
616
617// muff1n: commented some fields out
618/* Structure associated with BTA_DM_INQ_RES_EVT */
619typedef struct
620{
621 BD_ADDR bd_addr; /* BD address peer device. */
622 DEV_CLASS dev_class; /* Device class of peer device. */
623 //BOOLEAN remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
624 /* If the device name is known to application BTA skips the remote name request */
625 //BOOLEAN is_limited; /* TRUE, if the limited inquiry bit is set in the CoD */
626 INT8 rssi; /* The rssi value */
627 UINT8 *p_eir; /* received EIR */
629
630/* Structure associated with BTA_DM_INQ_CMPL_EVT */
631typedef struct
632{
633 UINT8 num_resps; /* Number of inquiry responses. */
635
636/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
637typedef struct
638{
639 BD_ADDR bd_addr; /* BD address peer device. */
640 UINT8 num_record; /* Number of DI record */
643
644/* Structure associated with BTA_DM_DISC_RES_EVT */
645typedef struct
646{
647 BD_ADDR bd_addr; /* BD address peer device. */
648 BD_NAME bd_name; /* Name of peer device. */
649 tBTA_SERVICE_MASK services; /* Services found on peer device. */
650// btla-specific ++
651 UINT8 * p_raw_data; /* Raw data for discovery DB */
652 UINT32 raw_data_size; /* size of raw data */
653 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
656// btla-specific --
659
660/* Structure associated with tBTA_DM_DISC_BLE_RES */
661typedef struct
662{
663 BD_ADDR bd_addr; /* BD address peer device. */
664 BD_NAME bd_name; /* Name of peer device. */
665 tBT_UUID service; /* GATT based Services UUID found on peer device. */
667
668/* Union of all search callback structures */
669typedef union
670{
671 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */
672 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */
673 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */
674 tBTA_DM_DISC_BLE_RES disc_ble_res; /* discovery result for GATT based service */
675 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */
677
678/* Search callback */
680
681/* type of protocol mode */
682#define BTA_HH_PROTO_RPT_MODE (0x00)
683#define BTA_HH_PROTO_BOOT_MODE (0x01)
684#define BTA_HH_PROTO_UNKNOWN (0xff)
686
687/* BTA HID Host callback events */
688#define BTA_HH_ENABLE_EVT 0 /* HH enabled */
689#define BTA_HH_DISABLE_EVT 1 /* HH disabled */
690#define BTA_HH_OPEN_EVT 2 /* connection opened */
691#define BTA_HH_CLOSE_EVT 3 /* connection closed */
692#define BTA_HH_GET_RPT_EVT 4 /* BTA_HhGetReport callback */
693#define BTA_HH_SET_RPT_EVT 5 /* BTA_HhSetReport callback */
694#define BTA_HH_GET_PROTO_EVT 6 /* BTA_GetProtoMode callback */
695#define BTA_HH_SET_PROTO_EVT 7 /* BTA_HhSetProtoMode callback */
696#define BTA_HH_GET_IDLE_EVT 8 /* BTA_HhGetIdle comes callback */
697#define BTA_HH_SET_IDLE_EVT 9 /* BTA_HhSetIdle finish callback */
698#define BTA_HH_GET_DSCP_EVT 10 /* Get report descripotor */
699#define BTA_HH_ADD_DEV_EVT 11 /* Add Device callback */
700#define BTA_HH_RMV_DEV_EVT 12 /* remove device finished */
701#define BTA_HH_VC_UNPLUG_EVT 13 /* virtually unplugged */
702#define BTA_HH_UPDATE_UCD_EVT 14
703#define BTA_HH_API_ERR_EVT 15 /* API error is caught */
704
706
707enum
708{
710 BTA_HH_HS_HID_NOT_READY, /* handshake error : device not ready */
711 BTA_HH_HS_INVALID_RPT_ID, /* handshake error : invalid report ID */
712 BTA_HH_HS_TRANS_NOT_SPT, /* handshake error : transaction not spt */
713 BTA_HH_HS_INVALID_PARAM, /* handshake error : invalid paremter */
714 BTA_HH_HS_ERROR, /* handshake error : unspecified HS error */
715 BTA_HH_ERR, /* general BTA HH error */
716 BTA_HH_ERR_SDP, /* SDP error */
717 BTA_HH_ERR_PROTO, /* SET_Protocol error,
718 only used in BTA_HH_OPEN_EVT callback */
719 BTA_HH_ERR_DB_FULL, /* device database full error, used in
720 BTA_HH_OPEN_EVT/BTA_HH_ADD_DEV_EVT */
721 BTA_HH_ERR_TOD_UNSPT, /* type of device not supported */
722 BTA_HH_ERR_NO_RES, /* out of system resources */
723 BTA_HH_ERR_AUTH_FAILED, /* authentication fail */
727
728/* callback event data for BTA_HH_OPEN_EVT */
729typedef struct
730{
731 BD_ADDR bda; /* HID device bd address */
732 tBTA_HH_STATUS status; /* operation status */
733 UINT8 handle; /* device handle */
735
737
738/* callback event data */
739typedef struct
740{
741 tBTA_HH_STATUS status; /* operation status */
742 UINT8 handle; /* device handle */
744
745// muff1n: only filled with used members
746typedef union
747{
748 tBTA_HH_DEV_INFO dev_info; /* BTA_HH_ADD_DEV_EVT, BTA_HH_RMV_DEV_EVT */
749 tBTA_HH_CONN conn; /* BTA_HH_OPEN_EVT */
750 tBTA_HH_CBDATA dev_status; /* BTA_HH_CLOSE_EVT,
751 BTA_HH_SET_PROTO_EVT
752 BTA_HH_SET_RPT_EVT
753 BTA_HH_SET_IDLE_EVT */
754} tBTA_HH;
755
756/* BTA HH callback function */
757typedef void (tBTA_HH_CBACK) (tBTA_HH_EVT event, tBTA_HH *p_data);
758
759/* General callback function for notifying an application that a synchronous
760** BTM function is complete. The pointer contains the address of any returned data.
761*/
762typedef void (tBTM_CMPL_CB) (void *p1);
763/* Structure returned with local version information */
764
773
774/* Structure returned with Vendor Specific Command complete callback */
781
782#define BTM_VSC_CMPL_DATA_SIZE (BTM_MAX_VENDOR_SPECIFIC_LEN + sizeof(tBTM_VSC_CMPL))
783/* Callback function for when device status changes. Appl must poll for
784** what the new state is (BTM_IsDeviceUp). The event occurs whenever the stack
785** has detected that the controller status has changed. This asynchronous event
786** is enabled/disabled by calling BTM_RegisterForDeviceStatusNotif().
787*/
788enum
789{
795
797
798/* Callback function for when a vendor specific event occurs. The length and
799** array of returned parameter bytes are included. This asynchronous event
800** is enabled/disabled by calling BTM_RegisterForVSEvents().
801*/
802typedef void (tBTM_VS_EVT_CB) (UINT8 len, UINT8 *p);
803
804/* VSC callback function for notifying an application that a synchronous
805** BTM function is complete. The pointer contains the address of any returned data.
806*/
807typedef void (tBTM_VSC_CMPL_CB) (tBTM_VSC_CMPL *p1);
808
809/* Attributes mask values to be used in HID_HostAddDev API */
810#define HID_VIRTUAL_CABLE 0x0001
811#define HID_NORMALLY_CONNECTABLE 0x0002
812#define HID_RECONN_INIT 0x0004
813#define HID_SDP_DISABLE 0x0008
814#define HID_BATTERY_POWER 0x0010
815#define HID_REMOTE_WAKE 0x0020
816#define HID_SUP_TOUT_AVLBL 0x0040
817#define HID_SSR_MAX_LATENCY 0x0080
818#define HID_SSR_MIN_TOUT 0x0100
819
820#define HID_SEC_REQUIRED 0x8000
821
822#define BTA_HH_VIRTUAL_CABLE HID_VIRTUAL_CABLE
823#define BTA_HH_NORMALLY_CONNECTABLE HID_NORMALLY_CONNECTABLE
824#define BTA_HH_RECONN_INIT HID_RECONN_INIT
825#define BTA_HH_SDP_DISABLE HID_SDP_DISABLE
826#define BTA_HH_BATTERY_POWER HID_BATTERY_POWER
827#define BTA_HH_REMOTE_WAKE HID_REMOTE_WAKE
828#define BTA_HH_SUP_TOUT_AVLBL HID_SUP_TOUT_AVLBL
829#define BTA_HH_SEC_REQUIRED HID_SEC_REQUIRED
831
837
839
840/* Policy settings status */
841#define HCI_DISABLE_ALL_LM_MODES 0x0000
842#define HCI_ENABLE_MASTER_SLAVE_SWITCH 0x0001
843#define HCI_ENABLE_HOLD_MODE 0x0002
844#define HCI_ENABLE_SNIFF_MODE 0x0004
845#define HCI_ENABLE_PARK_MODE 0x0008
846
847/* HCI mode defenitions */
848#define HCI_MODE_ACTIVE 0x00
849#define HCI_MODE_HOLD 0x01
850#define HCI_MODE_SNIFF 0x02
851#define HCI_MODE_PARK 0x03
852
853/* BTM Power manager status codes */
854enum
855{
856 BTM_PM_STS_ACTIVE = HCI_MODE_ACTIVE,
857 BTM_PM_STS_HOLD = HCI_MODE_HOLD,
858 BTM_PM_STS_SNIFF = HCI_MODE_SNIFF,
859 BTM_PM_STS_PARK = HCI_MODE_PARK,
860 BTM_PM_STS_SSR, /* report the SSR parameters in HCI_SNIFF_SUB_RATE_EVT */
861 BTM_PM_STS_PENDING, /* when waiting for status from controller */
862 BTM_PM_STS_ERROR /* when HCI command status returns error */
865
866/* BTM Power manager modes */
867
868enum
869{
874 BTM_PM_MD_FORCE = 0x10 /* OR this to force ACL link to a certain mode */
877
878#define BTM_PM_SET_ONLY_ID 0x80
879
880/* Operation codes */
881#define BTM_PM_REG_SET 1 /* The module wants to set the desired power mode */
882#define BTM_PM_REG_NOTIF 2 /* The module wants to receive mode change event */
883#define BTM_PM_DEREG 4 /* The module does not want to involve with PM anymore */
884
893
894/*************************************
895** Power Manager Callback Functions
896**************************************/
898 UINT16 value, UINT8 hci_status);
899
900/************************
901** Stored Linkkey Types
902*************************/
903#define BTM_CB_EVT_RETURN_LINK_KEYS 1
904#define BTM_CB_EVT_READ_STORED_LINK_KEYS 2
905#define BTM_CB_EVT_WRITE_STORED_LINK_KEYS 3
906#define BTM_CB_EVT_DELETE_STORED_LINK_KEYS 4
907
908typedef struct
909{
911
913
914
921
922
929
930
939
940
948
949
957
958// ---
959
962
963// muff1n: most changed prototype so far
965 tBTA_SERVICE_MASK trusted_mask, BOOLEAN is_trusted);
969void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len, UINT8 *p_pin);
971void BTA_DmSetDeviceName(char *p_name);
972
973// muff1n: disc_mode and conn_mode might be the , based on usage
975
976// muff1n: ucd_enabled might be the missing parameter
977void BTA_HhEnable(tBTA_SEC sec_mask, tBTA_HH_CBACK *p_cback);
978// muff1n: possibly takes just a tBTA_HH_DEV_DESCR in this version? i wrote it like that
979void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, UINT8 sub_class,
980 UINT8 app_id, tBTA_HH_DEV_DESCR descr);
981void BTA_HhRemoveDev(UINT8 dev_handle);
983void BTA_HhClose(UINT8 dev_handle);
984
985// muff1n: dev_bda is likely the missing parameter, as it is not used
986void BTA_HhSendData(UINT8 dev_handle, BT_HDR *p_data);
987
989
991
993
996 BD_ADDR *bd_addr,
997 LINK_KEY *link_key,
998 tBTM_CMPL_CB *p_cb);
1000
1003
1005 UINT8 *p_param_buf, tBTM_VSC_CMPL_CB *p_cb);
1006
1009
1011
1012// muff1n: is_register is probably the missing parameter here
1015
1020
1022 BD_FEATURES features, UINT32 trusted_mask[],
1023 LINK_KEY link_key);
1024
1026
1028
1030
1031/* muff1n: not in bluedroid source; might be older removed API functions */
1034void BTA_Init(void);
1035void BTA_CleanUp(void (*p_cb)(tBTA_STATUS status)); // probably
1036
1037#endif // CONTEXT_BTE_H
tBTM_STATUS btm_remove_acl(BD_ADDR bd_addr)
int8_t INT8
Definition bte.h:58
tBTM_STATUS BTM_VendorSpecificCommand(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf, tBTM_VSC_CMPL_CB *p_cb)
tBTM_STATUS BTM_PmRegister(UINT8 mask, UINT8 *p_pm_id, tBTM_PM_STATUS_CBACK *p_cb)
unsigned char BOOLEAN
Definition bte.h:60
void tBTM_PM_STATUS_CBACK(BD_ADDR p_bda, tBTM_PM_STATUS status, UINT16 value, UINT8 hci_status)
Definition bte.h:897
void BTA_CleanUp(void(*p_cb)(tBTA_STATUS status))
UINT16 tBTA_HH_EVT
Definition bte.h:705
UINT8 tBT_DEVICE_TYPE
Definition bte.h:96
void tBTM_VS_EVT_CB(UINT8 len, UINT8 *p)
Definition bte.h:802
UINT8 tBTA_SEC
Definition bte.h:336
UINT8 tBTA_DM_LINK_QUALITY_VALUE
Definition bte.h:558
UINT16 tBTA_HH_ATTR_MASK
Definition bte.h:830
void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len, UINT8 *p_pin)
void tBTA_DM_SEC_CBACK(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data)
Definition bte.h:596
UINT8 BD_FEATURES[BD_FEATURES_LEN]
Definition bte.h:91
tBTM_STATUS BTM_EnableTestMode(void)
UINT8 tBTA_SERVICE_ID
Definition bte.h:173
tBTM_STATUS BTM_SetDeviceClass(DEV_CLASS dev_class)
tBTM_STATUS BTM_WriteStoredLinkKey(UINT8 num_keys, BD_ADDR *bd_addr, LINK_KEY *link_key, tBTM_CMPL_CB *p_cb)
void BTA_DmSetDeviceName(char *p_name)
tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback)
@ BTA_HH_HS_HID_NOT_READY
Definition bte.h:710
@ BTA_HH_OK
Definition bte.h:709
@ BTA_HH_HS_TRANS_NOT_SPT
Definition bte.h:712
@ BTA_HH_ERR_DB_FULL
Definition bte.h:719
@ BTA_HH_HS_INVALID_RPT_ID
Definition bte.h:711
@ BTA_HH_ERR_TOD_UNSPT
Definition bte.h:721
@ BTA_HH_HS_INVALID_PARAM
Definition bte.h:713
@ BTA_HH_ERR
Definition bte.h:715
@ BTA_HH_ERR_SDP
Definition bte.h:716
@ BTA_HH_ERR_AUTH_FAILED
Definition bte.h:723
@ BTA_HH_HS_ERROR
Definition bte.h:714
@ BTA_HH_ERR_HDL
Definition bte.h:724
@ BTA_HH_ERR_PROTO
Definition bte.h:717
@ BTA_HH_ERR_NO_RES
Definition bte.h:722
@ BTM_SUCCESS
Definition bte.h:278
@ BTM_FAILED_ON_SECURITY
Definition bte.h:296
@ BTM_SUCCESS_NO_SECURITY
Definition bte.h:295
@ BTM_DEV_RESET
Definition bte.h:290
@ BTM_DEVICE_TIMEOUT
Definition bte.h:286
@ BTM_NOT_AUTHORIZED
Definition bte.h:289
@ BTM_CMD_STORED
Definition bte.h:291
@ BTM_BAD_VALUE_RET
Definition bte.h:287
@ BTM_ILLEGAL_VALUE
Definition bte.h:283
@ BTM_REPEATED_ATTEMPTS
Definition bte.h:297
@ BTM_ILLEGAL_ACTION
Definition bte.h:292
@ BTM_WRONG_MODE
Definition bte.h:284
@ BTM_DELAY_CHECK
Definition bte.h:293
@ BTM_BUSY
Definition bte.h:280
@ BTM_ERR_PROCESSING
Definition bte.h:288
@ BTM_SCO_BAD_LENGTH
Definition bte.h:294
@ BTM_MODE_UNSUPPORTED
Definition bte.h:282
@ BTM_NO_RESOURCES
Definition bte.h:281
@ BTM_UNKNOWN_ADDR
Definition bte.h:285
@ BTM_CMD_STARTED
Definition bte.h:279
void * GKI_getbuf(UINT16 size)
void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, UINT8 sub_class, UINT8 app_id, tBTA_HH_DEV_DESCR descr)
UINT8 tBTA_DM_SEARCH_EVT
Definition bte.h:613
BOOLEAN BTA_DmIsDeviceUp(void)
void BTA_HhGetAclQueueInfo(void)
void BTA_HhOpen(BD_ADDR dev_bda, tBTA_HH_PROTO_MODE mode, tBTA_SEC sec_mask)
tBTM_STATUS BTM_ReadLocalVersion(tBTM_VERSION_INFO *p_vers)
UINT8 tBTA_STATUS
Definition bte.h:125
UINT8 tBTM_STATUS
Definition bte.h:299
UINT8 tBTM_DEV_STATUS
Definition bte.h:794
void BTA_Init(void)
UINT8 tBTA_HH_STATUS
Definition bte.h:726
@ BTM_PM_MD_FORCE
Definition bte.h:874
@ BTM_PM_MD_HOLD
Definition bte.h:871
@ BTM_PM_MD_ACTIVE
Definition bte.h:870
@ BTM_PM_MD_SNIFF
Definition bte.h:872
@ BTM_PM_MD_PARK
Definition bte.h:873
void BTA_DmSetVisibility(UINT8, UINT8)
tBTM_STATUS BTM_WritePageTimeout(UINT16 timeout)
void BTA_HhRemoveDev(UINT8 dev_handle)
BOOLEAN BTM_SecAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, BD_FEATURES features, UINT32 trusted_mask[], LINK_KEY link_key)
tBTM_STATUS BTM_SetAfhChannels(UINT8 first, UINT8 last)
void BTM_SetDefaultLinkPolicy(UINT16 settings)
tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr)
UINT8 * DEV_CLASS_PTR
Definition bte.h:77
void BTA_HhSendData(UINT8 dev_handle, BT_HDR *p_data)
UINT8 * BD_ADDR_PTR
Definition bte.h:70
void tBTA_DM_SEARCH_CBACK(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data)
Definition bte.h:679
tBTA_STATUS BTA_DisableBluetooth(void)
void tBTM_DEV_STATUS_CB(tBTM_DEV_STATUS status)
Definition bte.h:796
INT8 tBTA_DM_RSSI_VALUE
Definition bte.h:557
void BTA_DmSendHciReset(void)
UINT8 * BD_NAME_PTR
Definition bte.h:88
UINT8 tBTA_SYS_ID
Definition bte.h:274
void BTM_DeviceReset(tBTM_CMPL_CB *p_cb)
UINT8 BD_ADDR[BD_ADDR_LEN]
Definition bte.h:69
UINT8 tBTM_PM_STATUS
Definition bte.h:864
void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services, tBTA_DM_SEARCH_CBACK *p_cback)
UINT8 LINK_KEY[LINK_KEY_LEN]
Definition bte.h:73
void BTA_HhEnable(tBTA_SEC sec_mask, tBTA_HH_CBACK *p_cback)
tBTM_STATUS BTM_RegisterForVSEvents(tBTM_VS_EVT_CB *p_cb)
UINT8 tBTA_HH_PROTO_MODE
Definition bte.h:685
BTA_DM_State_e
Definition bte.h:599
@ BTA_DM_DISC_BLE_RES_EVT
Definition bte.h:604
@ BTA_DM_DI_DISC_CMPL_EVT
Definition bte.h:608
@ BTA_DM_INQ_RES_EVT
Definition bte.h:600
@ BTA_DM_DISC_CMPL_EVT
Definition bte.h:606
@ BTA_DM_DISC_RES_EVT
Definition bte.h:602
@ BTA_DM_SEARCH_CANCEL_CMPL_EVT
Definition bte.h:610
@ BTA_DM_INQ_CMPL_EVT
Definition bte.h:601
UINT8 SDP_SetTraceLevel(UINT8 new_level)
tBTM_STATUS BTM_DeleteStoredLinkKey(BD_ADDR bd_addr, tBTM_CMPL_CB *p_cb)
tBTA_STATUS BTA_DmAddDevice(BD_ADDR bd_addr, LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask, BOOLEAN is_trusted)
UINT8 tBTM_PM_MODE
Definition bte.h:876
void tBTM_VSC_CMPL_CB(tBTM_VSC_CMPL *p1)
Definition bte.h:807
UINT8 tBTA_DM_INQ_MODE
Definition bte.h:360
tBTM_DEV_STATUS_CB * BTM_RegisterForDeviceStatusNotif(tBTM_DEV_STATUS_CB *p_cb)
@ BTM_PM_STS_ACTIVE
Definition bte.h:856
@ BTM_PM_STS_ERROR
Definition bte.h:862
@ BTM_PM_STS_PENDING
Definition bte.h:861
@ BTM_PM_STS_SNIFF
Definition bte.h:858
@ BTM_PM_STS_PARK
Definition bte.h:859
@ BTM_PM_STS_SSR
Definition bte.h:860
@ BTM_PM_STS_HOLD
Definition bte.h:857
tBTM_STATUS BTM_ReadStoredLinkKey(BD_ADDR bd_addr, tBTM_CMPL_CB *p_cb)
@ BTM_DEV_STATUS_DOWN
Definition bte.h:791
@ BTM_DEV_STATUS_UP
Definition bte.h:790
@ BTM_DEV_STATUS_CMD_TOUT
Definition bte.h:792
UINT8 BD_NAME[BD_NAME_LEN]
Definition bte.h:87
tHID_DEV_DSCP_INFO tBTA_HH_DEV_DESCR
Definition bte.h:838
uint16_t UINT16
Definition bte.h:55
void BTM_SetDefaultLinkSuperTout(UINT16 timeout)
void BTA_DmSearchCancel(void)
UINT8 L2CA_SetTraceLevel(UINT8 trace_level)
void tBTM_CMPL_CB(void *p1)
Definition bte.h:762
uint32_t UINT32
Definition bte.h:56
UINT8 tBTA_SIG_STRENGTH_MASK
Definition bte.h:564
void tBTA_HH_CBACK(tBTA_HH_EVT event, tBTA_HH *p_data)
Definition bte.h:757
UINT8 tBTA_DM_INQ_FILT
Definition bte.h:367
UINT8 DEV_CLASS[DEV_CLASS_LEN]
Definition bte.h:76
void BTA_HhClose(UINT8 dev_handle)
uint8_t UINT8
Definition bte.h:54
tBTA_HH_CONN tBTA_HH_DEV_INFO
Definition bte.h:736
struct desc_info tHID_DEV_DSCP_INFO
void bta_sys_set_trace_level(UINT8 level)
UINT32 tBTA_SERVICE_MASK
Definition bte.h:212
UINT8 tBTA_DM_SEC_EVT
Definition bte.h:422
tBTM_STATUS BTM_SetPowerMode(UINT8 pm_id, BD_ADDR remote_bda, tBTM_PM_PWR_MD *p_mode)
u32 mode
Definition GXTev.c:56
unsigned int size
Definition __os.h:106
p
Definition e_acos.c:103
static u32 status
Definition fstload.c:9
Definition bte.h:302
UINT16 layer_specific
Definition bte.h:306
UINT16 event
Definition bte.h:303
UINT16 offset
Definition bte.h:305
UINT16 len
Definition bte.h:304
Definition bte.h:833
UINT8 * dsc_list
Definition bte.h:835
UINT16 dl_len
Definition bte.h:834
Definition bte.h:462
DEV_CLASS dev_class
Definition bte.h:467
tBTA_SERVICE_ID service
Definition bte.h:465
BD_NAME bd_name
Definition bte.h:464
BD_ADDR bd_addr
Definition bte.h:463
Definition bte.h:450
UINT8 fail_reason
Definition bte.h:457
UINT8 key_type
Definition bte.h:455
BD_ADDR bd_addr
Definition bte.h:451
LINK_KEY key
Definition bte.h:454
BOOLEAN key_present
Definition bte.h:453
BD_NAME bd_name
Definition bte.h:452
BOOLEAN success
Definition bte.h:456
Definition bte.h:578
UINT8 level
Definition bte.h:579
Definition bte.h:371
DEV_CLASS dev_class_mask
Definition bte.h:373
DEV_CLASS dev_class
Definition bte.h:372
Definition bte.h:662
BD_NAME bd_name
Definition bte.h:664
tBT_UUID service
Definition bte.h:665
BD_ADDR bd_addr
Definition bte.h:663
Definition bte.h:646
UINT8 * p_uuid_list
Definition bte.h:655
tBTA_SERVICE_MASK services
Definition bte.h:649
UINT32 raw_data_size
Definition bte.h:652
tBT_DEVICE_TYPE device_type
Definition bte.h:653
BD_NAME bd_name
Definition bte.h:648
UINT8 * p_raw_data
Definition bte.h:651
BD_ADDR bd_addr
Definition bte.h:647
UINT32 num_uuids
Definition bte.h:654
tBTA_STATUS result
Definition bte.h:657
Definition bte.h:638
BD_ADDR bd_addr
Definition bte.h:639
tBTA_STATUS result
Definition bte.h:641
UINT8 num_record
Definition bte.h:640
Definition bte.h:426
tBTA_STATUS status
Definition bte.h:428
BD_ADDR bd_addr
Definition bte.h:427
Definition bte.h:632
UINT8 num_resps
Definition bte.h:633
Definition bte.h:620
INT8 rssi
Definition bte.h:626
UINT8 * p_eir
Definition bte.h:627
BD_ADDR bd_addr
Definition bte.h:621
DEV_CLASS dev_class
Definition bte.h:622
Definition bte.h:385
UINT8 max_resps
Definition bte.h:388
BOOLEAN report_dup
Definition bte.h:389
UINT8 duration
Definition bte.h:387
tBTA_DM_INQ_FILT filter_type
Definition bte.h:390
tBTA_DM_INQ_MODE mode
Definition bte.h:386
tBTA_DM_INQ_COND filter_cond
Definition bte.h:391
Definition bte.h:433
BD_ADDR bd_addr
Definition bte.h:434
DEV_CLASS dev_class
Definition bte.h:436
BD_NAME bd_name
Definition bte.h:435
Definition bte.h:568
tBTA_SIG_STRENGTH_MASK mask
Definition bte.h:570
tBTA_DM_RSSI_VALUE rssi_value
Definition bte.h:571
BD_ADDR bd_addr
Definition bte.h:569
tBTA_DM_LINK_QUALITY_VALUE link_quality_value
Definition bte.h:572
Definition bte.h:740
UINT8 handle
Definition bte.h:742
tBTA_HH_STATUS status
Definition bte.h:741
Definition bte.h:730
BD_ADDR bda
Definition bte.h:731
UINT8 handle
Definition bte.h:733
tBTA_HH_STATUS status
Definition bte.h:732
Definition bte.h:886
tBTM_PM_MODE mode
Definition bte.h:891
UINT16 min
Definition bte.h:888
UINT16 timeout
Definition bte.h:890
UINT16 max
Definition bte.h:887
UINT16 attempt
Definition bte.h:889
Definition bte.h:766
UINT8 lmp_version
Definition bte.h:769
UINT16 hci_revision
Definition bte.h:768
UINT8 hci_version
Definition bte.h:767
UINT16 manufacturer
Definition bte.h:770
UINT16 lmp_subversion
Definition bte.h:771
Definition bte.h:776
UINT16 opcode
Definition bte.h:777
UINT8 * p_param_buf
Definition bte.h:779
UINT16 param_len
Definition bte.h:778
Definition bte.h:101
UINT32 uuid32
Definition bte.h:111
UINT16 uuid16
Definition bte.h:110
UINT16 len
Definition bte.h:106
Definition bte.h:378
tBTA_DM_COD_COND dev_class_cond
Definition bte.h:380
BD_ADDR bd_addr
Definition bte.h:379
Definition bte.h:670
tBTA_DM_DISC_RES disc_res
Definition bte.h:673
tBTA_DM_INQ_CMPL inq_cmpl
Definition bte.h:672
tBTA_DM_DI_DISC_CMPL di_disc
Definition bte.h:675
tBTA_DM_DISC_BLE_RES disc_ble_res
Definition bte.h:674
tBTA_DM_INQ_RES inq_res
Definition bte.h:671
Definition bte.h:585
tBTA_DM_BUSY_LEVEL busy_level
Definition bte.h:593
tBTA_DM_LINK_DOWN link_down
Definition bte.h:591
tBTA_DM_SIG_STRENGTH sig_strength
Definition bte.h:592
tBTA_DM_PIN_REQ pin_req
Definition bte.h:587
tBTA_DM_LINK_UP link_up
Definition bte.h:590
tBTA_DM_AUTH_CMPL auth_cmpl
Definition bte.h:588
tBTA_DM_AUTHORIZE authorize
Definition bte.h:589
tBTA_DM_ENABLE enable
Definition bte.h:586
Definition bte.h:747
tBTA_HH_DEV_INFO dev_info
Definition bte.h:748
tBTA_HH_CBDATA dev_status
Definition bte.h:750
tBTA_HH_CONN conn
Definition bte.h:749