1 /****************************************************************************** 2 * 3 * Copyright (C) 2003-2014 Broadcom Corporation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ******************************************************************************/ 18 19 /****************************************************************************** 20 * 21 * This is the public interface file for BTA, Broadcom's Bluetooth 22 * application layer for mobile phones. 23 * 24 ******************************************************************************/ 25 #ifndef BTA_API_H 26 #define BTA_API_H 27 28 #include "common/bt_target.h" 29 #include "stack/bt_types.h" 30 #include "stack/btm_api.h" 31 // #include "uipc_msg.h" 32 #include "stack/sdp_api.h" 33 34 // #if BLE_INCLUDED == TRUE 35 #include "stack/btm_ble_api.h" 36 // #endif 37 38 /***************************************************************************** 39 ** Constants and data types 40 *****************************************************************************/ 41 42 /* Status Return Value */ 43 #define BTA_SUCCESS 0 /* Successful operation. */ 44 #define BTA_FAILURE 1 /* Generic failure. */ 45 #define BTA_PENDING 2 /* API cannot be completed right now */ 46 #define BTA_BUSY 3 47 #define BTA_NO_RESOURCES 4 48 #define BTA_WRONG_MODE 5 49 #define BTA_EIR_TOO_LARGE 6 50 51 typedef UINT8 tBTA_STATUS; 52 53 /* 54 * Service ID 55 * 56 * NOTES: When you add a new Service ID for BTA AND require to change the value of BTA_MAX_SERVICE_ID, 57 * make sure that the correct security ID of the new service from Security service definitions (stack/btm_api.h) 58 * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in bta_dm_act.c. 59 */ 60 61 #define BTA_RES_SERVICE_ID 0 /* Reserved */ 62 #define BTA_SPP_SERVICE_ID 1 /* Serial port profile. */ 63 #define BTA_DUN_SERVICE_ID 2 /* Dial-up networking profile. */ 64 #define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */ 65 #define BTA_LAP_SERVICE_ID 4 /* LAN access profile. */ 66 #define BTA_HSP_SERVICE_ID 5 /* Headset profile. */ 67 #define BTA_HFP_SERVICE_ID 6 /* Hands-free profile. */ 68 #define BTA_OPP_SERVICE_ID 7 /* Object push */ 69 #define BTA_FTP_SERVICE_ID 8 /* File transfer */ 70 #define BTA_CTP_SERVICE_ID 9 /* Cordless Terminal */ 71 #define BTA_ICP_SERVICE_ID 10 /* Intercom Terminal */ 72 #define BTA_SYNC_SERVICE_ID 11 /* Synchronization */ 73 #define BTA_BPP_SERVICE_ID 12 /* Basic printing profile */ 74 #define BTA_BIP_SERVICE_ID 13 /* Basic Imaging profile */ 75 #define BTA_PANU_SERVICE_ID 14 /* PAN User */ 76 #define BTA_NAP_SERVICE_ID 15 /* PAN Network access point */ 77 #define BTA_GN_SERVICE_ID 16 /* PAN Group Ad-hoc networks */ 78 #define BTA_SAP_SERVICE_ID 17 /* SIM Access profile */ 79 #define BTA_A2DP_SINK_SERVICE_ID 18 /* A2DP Sink */ 80 #define BTA_AVRCP_SERVICE_ID 19 /* A/V remote control */ 81 #define BTA_HID_SERVICE_ID 20 /* HID Host*/ 82 #define BTA_VDP_SERVICE_ID 21 /* Video distribution */ 83 #define BTA_PBAP_SERVICE_ID 22 /* PhoneBook Access Server*/ 84 #define BTA_HSP_HS_SERVICE_ID 23 /* HFP HS role */ 85 #define BTA_HFP_HS_SERVICE_ID 24 /* HSP HS role */ 86 #define BTA_MAP_SERVICE_ID 25 /* Message Access Profile */ 87 #define BTA_MN_SERVICE_ID 26 /* Message Notification Service */ 88 #define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */ 89 #define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/ 90 #define BTA_SDP_SERVICE_ID 29 /* SDP Search*/ 91 #if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE 92 /* BLE profile service ID */ 93 #define BTA_BLE_SERVICE_ID 30 /* GATT profile */ 94 95 // btla-specific ++ 96 #define BTA_USER_SERVICE_ID 31 /* User requested UUID */ 97 98 #define BTA_MAX_SERVICE_ID 32 99 // btla-specific -- 100 #else 101 #define BTA_USER_SERVICE_ID 30 /* User requested UUID */ 102 #define BTA_MAX_SERVICE_ID 31 103 #endif 104 /* service IDs (BTM_SEC_SERVICE_FIRST_EMPTY + 1) to (BTM_SEC_MAX_SERVICES - 1) 105 * are used by BTA JV */ 106 #define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1) 107 #define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1) 108 109 typedef UINT8 tBTA_SERVICE_ID; 110 111 /* Service ID Mask */ 112 #define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */ 113 #define BTA_SPP_SERVICE_MASK 0x00000002 /* Serial port profile. */ 114 #define BTA_DUN_SERVICE_MASK 0x00000004 /* Dial-up networking profile. */ 115 #define BTA_FAX_SERVICE_MASK 0x00000008 /* Fax profile. */ 116 #define BTA_LAP_SERVICE_MASK 0x00000010 /* LAN access profile. */ 117 #define BTA_HSP_SERVICE_MASK 0x00000020 /* HSP AG role. */ 118 #define BTA_HFP_SERVICE_MASK 0x00000040 /* HFP AG role */ 119 #define BTA_OPP_SERVICE_MASK 0x00000080 /* Object push */ 120 #define BTA_FTP_SERVICE_MASK 0x00000100 /* File transfer */ 121 #define BTA_CTP_SERVICE_MASK 0x00000200 /* Cordless Terminal */ 122 #define BTA_ICP_SERVICE_MASK 0x00000400 /* Intercom Terminal */ 123 #define BTA_SYNC_SERVICE_MASK 0x00000800 /* Synchronization */ 124 #define BTA_BPP_SERVICE_MASK 0x00001000 /* Print server */ 125 #define BTA_BIP_SERVICE_MASK 0x00002000 /* Basic Imaging */ 126 #define BTA_PANU_SERVICE_MASK 0x00004000 /* PAN User */ 127 #define BTA_NAP_SERVICE_MASK 0x00008000 /* PAN Network access point */ 128 #define BTA_GN_SERVICE_MASK 0x00010000 /* PAN Group Ad-hoc networks */ 129 #define BTA_SAP_SERVICE_MASK 0x00020000 /* PAN Group Ad-hoc networks */ 130 #define BTA_A2DP_SERVICE_MASK 0x00040000 /* Advanced audio distribution */ 131 #define BTA_AVRCP_SERVICE_MASK 0x00080000 /* A/V remote control */ 132 #define BTA_HID_SERVICE_MASK 0x00100000 /* HID */ 133 #define BTA_VDP_SERVICE_MASK 0x00200000 /* Video distribution */ 134 #define BTA_PBAP_SERVICE_MASK 0x00400000 /* Phone Book Server */ 135 #define BTA_HSP_HS_SERVICE_MASK 0x00800000 /* HFP HS role */ 136 #define BTA_HFP_HS_SERVICE_MASK 0x01000000 /* HSP HS role */ 137 #define BTA_MAS_SERVICE_MASK 0x02000000 /* Message Access Profile */ 138 #define BTA_MN_SERVICE_MASK 0x04000000 /* Message Notification Profile */ 139 #define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */ 140 #define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */ 141 142 #if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE 143 #define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */ 144 // btla-specific ++ 145 #define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */ 146 // btla-specific -- 147 #else 148 // btla-specific ++ 149 #define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */ 150 // btla-specific -- 151 #endif 152 153 #if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE 154 #define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */ 155 #else 156 #define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */ 157 #endif 158 159 typedef UINT32 tBTA_SERVICE_MASK; 160 161 /* extended service mask, including mask with one or more GATT UUID */ 162 typedef struct { 163 tBTA_SERVICE_MASK srvc_mask; 164 UINT8 num_uuid; 165 tBT_UUID *p_uuid; 166 } tBTA_SERVICE_MASK_EXT; 167 168 /* Security Setting Mask */ 169 #define BTA_SEC_NONE BTM_SEC_NONE /* No security. */ 170 #define BTA_SEC_AUTHORIZE (BTM_SEC_IN_AUTHORIZE ) /* Authorization required (only needed for out going connection )*/ 171 #define BTA_SEC_AUTHENTICATE (BTM_SEC_IN_AUTHENTICATE | BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */ 172 #define BTA_SEC_ENCRYPT (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */ 173 #define BTA_SEC_MODE4_LEVEL4 (BTM_SEC_MODE4_LEVEL4) /* Mode 4 level 4 service, i.e. incoming/outgoing MITM and P-256 encryption */ 174 #define BTA_SEC_MITM (BTM_SEC_IN_MITM | BTM_SEC_OUT_MITM) /* Man-In-The_Middle protection */ 175 #define BTA_SEC_IN_16_DIGITS (BTM_SEC_IN_MIN_16_DIGIT_PIN) /* Min 16 digit for pin code */ 176 177 typedef UINT16 tBTA_SEC; 178 179 typedef tBTM_GET_DEV_NAME_CBACK tBTA_GET_DEV_NAME_CBACK; 180 181 /* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */ 182 #define BTA_DM_IGNORE 0x00FF 183 184 /* Ignore for Discoverable, Connectable only for LE modes */ 185 #define BTA_DM_LE_IGNORE 0xFF00 186 187 #define BTA_APP_ID_1 1 /* PM example profile 1 */ 188 #define BTA_APP_ID_PAN_MULTI 0xFE /* app id for pan multiple connection */ 189 #define BTA_ALL_APP_ID 0xFF 190 191 /* Discoverable Modes */ 192 #define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */ 193 #define BTA_DM_GENERAL_DISC BTM_GENERAL_DISCOVERABLE /* General discoverable. */ 194 #define BTA_DM_LIMITED_DISC BTM_LIMITED_DISCOVERABLE /* Limited discoverable. */ 195 #if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) 196 #define BTA_DM_BLE_NON_DISCOVERABLE BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */ 197 #define BTA_DM_BLE_GENERAL_DISCOVERABLE BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */ 198 #define BTA_DM_BLE_LIMITED_DISCOVERABLE BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */ 199 #endif 200 typedef UINT16 tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and LE mode */ 201 202 /* Connectable Modes */ 203 #define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */ 204 #define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */ 205 #if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) 206 #define BTA_DM_BLE_NON_CONNECTABLE BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */ 207 #define BTA_DM_BLE_CONNECTABLE BTM_BLE_CONNECTABLE /* Device is LE connectable. */ 208 #endif 209 210 // btla-specific ++ 211 typedef UINT16 tBTA_DM_CONN; 212 213 #define BTA_TRANSPORT_UNKNOWN 0 214 #define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR 215 #define BTA_TRANSPORT_LE BT_TRANSPORT_LE 216 typedef tBT_TRANSPORT tBTA_TRANSPORT; 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_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */ 228 #define BTA_DM_GENERAL_INQUIRY BTM_GENERAL_INQUIRY /* Perform general inquiry. */ 229 #define BTA_DM_LIMITED_INQUIRY BTM_LIMITED_INQUIRY /* Perform limited inquiry. */ 230 231 #if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) 232 #define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE 233 #define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */ 234 #define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */ 235 #endif 236 typedef UINT8 tBTA_DM_INQ_MODE; 237 238 /* Inquiry Filter Type */ 239 #define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */ 240 #define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */ 241 #define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */ 242 243 typedef UINT8 tBTA_DM_INQ_FILT; 244 245 /* Authorize Response */ 246 #define BTA_DM_AUTH_PERM 0 /* Authorized for future connections to the service */ 247 #define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */ 248 #define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */ 249 250 typedef UINT8 tBTA_AUTH_RESP; 251 252 /* M/S preferred roles */ 253 #define BTA_ANY_ROLE 0x00 254 #define BTA_MASTER_ROLE_PREF 0x01 255 #define BTA_MASTER_ROLE_ONLY 0x02 256 #define BTA_SLAVE_ROLE_ONLY 0x03 /* Used for PANU only, skip role switch to master */ 257 258 typedef UINT8 tBTA_PREF_ROLES; 259 260 enum { 261 262 BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might 263 support "role switch during connection" for 264 an incoming connection, when it already has 265 another connection in master role */ 266 BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have 267 simulateous connection in Master and Slave roles 268 for short period of time */ 269 BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master 270 and slave roles */ 271 272 }; 273 274 275 /* Inquiry filter device class condition */ 276 typedef struct { 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 */ 279 } tBTA_DM_COD_COND; 280 281 282 /* Inquiry Filter Condition */ 283 typedef union { 284 BD_ADDR bd_addr; /* BD address of device to filter. */ 285 tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */ 286 } tBTA_DM_INQ_COND; 287 288 /* Inquiry Parameters */ 289 typedef struct { 290 tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */ 291 UINT8 duration; /* Inquiry duration in 1.28 sec units. */ 292 UINT8 max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */ 293 BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */ 294 tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */ 295 tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */ 296 #if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE) 297 UINT8 intl_duration[4];/*duration array storing the interleave scan's time portions*/ 298 #endif 299 } tBTA_DM_INQ; 300 301 /* Config EIR callback */ 302 typedef void (tBTA_DM_CONFIG_EIR_CBACK) (tBTA_STATUS status, UINT8 eir_type_num, UINT8 *eir_type); 303 304 typedef struct { 305 BOOLEAN bta_dm_eir_fec_required; /* FEC required */ 306 BOOLEAN bta_dm_eir_included_name; /* Included device name or not */ 307 UINT8 bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */ 308 309 BOOLEAN bta_dm_eir_included_uuid; /* Included UUIDs or not */ 310 #if (BTA_EIR_CANNED_UUID_LIST == TRUE) 311 UINT8 bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */ 312 UINT8 *bta_dm_eir_uuid16; /* 16-bit UUIDs */ 313 #else 314 UINT32 uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */ 315 #endif 316 317 BOOLEAN bta_dm_eir_included_tx_power; /* Included inquiry TX power or not */ 318 INT8 bta_dm_eir_inq_tx_power; /* Inquiry TX power */ 319 320 UINT8 bta_dm_eir_flags; /* flags for EIR */ 321 UINT8 bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */ 322 UINT8 *bta_dm_eir_manufac_spec; /* manufacturer specific */ 323 UINT8 bta_dm_eir_url_len; /* length of URL in bytes */ 324 UINT8 *bta_dm_eir_url; /* URL data */ 325 326 tBTA_DM_CONFIG_EIR_CBACK *config_eir_callback; /* callback */ 327 } tBTA_DM_EIR_CONF; 328 329 // #if BLE_INCLUDED == TRUE 330 /* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */ 331 #define BTA_BLE_LIMIT_DISC_FLAG BTM_BLE_LIMIT_DISC_FLAG 332 #define BTA_BLE_GEN_DISC_FLAG BTM_BLE_GEN_DISC_FLAG 333 #define BTA_BLE_BREDR_NOT_SPT BTM_BLE_BREDR_NOT_SPT 334 #define BTA_BLE_DMT_CONTROLLER_SPT BTM_BLE_DMT_CONTROLLER_SPT 335 #define BTA_BLE_DMT_HOST_SPT BTM_BLE_DMT_HOST_SPT 336 #define BTA_BLE_NON_LIMIT_DISC_FLAG BTM_BLE_NON_LIMIT_DISC_FLAG 337 #define BTA_BLE_ADV_FLAG_MASK BTM_BLE_ADV_FLAG_MASK 338 #define BTA_BLE_LIMIT_DISC_MASK BTM_BLE_LIMIT_DISC_MASK 339 340 /* ADV data bit mask */ 341 #define BTA_BLE_AD_BIT_DEV_NAME BTM_BLE_AD_BIT_DEV_NAME 342 #define BTA_BLE_AD_BIT_FLAGS BTM_BLE_AD_BIT_FLAGS 343 #define BTA_BLE_AD_BIT_MANU BTM_BLE_AD_BIT_MANU 344 #define BTA_BLE_AD_BIT_TX_PWR BTM_BLE_AD_BIT_TX_PWR 345 #define BTA_BLE_AD_BIT_INT_RANGE BTM_BLE_AD_BIT_INT_RANGE 346 #define BTA_BLE_AD_BIT_SERVICE BTM_BLE_AD_BIT_SERVICE 347 #define BTA_BLE_AD_BIT_APPEARANCE BTM_BLE_AD_BIT_APPEARANCE 348 #define BTA_BLE_AD_BIT_PROPRIETARY BTM_BLE_AD_BIT_PROPRIETARY 349 #define BTA_DM_BLE_AD_BIT_SERVICE_SOL BTM_BLE_AD_BIT_SERVICE_SOL 350 #define BTA_DM_BLE_AD_BIT_SERVICE_DATA BTM_BLE_AD_BIT_SERVICE_DATA 351 #define BTA_DM_BLE_AD_BIT_SIGN_DATA BTM_BLE_AD_BIT_SIGN_DATA 352 #define BTA_DM_BLE_AD_BIT_SERVICE_128SOL BTM_BLE_AD_BIT_SERVICE_128SOL 353 #define BTA_DM_BLE_AD_BIT_PUBLIC_ADDR BTM_BLE_AD_BIT_PUBLIC_ADDR 354 #define BTA_DM_BLE_AD_BIT_RANDOM_ADDR BTM_BLE_AD_BIT_RANDOM_ADDR 355 #define BTA_DM_BLE_AD_BIT_SERVICE_128 BTM_BLE_AD_BIT_SERVICE_128 /*128-bit Service UUIDs*/ 356 357 typedef tBTM_BLE_AD_MASK tBTA_BLE_AD_MASK; 358 359 /* slave preferred connection interval range */ 360 typedef struct { 361 UINT16 low; 362 UINT16 hi; 363 364 } tBTA_BLE_INT_RANGE; 365 366 /* Service tag supported in the device */ 367 typedef struct { 368 UINT8 num_service; 369 BOOLEAN list_cmpl; 370 UINT16 *p_uuid; 371 } tBTA_BLE_SERVICE; 372 373 374 typedef struct { 375 UINT8 len; 376 UINT8 *p_val; 377 } tBTA_BLE_MANU; 378 379 typedef struct { 380 UINT8 adv_type; 381 UINT8 len; 382 UINT8 *p_val; /* number of len byte */ 383 } tBTA_BLE_PROP_ELEM; 384 385 /* vendor proprietary adv type */ 386 typedef struct { 387 UINT8 num_elem; 388 tBTA_BLE_PROP_ELEM *p_elem; 389 } tBTA_BLE_PROPRIETARY; 390 391 typedef struct { 392 tBT_UUID service_uuid; 393 UINT8 len; 394 UINT8 *p_val; 395 } tBTA_BLE_SERVICE_DATA; 396 397 typedef tBTM_BLE_128SERVICE tBTA_BLE_128SERVICE; 398 typedef tBTM_BLE_32SERVICE tBTA_BLE_32SERVICE; 399 400 typedef struct { 401 tBTA_BLE_INT_RANGE int_range; /* slave preferred conn interval range */ 402 tBTA_BLE_MANU *p_manu; /* manufacturer data */ 403 tBTA_BLE_SERVICE *p_services; /* 16 bits services */ 404 tBTA_BLE_128SERVICE *p_services_128b; /* 128 bits service */ 405 tBTA_BLE_32SERVICE *p_service_32b; /* 32 bits Service UUID */ 406 tBTA_BLE_SERVICE *p_sol_services; /* 16 bits services Solicitation UUIDs */ 407 tBTA_BLE_32SERVICE *p_sol_service_32b; /* List of 32 bit Service Solicitation UUIDs */ 408 tBTA_BLE_128SERVICE *p_sol_service_128b;/* List of 128 bit Service Solicitation UUIDs */ 409 tBTA_BLE_PROPRIETARY *p_proprietary; /* proprietary data */ 410 tBTA_BLE_SERVICE_DATA *p_service_data; /* service data */ 411 UINT16 appearance; /* appearance data */ 412 UINT8 flag; 413 UINT8 tx_power; 414 } tBTA_BLE_ADV_DATA; 415 416 typedef void (tBTA_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK) (tBTA_STATUS status, uint8_t subcode, uint32_t length, uint8_t *device_info); 417 418 typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status); 419 420 typedef tBTM_VSC_CMPL_CB tBTA_SEND_VENDOR_HCI_CMPL_CBACK; 421 422 typedef tBTM_START_ADV_CMPL_CBACK tBTA_START_ADV_CMPL_CBACK; 423 424 typedef tBTM_START_STOP_ADV_CMPL_CBACK tBTA_START_STOP_ADV_CMPL_CBACK; 425 426 typedef tBTM_UPDATE_WHITELIST_CBACK tBTA_UPDATE_WHITELIST_CBACK; 427 428 typedef tBTM_SET_PKT_DATA_LENGTH_CBACK tBTA_SET_PKT_DATA_LENGTH_CBACK; 429 430 typedef tBTM_DTM_CMD_CMPL_CBACK tBTA_DTM_CMD_CMPL_CBACK; 431 432 typedef tBTM_SET_RAND_ADDR_CBACK tBTA_SET_RAND_ADDR_CBACK; 433 434 typedef tBTM_SET_LOCAL_PRIVACY_CBACK tBTA_SET_LOCAL_PRIVACY_CBACK; 435 436 typedef tBTM_SET_RPA_TIMEOUT_CMPL_CBACK tBTA_SET_RPA_TIMEOUT_CMPL_CBACK; 437 438 typedef tBTM_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK; 439 440 typedef tBTM_SET_PRIVACY_MODE_CMPL_CBACK tBTA_SET_PRIVACY_MODE_CMPL_CBACK; 441 442 typedef tBTM_SET_CSA_SUPPORT_CMPL_CBACK tBTA_SET_CSA_SUPPORT_CMPL_CBACK; 443 444 typedef tBTM_CMPL_CB tBTA_CMPL_CB; 445 446 typedef tBTM_VSC_CMPL tBTA_VSC_CMPL; 447 448 typedef tBTM_TX_POWER_RESULTS tBTA_TX_POWER_RESULTS; 449 450 typedef tBTM_RSSI_RESULTS tBTA_RSSI_RESULTS; 451 452 typedef tBTM_SET_AFH_CHANNELS_RESULTS tBTA_SET_AFH_CHANNELS_RESULTS; 453 typedef tBTM_BLE_SET_CHANNELS_RESULTS tBTA_BLE_SET_CHANNELS_RESULTS; 454 455 typedef tBTM_SET_ACL_PKT_TYPES_RESULTS tBTA_SET_ACL_PKT_TYPES_RESULTS; 456 457 typedef tBTM_REMOTE_DEV_NAME tBTA_REMOTE_DEV_NAME; 458 459 /* advertising channel map */ 460 #define BTA_BLE_ADV_CHNL_37 BTM_BLE_ADV_CHNL_37 461 #define BTA_BLE_ADV_CHNL_38 BTM_BLE_ADV_CHNL_38 462 #define BTA_BLE_ADV_CHNL_39 BTM_BLE_ADV_CHNL_39 463 typedef tBTM_BLE_ADV_CHNL_MAP tBTA_BLE_ADV_CHNL_MAP; /* use as a bit mask */ 464 465 /* advertising filter policy */ 466 typedef tBTM_BLE_AFP tBTA_BLE_AFP; 467 468 /* adv event type */ 469 #define BTA_BLE_CONNECT_EVT BTM_BLE_CONNECT_EVT /* Connectable undirected advertising */ 470 #define BTA_BLE_CONNECT_DIR_EVT BTM_BLE_CONNECT_DIR_EVT /* Connectable directed advertising */ 471 #define BTA_BLE_DISCOVER_EVT BTM_BLE_DISCOVER_EVT /* Scannable undirected advertising */ 472 #define BTA_BLE_NON_CONNECT_EVT BTM_BLE_NON_CONNECT_EVT /* Non connectable undirected advertising */ 473 typedef UINT8 tBTA_BLE_ADV_EVT; 474 475 /* adv tx power level */ 476 #define BTA_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */ 477 #define BTA_BLE_ADV_TX_POWER_LOW 1 /* low tx power */ 478 #define BTA_BLE_ADV_TX_POWER_MID 2 /* middle tx power */ 479 #define BTA_BLE_ADV_TX_POWER_UPPER 3 /* upper tx power */ 480 #define BTA_BLE_ADV_TX_POWER_MAX 4 /* maximum tx power */ 481 typedef UINT8 tBTA_BLE_ADV_TX_POWER; 482 483 /* advertising instance parameters */ 484 typedef struct { 485 UINT16 adv_int_min; /* minimum adv interval */ 486 UINT16 adv_int_max; /* maximum adv interval */ 487 tBTA_BLE_ADV_EVT adv_type; /* adv event type */ 488 tBTA_BLE_ADV_CHNL_MAP channel_map; /* adv channel map */ 489 tBTA_BLE_AFP adv_filter_policy; /* advertising filter policy */ 490 tBTA_BLE_ADV_TX_POWER tx_power; /* adv tx power */ 491 } tBTA_BLE_ADV_PARAMS; 492 493 /* These are the fields returned in each device adv packet. It 494 ** is returned in the results callback if registered. 495 */ 496 typedef struct { 497 UINT8 conn_mode; 498 tBTA_BLE_AD_MASK ad_mask; /* mask of the valid adv data field */ 499 UINT8 flag; 500 UINT8 tx_power_level; 501 UINT8 remote_name_len; 502 UINT8 *p_remote_name; 503 tBTA_BLE_SERVICE service; 504 } tBTA_BLE_INQ_DATA; 505 506 enum { 507 BTA_BLE_BATCH_SCAN_MODE_PASS = 1, 508 BTA_BLE_BATCH_SCAN_MODE_ACTI = 2, 509 BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3 510 }; 511 typedef UINT8 tBTA_BLE_BATCH_SCAN_MODE; 512 513 enum { 514 BTA_BLE_DISCARD_OLD_ITEMS = 0, 515 BTA_BLE_DISCARD_LOWER_RSSI_ITEMS = 1 516 }; 517 typedef UINT8 tBTA_BLE_DISCARD_RULE; 518 519 enum { 520 BTA_BLE_ADV_SEEN_FIRST_TIME = 0, 521 BTA_BLE_ADV_TRACKING_TIMEOUT = 1 522 }; 523 typedef UINT8 tBTA_BLE_ADV_CHANGE_REASON; 524 525 enum { 526 BTA_BLE_BATCH_SCAN_ENB_EVT = 1, 527 BTA_BLE_BATCH_SCAN_CFG_STRG_EVT = 2, 528 BTA_BLE_BATCH_SCAN_DATA_EVT = 3, 529 BTA_BLE_BATCH_SCAN_THRES_EVT = 4, 530 BTA_BLE_BATCH_SCAN_PARAM_EVT = 5, 531 BTA_BLE_BATCH_SCAN_DIS_EVT = 6 532 }; 533 typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT; 534 535 typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION; 536 // #endif 537 538 /* BLE customer specific feature function type definitions */ 539 /* data type used on customer specific feature for RSSI monitoring */ 540 #define BTA_BLE_RSSI_ALERT_HI 0 541 #define BTA_BLE_RSSI_ALERT_RANGE 1 542 #define BTA_BLE_RSSI_ALERT_LO 2 543 typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_TYPE; 544 545 #define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */ 546 #define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */ 547 #define BTA_BLE_RSSI_ALERT_RANGE_BIT BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */ 548 #define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */ 549 typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_MASK; 550 551 552 typedef void (tBTA_DM_BLE_RSSI_CBACK) (BD_ADDR bd_addr, tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, INT8 rssi); 553 554 /* max number of filter spot for different filter type */ 555 #define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */ 556 #define BTA_DM_BLE_MAX_ADDR_FILTER BTM_BLE_MAX_ADDR_FILTER /* 8 */ 557 #define BTA_DM_BLE_PF_STR_COND_MAX BTM_BLE_PF_STR_COND_MAX /* 4 apply to manu data , or local name */ 558 #define BTA_DM_BLE_PF_STR_LEN_MAX BTM_BLE_PF_STR_LEN_MAX /* match for first 20 bytes */ 559 560 #define BTA_DM_BLE_PF_LOGIC_OR 0 561 #define BTA_DM_BLE_PF_LOGIC_AND 1 562 typedef UINT8 tBTA_DM_BLE_PF_LOGIC_TYPE; 563 564 enum { 565 BTA_DM_BLE_SCAN_COND_ADD, 566 BTA_DM_BLE_SCAN_COND_DELETE, 567 BTA_DM_BLE_SCAN_COND_CLEAR = 2 568 }; 569 typedef UINT8 tBTA_DM_BLE_SCAN_COND_OP; 570 571 /* ADV payload filtering vendor specific call event */ 572 enum { 573 BTA_BLE_SCAN_PF_ENABLE_EVT = 7, 574 BTA_BLE_SCAN_PF_COND_EVT 575 }; 576 577 /* filter selection bit index */ 578 #define BTA_DM_BLE_PF_ADDR_FILTER BTM_BLE_PF_ADDR_FILTER 579 #define BTA_DM_BLE_PF_SRVC_DATA BTM_BLE_PF_SRVC_DATA 580 #define BTA_DM_BLE_PF_SRVC_UUID BTM_BLE_PF_SRVC_UUID 581 #define BTA_DM_BLE_PF_SRVC_SOL_UUID BTM_BLE_PF_SRVC_SOL_UUID 582 #define BTA_DM_BLE_PF_LOCAL_NAME BTM_BLE_PF_LOCAL_NAME 583 #define BTA_DM_BLE_PF_MANU_DATA BTM_BLE_PF_MANU_DATA 584 #define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN 585 #define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL 586 #define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX 587 typedef UINT8 tBTA_DM_BLE_PF_COND_TYPE; 588 589 typedef union { 590 UINT16 uuid16_mask; 591 UINT32 uuid32_mask; 592 UINT8 uuid128_mask[LEN_UUID_128]; 593 } tBTA_DM_BLE_PF_COND_MASK; 594 595 typedef struct { 596 tBLE_BD_ADDR *p_target_addr; /* target address, if NULL, generic UUID filter */ 597 tBT_UUID uuid; /* UUID condition */ 598 tBTA_DM_BLE_PF_LOGIC_TYPE cond_logic; /* AND/OR */ 599 tBTA_DM_BLE_PF_COND_MASK *p_uuid_mask; /* UUID condition mask, if NULL, match exact as UUID condition */ 600 } tBTA_DM_BLE_PF_UUID_COND; 601 602 typedef struct { 603 UINT8 data_len; /* <= 20 bytes */ 604 UINT8 *p_data; 605 } tBTA_DM_BLE_PF_LOCAL_NAME_COND; 606 607 typedef struct { 608 UINT16 company_id; /* company ID */ 609 UINT8 data_len; /* <= 20 bytes */ 610 UINT8 *p_pattern; 611 UINT16 company_id_mask; /* UUID value mask */ 612 UINT8 *p_pattern_mask; /* Manufacturer data matching mask, same length 613 as data pattern, set to all 0xff, match exact data */ 614 } tBTA_DM_BLE_PF_MANU_COND; 615 616 typedef struct { 617 UINT16 uuid; /* service ID */ 618 UINT8 data_len; /* <= 20 bytes */ 619 UINT8 *p_pattern; 620 UINT8 *p_pattern_mask; /* Service data matching mask, same length 621 as data pattern, set to all 0xff, match exact data */ 622 } tBTA_DM_BLE_PF_SRVC_PATTERN_COND; 623 624 typedef union { 625 tBLE_BD_ADDR target_addr; 626 tBTA_DM_BLE_PF_LOCAL_NAME_COND local_name; /* local name filtering */ 627 tBTA_DM_BLE_PF_MANU_COND manu_data; /* manufacturer data filtering */ 628 tBTA_DM_BLE_PF_UUID_COND srvc_uuid; /* service UUID filtering */ 629 tBTA_DM_BLE_PF_UUID_COND solicitate_uuid; /* solicited service UUID filtering */ 630 tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */ 631 } tBTA_DM_BLE_PF_COND_PARAM; 632 633 typedef UINT8 tBTA_DM_BLE_PF_FILT_INDEX; 634 typedef UINT8 tBTA_DM_BLE_PF_AVBL_SPACE; 635 636 typedef INT8 tBTA_DM_RSSI_VALUE; 637 typedef UINT8 tBTA_DM_LINK_QUALITY_VALUE; 638 639 640 typedef UINT8 tBTA_SIG_STRENGTH_MASK; 641 642 643 /* Security Callback Events */ 644 #define BTA_DM_ENABLE_EVT 0 /* Enable Event */ 645 #define BTA_DM_DISABLE_EVT 1 /* Disable Event */ 646 #define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */ 647 #define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */ 648 #define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */ 649 #define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */ 650 #define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */ 651 #define BTA_DM_SIG_STRENGTH_EVT 7 /* Signal strength for bluetooth connection */ 652 #define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */ 653 #define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */ 654 #define BTA_DM_SP_CFM_REQ_EVT 10 /* Simple Pairing User Confirmation request. */ 655 #define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */ 656 #define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */ 657 #define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */ 658 #define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */ 659 #define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */ 660 #define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */ 661 #define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */ 662 #define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */ 663 #define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */ 664 #define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */ 665 #define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */ 666 #define BTA_DM_BLE_NC_REQ_EVT 22 /* SMP Numeric Comparison request event */ 667 // btla-specific ++ 668 #define BTA_DM_SP_RMT_OOB_EXT_EVT 23 /* Simple Pairing Remote OOB Extended Data request. */ 669 #define BTA_DM_BLE_AUTH_CMPL_EVT 24 /* BLE Auth complete */ 670 // btla-specific -- 671 #define BTA_DM_DEV_UNPAIRED_EVT 25 /* BT unpair event */ 672 #define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */ 673 #define BTA_DM_LE_FEATURES_READ 27 /* Controller specific LE features are read */ 674 #define BTA_DM_ENER_INFO_READ 28 /* Energy info read */ 675 #define BTA_DM_BLE_DEV_UNPAIRED_EVT 29 /* BLE unpair event */ 676 #define BTA_DM_SP_KEY_REQ_EVT 30 /* Simple Pairing Passkey request */ 677 #define BTA_DM_PM_MODE_CHG_EVT 31 /* Mode changed event */ 678 #define BTA_DM_ACL_LINK_STAT_EVT 32 /* ACL connection status report event */ 679 #define BTA_DM_BLE_SC_OOB_REQ_EVT 33 /* BLE SMP SC OOB request event */ 680 #define BTA_DM_BLE_SC_CR_LOC_OOB_EVT 34 /* BLE SMP SC Create Local OOB request event */ 681 682 typedef UINT8 tBTA_DM_SEC_EVT; 683 684 /* Structure associated with BTA_DM_ENABLE_EVT */ 685 typedef struct { 686 tBTA_STATUS status; 687 } tBTA_DM_ENABLE; 688 689 /* Structure associated with BTA_DM_PIN_REQ_EVT */ 690 typedef struct { 691 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */ 692 BD_ADDR bd_addr; /* BD address peer device. */ 693 DEV_CLASS dev_class; /* Class of Device */ 694 BD_NAME bd_name; /* Name of peer device. */ 695 BOOLEAN min_16_digit; /* TRUE if the pin returned must be at least 16 digits */ 696 } tBTA_DM_PIN_REQ; 697 698 /* BLE related definition */ 699 #if (SMP_INCLUDED == TRUE) 700 #define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10) 701 #define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x)) 702 #define BTA_DM_AUTH_SMP_PASSKEY_FAIL BTA_DM_AUTH_CONVERT_SMP_CODE (SMP_PASSKEY_ENTRY_FAIL) 703 #define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL) 704 #define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL) 705 #define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR) 706 #define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT) 707 #define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE) 708 #define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD) 709 #define BTA_DM_AUTH_SMP_UNKNOWN_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN) 710 #define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS) 711 #define BTA_DM_AUTH_SMP_INVALID_PARAMETERS (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_PARAMETERS) 712 #define BTA_DM_AUTH_SMP_INTERNAL_ERR (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR) 713 #define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP) 714 #define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL) 715 #define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL) 716 #define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY) 717 #define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL) 718 #define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT) 719 #endif ///SMP_INCLUDED == TRUE 720 /* connection parameter boundary value and dummy value */ 721 #define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN 722 #define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX 723 #define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN 724 #define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX 725 #define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN 726 #define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX 727 #define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX 728 #define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN 729 #define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX 730 #define BTA_DM_BLE_CONN_PARAM_UNDEF BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be overwritten */ 731 732 #if (SMP_INCLUDED == TRUE) 733 #define BTA_LE_KEY_PENC BTM_LE_KEY_PENC /* encryption information of peer device */ 734 #define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */ 735 #define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */ 736 #define BTA_LE_KEY_LENC BTM_LE_KEY_LENC /* master role security information:div */ 737 #define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */ 738 #define BTA_LE_KEY_LCSRK BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */ 739 #endif ///SMP_INCLUDED == TRUE 740 typedef UINT8 tBTA_LE_KEY_TYPE; /* can be used as a bit mask */ 741 742 743 typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS ; 744 typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS; 745 typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS ; 746 typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS ; 747 typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS ; 748 749 typedef union { 750 tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */ 751 tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */ 752 tBTA_LE_PID_KEYS pid_key; /* peer device ID key */ 753 tBTA_LE_LENC_KEYS lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/ 754 tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/ 755 tBTA_LE_PID_KEYS lid_key; /* local device ID key for the particular remote */ 756 } tBTA_LE_KEY_VALUE; 757 758 #define BTA_BLE_LOCAL_KEY_TYPE_ID 1 759 #define BTA_BLE_LOCAL_KEY_TYPE_ER 2 760 typedef UINT8 tBTA_DM_BLE_LOCAL_KEY_MASK; 761 762 typedef struct { 763 BT_OCTET16 ir; 764 BT_OCTET16 irk; 765 BT_OCTET16 dhk; 766 } tBTA_BLE_LOCAL_ID_KEYS; 767 #if (SMP_INCLUDED == TRUE) 768 #define BTA_DM_SEC_GRANTED BTA_SUCCESS 769 #define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT 770 #define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT 771 #endif ///SMP_INCLUDED == TRUE 772 typedef UINT8 tBTA_DM_BLE_SEC_GRANT; 773 774 775 #define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE 776 #define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO 777 #define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE 778 typedef UINT8 tBTA_DM_BLE_CONN_TYPE; 779 780 typedef BOOLEAN (tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name); 781 782 typedef tBTM_LE_UPDATE_CONN_PRAMS tBTA_LE_UPDATE_CONN_PRAMS; 783 typedef tBTM_UPDATE_CONN_PARAM_CBACK tBTA_UPDATE_CONN_PARAM_CBACK; 784 785 786 /* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */ 787 typedef struct { 788 BD_ADDR bd_addr; /* peer address */ 789 BD_NAME bd_name; /* peer device name */ 790 } tBTA_DM_BLE_SEC_REQ; 791 792 typedef struct { 793 BD_ADDR bd_addr; /* peer address */ 794 tBTM_LE_KEY_TYPE key_type; 795 tBTM_LE_KEY_VALUE *p_key_value; 796 } tBTA_DM_BLE_KEY; 797 798 /* Structure associated with BTA_DM_AUTH_CMPL_EVT */ 799 typedef struct { 800 BD_ADDR bd_addr; /* BD address peer device. */ 801 BD_NAME bd_name; /* Name of peer device. */ 802 BOOLEAN key_present; /* Valid link key value in key element */ 803 LINK_KEY key; /* Link key associated with peer device. */ 804 UINT8 key_type; /* The type of Link Key */ 805 BOOLEAN success; /* TRUE of authentication succeeded, FALSE if failed. */ 806 UINT8 fail_reason; /* The HCI reason/error code for when success=FALSE */ 807 tBLE_ADDR_TYPE addr_type; /* Peer device address type */ 808 tBT_DEVICE_TYPE dev_type; 809 UINT8 auth_mode; 810 BOOLEAN sc_support; /* Denotes if peer device supported secure connection while bonding. */ 811 } tBTA_DM_AUTH_CMPL; 812 813 814 /* Structure associated with BTA_DM_AUTHORIZE_EVT */ 815 typedef struct { 816 BD_ADDR bd_addr; /* BD address peer device. */ 817 BD_NAME bd_name; /* Name of peer device. */ 818 tBTA_SERVICE_ID service; /* Service ID to authorize. */ 819 // btla-specific ++ 820 DEV_CLASS dev_class; 821 // btla-specific -- 822 } tBTA_DM_AUTHORIZE; 823 824 /* Structure associated with BTA_DM_LINK_UP_EVT */ 825 typedef struct { 826 BOOLEAN sc_downgrade; /* Security downgrade state. */ 827 BD_ADDR bd_addr; /* BD address peer device. */ 828 #if BLE_INCLUDED == TRUE 829 tBTA_TRANSPORT link_type; 830 #endif 831 } tBTA_DM_LINK_UP; 832 833 /* Structure associated with BTA_DM_LINK_DOWN_EVT */ 834 typedef struct { 835 BD_ADDR bd_addr; /* BD address peer device. */ 836 UINT8 status; /* connection open/closed */ 837 UINT8 reason; /* link down reason */ 838 BOOLEAN is_removed; /* TRUE if device is removed when link is down */ 839 #if BLE_INCLUDED == TRUE 840 tBTA_TRANSPORT link_type; 841 #endif 842 } tBTA_DM_LINK_DOWN; 843 844 enum { 845 BTA_ACL_LINK_STAT_CONN_CMPL, 846 BTA_ACL_LINK_STAT_DISCONN_CMPL 847 }; 848 typedef UINT8 tBTA_ACL_LINK_STAT_EVT; 849 850 typedef struct { 851 UINT8 status; /* ACL link connection status */ 852 UINT16 handle; /* ACL connection handle */ 853 BD_ADDR bd_addr; /* peer bluetooth address */ 854 } tBTA_DM_ACL_CONN_CMPL_STAT; 855 856 typedef struct { 857 UINT8 reason; /* ACL link disconnection reason */ 858 UINT16 handle; /* ACL connection handle */ 859 BD_ADDR bd_addr; /* peer bluetooth address */ 860 } tBTA_DM_ACL_DISCONN_CMPL_STAT; 861 862 /* Structure associated with BTA_DM_ACL_LINK_STAT_EVT */ 863 typedef struct { 864 tBTA_ACL_LINK_STAT_EVT event; /* ACL link event */ 865 union { 866 tBTA_DM_ACL_CONN_CMPL_STAT conn_cmpl; 867 tBTA_DM_ACL_DISCONN_CMPL_STAT disconn_cmpl; 868 } link_act; 869 } tBTA_DM_ACL_LINK_STAT; 870 871 /* Structure associated with BTA_DM_ROLE_CHG_EVT */ 872 typedef struct { 873 BD_ADDR bd_addr; /* BD address peer device. */ 874 UINT8 new_role; /* the new connection role */ 875 } tBTA_DM_ROLE_CHG; 876 877 /* Structure associated with BTA_DM_BUSY_LEVEL_EVT */ 878 typedef struct { 879 UINT8 level; /* when paging or inquiring, level is 10. 880 Otherwise, the number of ACL links */ 881 UINT8 level_flags; /* indicates individual flags */ 882 } tBTA_DM_BUSY_LEVEL; 883 884 #define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */ 885 #define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */ 886 #define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */ 887 #define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */ 888 #if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE 889 #define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */ 890 #endif 891 typedef tBTM_IO_CAP tBTA_IO_CAP; 892 893 #define BTA_AUTH_SP_NO BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single Profile/non-bonding 894 Numeric comparison with automatic accept allowed */ 895 #define BTA_AUTH_SP_YES BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding 896 Use IO Capabilities to determine authentication procedure */ 897 #define BTA_AUTH_AP_NO BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated bonding 898 Numeric comparison with automatic accept allowed */ 899 #define BTA_AUTH_AP_YES BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated bonding 900 Use IO Capabilities to determine authentication procedure */ 901 #define BTA_AUTH_SPGB_NO BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general bonding 902 Numeric comparison with automatic accept allowed */ 903 #define BTA_AUTH_SPGB_YES BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general bonding 904 Use IO Capabilities to determine authentication procedure */ 905 typedef tBTM_AUTH_REQ tBTA_AUTH_REQ; 906 907 #define BTA_AUTH_DD_BOND BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */ 908 #define BTA_AUTH_GEN_BOND BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */ 909 #define BTA_AUTH_BONDS BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */ 910 911 #if (SMP_INCLUDED == TRUE) 912 #define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/ 913 #define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */ 914 #define BTA_LE_AUTH_REQ_MITM BTM_LE_AUTH_REQ_MITM /* 1 << 2 */ 915 916 #define BTA_LE_AUTH_REQ_SC_ONLY BTM_LE_AUTH_REQ_SC_ONLY /* 1 << 3 */ 917 #define BTA_LE_AUTH_REQ_SC_BOND BTM_LE_AUTH_REQ_SC_BOND /* 1001 */ 918 #define BTA_LE_AUTH_REQ_SC_MITM BTM_LE_AUTH_REQ_SC_MITM /* 1100 */ 919 #define BTA_LE_AUTH_REQ_SC_MITM_BOND BTM_LE_AUTH_REQ_SC_MITM_BOND /* 1101 */ 920 #endif ///SMP_INCLUDED == TRUE 921 typedef tBTM_LE_AUTH_REQ tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */ 922 923 #define BTA_OOB_NONE BTM_OOB_NONE 924 #define BTA_OOB_PRESENT BTM_OOB_PRESENT 925 #if BTM_OOB_INCLUDED == TRUE 926 #define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN 927 #endif 928 typedef tBTM_OOB_DATA tBTA_OOB_DATA; 929 930 #define BTA_PM_MD_ACTIVE BTM_PM_MD_ACTIVE /* 0 Active mode */ 931 #define BTA_PM_MD_HOLD BTM_PM_MD_HOLD /* 1 Hold mode */ 932 #define BTA_PM_MD_SNIFF BTM_PM_MD_SNIFF /* 2 Sniff mode */ 933 #define BTA_PM_MD_PARK BTM_PM_MD_PARK /* 3 Park state */ 934 typedef tBTM_PM_MODE tBTA_PM_MODE; 935 936 /* Structure associated with BTA_DM_SP_CFM_REQ_EVT */ 937 typedef struct { 938 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */ 939 BD_ADDR bd_addr; /* peer address */ 940 DEV_CLASS dev_class; /* peer CoD */ 941 BD_NAME bd_name; /* peer device name */ 942 UINT32 num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */ 943 BOOLEAN just_works; /* TRUE, if "Just Works" association model */ 944 tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */ 945 tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */ 946 tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */ 947 tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */ 948 } tBTA_DM_SP_CFM_REQ; 949 950 /* Structure associated with tBTA_DM_SP_KEY_REQ */ 951 typedef struct { 952 BD_ADDR bd_addr; /* peer address */ 953 DEV_CLASS dev_class; /* peer CoD */ 954 BD_NAME bd_name; /* peer device name */ 955 } tBTA_DM_SP_KEY_REQ; 956 957 enum { 958 BTA_SP_KEY_STARTED, /* passkey entry started */ 959 BTA_SP_KEY_ENTERED, /* passkey digit entered */ 960 BTA_SP_KEY_ERASED, /* passkey digit erased */ 961 BTA_SP_KEY_CLEARED, /* passkey cleared */ 962 BTA_SP_KEY_COMPLT /* passkey entry completed */ 963 }; 964 typedef UINT8 tBTA_SP_KEY_TYPE; 965 966 /* Structure associated with BTA_DM_SP_KEYPRESS_EVT */ 967 typedef struct { 968 BD_ADDR bd_addr; /* peer address */ 969 tBTA_SP_KEY_TYPE notif_type; 970 } tBTA_DM_SP_KEY_PRESS; 971 972 /* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */ 973 typedef struct { 974 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */ 975 BD_ADDR bd_addr; /* peer address */ 976 DEV_CLASS dev_class; /* peer CoD */ 977 BD_NAME bd_name; /* peer device name */ 978 UINT32 passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */ 979 } tBTA_DM_SP_KEY_NOTIF; 980 981 /* Structure associated with BTA_DM_SP_RMT_OOB_EVT */ 982 typedef struct { 983 /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in order */ 984 BD_ADDR bd_addr; /* peer address */ 985 DEV_CLASS dev_class; /* peer CoD */ 986 BD_NAME bd_name; /* peer device name */ 987 } tBTA_DM_SP_RMT_OOB; 988 989 /* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */ 990 typedef struct { 991 tBTA_STATUS result; /* TRUE of bond cancel succeeded, FALSE if failed. */ 992 } tBTA_DM_BOND_CANCEL_CMPL; 993 994 /* Structure associated with BTA_DM_PM_MODE_CHG_EVT */ 995 typedef struct { 996 BD_ADDR bd_addr; /* BD address peer device. */ 997 tBTA_PM_MODE mode; /* the new connection role */ 998 UINT16 interval; /* Number of baseband slots */ 999 } tBTA_DM_MODE_CHG; 1000 1001 typedef struct { 1002 BT_OCTET16 local_oob_c; /* Local OOB Data Confirmation/Commitment */ 1003 BT_OCTET16 local_oob_r; /* Local OOB Data Randomizer */ 1004 } tBTA_DM_LOC_OOB_DATA; 1005 1006 /* Union of all security callback structures */ 1007 typedef union { 1008 tBTA_DM_ENABLE enable; /* BTA enabled */ 1009 tBTA_DM_PIN_REQ pin_req; /* PIN request. */ 1010 tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */ 1011 tBTA_DM_AUTHORIZE authorize; /* Authorization request. */ 1012 tBTA_DM_LINK_UP link_up; /* ACL connection up event */ 1013 tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */ 1014 tBTA_DM_ACL_LINK_STAT acl_link_stat; /* ACL link status event */ 1015 tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */ 1016 tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */ 1017 tBTA_DM_SP_KEY_REQ key_req; /* user passkey request */ 1018 tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */ 1019 tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */ 1020 tBTA_DM_BOND_CANCEL_CMPL bond_cancel_cmpl; /* Bond Cancel Complete indication */ 1021 tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */ 1022 tBTA_DM_ROLE_CHG role_chg; /* role change event */ 1023 tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */ 1024 tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */ 1025 tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */ 1026 BT_OCTET16 ble_er; /* ER event data */ 1027 #if BTA_DM_PM_INCLUDED 1028 tBTA_DM_MODE_CHG mode_chg; /* mode change event */ 1029 #endif ///BTA_DM_PM_INCLUDED 1030 tBTA_DM_LOC_OOB_DATA local_oob_data; /* Local OOB data generated by us */ 1031 } tBTA_DM_SEC; 1032 1033 /* Security callback */ 1034 typedef void (tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data); 1035 1036 #define BTA_BLE_MULTI_ADV_ILLEGAL 0 1037 1038 /* multi adv callback event */ 1039 #define BTA_BLE_MULTI_ADV_ENB_EVT 1 1040 #define BTA_BLE_MULTI_ADV_DISABLE_EVT 2 1041 #define BTA_BLE_MULTI_ADV_PARAM_EVT 3 1042 #define BTA_BLE_MULTI_ADV_DATA_EVT 4 1043 1044 typedef UINT8 tBTA_BLE_MULTI_ADV_EVT; 1045 1046 /* multi adv callback */ 1047 typedef void (tBTA_BLE_MULTI_ADV_CBACK)(tBTA_BLE_MULTI_ADV_EVT event, 1048 UINT8 inst_id, void *p_ref, tBTA_STATUS status); 1049 typedef UINT32 tBTA_DM_BLE_REF_VALUE; 1050 1051 #define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE 1052 #define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG 1053 typedef UINT8 tBTA_DM_BLE_PF_EVT; 1054 1055 #define BTA_DM_BLE_PF_ENABLE 1 1056 #define BTA_DM_BLE_PF_CONFIG 2 1057 typedef UINT8 tBTA_DM_BLE_PF_ACTION; 1058 1059 /* Config callback */ 1060 typedef void (tBTA_DM_BLE_PF_CFG_CBACK) (tBTA_DM_BLE_PF_ACTION action, 1061 tBTA_DM_BLE_PF_COND_TYPE cfg_cond, 1062 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, tBTA_STATUS status, 1063 tBTA_DM_BLE_REF_VALUE ref_value); 1064 /* Param callback */ 1065 typedef void (tBTA_DM_BLE_PF_PARAM_CBACK) (UINT8 action_type, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, 1066 tBTA_DM_BLE_REF_VALUE ref_value, tBTA_STATUS status); 1067 1068 /* Status callback */ 1069 typedef void (tBTA_DM_BLE_PF_STATUS_CBACK) (UINT8 action, tBTA_STATUS status, 1070 tBTA_DM_BLE_REF_VALUE ref_value); 1071 1072 1073 #define BTA_DM_BLE_PF_BRDCAST_ADDR_FILT 1 1074 #define BTA_DM_BLE_PF_SERV_DATA_CHG_FILT 2 1075 #define BTA_DM_BLE_PF_SERV_UUID 4 1076 #define BTA_DM_BLE_PF_SERV_SOLC_UUID 8 1077 #define BTA_DM_BLE_PF_LOC_NAME_CHECK 16 1078 #define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32 1079 #define BTA_DM_BLE_PF_SERV_DATA_CHECK 64 1080 typedef UINT16 tBTA_DM_BLE_PF_FEAT_SEL; 1081 1082 #define BTA_DM_BLE_PF_LIST_LOGIC_OR 1 1083 #define BTA_DM_BLE_PF_LIST_LOGIC_AND 2 1084 typedef UINT16 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE; 1085 1086 #define BTA_DM_BLE_PF_FILT_LOGIC_OR 0 1087 #define BTA_DM_BLE_PF_FILT_LOGIC_AND 1 1088 typedef UINT16 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE; 1089 1090 typedef UINT8 tBTA_DM_BLE_PF_RSSI_THRESHOLD; 1091 typedef UINT8 tBTA_DM_BLE_PF_DELIVERY_MODE; 1092 typedef UINT16 tBTA_DM_BLE_PF_TIMEOUT; 1093 typedef UINT8 tBTA_DM_BLE_PF_TIMEOUT_CNT; 1094 typedef UINT16 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES; 1095 1096 typedef struct { 1097 tBTA_DM_BLE_PF_FEAT_SEL feat_seln; 1098 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE list_logic_type; 1099 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE filt_logic_type; 1100 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_high_thres; 1101 tBTA_DM_BLE_PF_RSSI_THRESHOLD rssi_low_thres; 1102 tBTA_DM_BLE_PF_DELIVERY_MODE dely_mode; 1103 tBTA_DM_BLE_PF_TIMEOUT found_timeout; 1104 tBTA_DM_BLE_PF_TIMEOUT lost_timeout; 1105 tBTA_DM_BLE_PF_TIMEOUT_CNT found_timeout_cnt; 1106 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES num_of_tracking_entries; 1107 } tBTA_DM_BLE_PF_FILT_PARAMS; 1108 1109 /* Search callback events */ 1110 #define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */ 1111 #define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */ 1112 #define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */ 1113 #define BTA_DM_DISC_BLE_RES_EVT 3 /* Discovery result for BLE GATT based service on a peer device. */ 1114 #define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */ 1115 #define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */ 1116 #define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */ 1117 #define BTA_DM_INQ_DISCARD_NUM_EVT 7 /* The number of inquiry discarded packets */ 1118 1119 typedef UINT8 tBTA_DM_SEARCH_EVT; 1120 1121 #define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */ 1122 1123 /* Structure associated with BTA_DM_INQ_RES_EVT */ 1124 typedef struct { 1125 BD_ADDR bd_addr; /* BD address peer device. */ 1126 DEV_CLASS dev_class; /* Device class of peer device. */ 1127 BOOLEAN remt_name_not_required; /* Application sets this flag if it already knows the name of the device */ 1128 /* If the device name is known to application BTA skips the remote name request */ 1129 BOOLEAN is_limited; /* TRUE, if the limited inquiry bit is set in the CoD */ 1130 INT8 rssi; /* The rssi value */ 1131 UINT8 *p_eir; /* Received EIR */ 1132 #if (BLE_INCLUDED == TRUE) 1133 UINT8 inq_result_type; 1134 UINT8 ble_addr_type; 1135 tBTM_BLE_EVT_TYPE ble_evt_type; 1136 tBT_DEVICE_TYPE device_type; 1137 UINT8 flag; 1138 UINT8 adv_data_len; 1139 UINT8 scan_rsp_len; 1140 #endif 1141 1142 } tBTA_DM_INQ_RES; 1143 1144 /* Structure associated with BTA_DM_INQ_CMPL_EVT */ 1145 typedef struct { 1146 UINT8 num_resps; /* Number of inquiry responses. */ 1147 } tBTA_DM_INQ_CMPL; 1148 1149 /* Structure associated with BTA_DM_INQ_DISCARD_NUM_EVT */ 1150 typedef struct { 1151 UINT32 num_dis; /* The number of inquiry discarded packets. */ 1152 } tBTA_DM_INQ_DISCARD; 1153 1154 /* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */ 1155 typedef struct { 1156 BD_ADDR bd_addr; /* BD address peer device. */ 1157 UINT8 num_record; /* Number of DI record */ 1158 tBTA_STATUS result; 1159 } tBTA_DM_DI_DISC_CMPL; 1160 1161 /* Structure associated with BTA_DM_DISC_RES_EVT */ 1162 typedef struct { 1163 BD_ADDR bd_addr; /* BD address peer device. */ 1164 BD_NAME bd_name; /* Name of peer device. */ 1165 tBTA_SERVICE_MASK services; /* Services found on peer device. */ 1166 // btla-specific ++ 1167 UINT8 *p_raw_data; /* Raw data for discovery DB */ 1168 UINT32 raw_data_size; /* Size of raw data */ 1169 tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */ 1170 UINT32 num_uuids; 1171 UINT8 *p_uuid_list; 1172 // btla-specific -- 1173 tBTA_STATUS result; 1174 } tBTA_DM_DISC_RES; 1175 1176 /* Structure associated with tBTA_DM_DISC_BLE_RES */ 1177 typedef struct { 1178 BD_ADDR bd_addr; /* BD address peer device. */ 1179 BD_NAME bd_name; /* Name of peer device. */ 1180 tBT_UUID service; /* GATT based Services UUID found on peer device. */ 1181 } tBTA_DM_DISC_BLE_RES; 1182 1183 /* Structure associated with tBTA_DM_RMTNAME_CMPL */ 1184 typedef struct { 1185 BD_ADDR bd_addr; 1186 BD_NAME bd_name; 1187 tBTA_CMPL_CB *read_rmtname_cb; 1188 } tBTA_DM_RMTNAME_CMPL; 1189 1190 /* Union of all search callback structures */ 1191 typedef union { 1192 tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */ 1193 tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */ 1194 tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */ 1195 tBTA_DM_DISC_BLE_RES disc_ble_res; /* Discovery result for GATT based service */ 1196 tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */ 1197 tBTA_DM_INQ_DISCARD inq_dis; /* the discarded packets information of inquiry */ 1198 tBTA_DM_RMTNAME_CMPL rmt_name; /* the remote name information */ 1199 } tBTA_DM_SEARCH; 1200 1201 /* Structure of search callback event and structures */ 1202 typedef struct { 1203 tBTA_DM_SEARCH_EVT event; /* Search callback events */ 1204 UINT16 len; /* Length of p_data */ 1205 tBTA_DM_SEARCH *p_data; /* Union of all search callback structures */ 1206 } tBTA_DM_SEARCH_PARAM; 1207 1208 /* Search callback */ 1209 typedef void (tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH *p_data); 1210 1211 /* Execute call back */ 1212 typedef void (tBTA_DM_EXEC_CBACK) (void *p_param); 1213 1214 /* Encryption callback*/ 1215 typedef void (tBTA_DM_ENCRYPT_CBACK) (BD_ADDR bd_addr, tBTA_TRANSPORT transport, tBTA_STATUS result); 1216 1217 /* Relate to ESP_BLE_SEC_xxx in esp_gatt_defs.h */ 1218 #if BLE_INCLUDED == TRUE 1219 #define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE 1220 #define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT 1221 #define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM 1222 #define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM 1223 typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT; 1224 1225 typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS; 1226 typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS; 1227 typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS; 1228 typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED; 1229 1230 #define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */ 1231 #define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */ 1232 #define BTA_DM_CONTRL_SCAN 2 /* Scan state - paging/inquiry/trying to connect*/ 1233 #define BTA_DM_CONTRL_IDLE 3 /* Idle state - page scan, LE advt, inquiry scan */ 1234 1235 typedef UINT8 tBTA_DM_CONTRL_STATE; 1236 1237 typedef UINT8 tBTA_DM_BLE_ADV_STATE; 1238 typedef UINT8 tBTA_DM_BLE_ADV_INFO_PRESENT; 1239 typedef UINT8 tBTA_DM_BLE_RSSI_VALUE; 1240 typedef UINT16 tBTA_DM_BLE_ADV_INFO_TIMESTAMP; 1241 1242 typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA; 1243 1244 typedef void (tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value); 1245 1246 typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, UINT8 report_format, 1247 UINT8 num_records, UINT16 data_len, 1248 UINT8 *p_rep_data, tBTA_STATUS status); 1249 1250 typedef void (tBTA_BLE_SCAN_SETUP_CBACK) (tBTA_BLE_BATCH_SCAN_EVT evt, 1251 tBTA_DM_BLE_REF_VALUE ref_value, 1252 tBTA_STATUS status); 1253 1254 typedef void (tBTA_START_STOP_SCAN_CMPL_CBACK) (tBTA_STATUS status); 1255 1256 typedef void (tBTA_START_STOP_ADV_CMPL_CBACK) (tBTA_STATUS status); 1257 1258 typedef void (tBTA_CLEAR_ADV_CMPL_CBACK) (tBTA_STATUS status); 1259 1260 typedef void (tBTA_BLE_TRACK_ADV_CMPL_CBACK)(int action, tBTA_STATUS status, 1261 tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, 1262 tBTA_DM_BLE_REF_VALUE ref_value); 1263 1264 typedef void (tBTA_BLE_TRACK_ADV_CBACK)(tBTA_DM_BLE_TRACK_ADV_DATA *p_adv_data); 1265 1266 typedef void (tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time, 1267 tBTA_DM_BLE_RX_TIME_MS rx_time, 1268 tBTA_DM_BLE_IDLE_TIME_MS idle_time, 1269 tBTA_DM_BLE_ENERGY_USED energy_used, 1270 tBTA_DM_CONTRL_STATE ctrl_state, 1271 tBTA_STATUS status); 1272 1273 #else 1274 typedef UINT8 tBTA_DM_BLE_SEC_ACT; 1275 #endif 1276 1277 /* Maximum service name length */ 1278 #define BTA_SERVICE_NAME_LEN 35 1279 #define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN 1280 #define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN 1281 1282 1283 /* link policy masks */ 1284 #define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH 1285 #define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE 1286 #define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE 1287 #define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE 1288 typedef UINT16 tBTA_DM_LP_MASK; 1289 1290 /* power mode actions */ 1291 #define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */ 1292 #define BTA_DM_PM_PARK 0x10 /* prefers park mode */ 1293 #define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */ 1294 #define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */ 1295 #define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */ 1296 #define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */ 1297 #define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */ 1298 #define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */ 1299 #define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */ 1300 #define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */ 1301 #define BTA_DM_PM_SNIFF_USER0 0x28 /* prefers user-defined sniff0 mode (testtool only) */ 1302 #define BTA_DM_PM_SNIFF_USER1 0x29 /* prefers user-defined sniff1 mode (testtool only) */ 1303 #define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */ 1304 #define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */ 1305 #define BTA_DM_PM_SUSPEND 0x04 /* prefers suspend mode */ 1306 #define BTA_DM_PM_NO_PREF 0x01 /* service has no preference on power mode setting. eg. connection to service got closed */ 1307 1308 typedef UINT8 tBTA_DM_PM_ACTION; 1309 1310 /* index to bta_dm_ssr_spec */ 1311 #define BTA_DM_PM_SSR0 0 1312 #define BTA_DM_PM_SSR1 1 /* BTA_DM_PM_SSR1 will be dedicated for 1313 HH SSR setting entry, no other profile can use it */ 1314 #define BTA_DM_PM_SSR2 2 1315 #define BTA_DM_PM_SSR3 3 1316 #define BTA_DM_PM_SSR4 4 1317 #define BTA_DM_PM_SSR5 5 1318 #define BTA_DM_PM_SSR6 6 1319 1320 #define BTA_DM_PM_NUM_EVTS 9 1321 1322 #ifndef BTA_DM_PM_PARK_IDX 1323 #define BTA_DM_PM_PARK_IDX 5 /* the actual index to bta_dm_pm_md[] for PARK mode */ 1324 #endif 1325 1326 #ifndef BTA_DM_PM_SNIFF_A2DP_IDX 1327 #define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF 1328 #endif 1329 1330 #ifndef BTA_DM_PM_SNIFF_AVK_IDLE_IDX 1331 #define BTA_DM_PM_SNIFF_AVK_IDLE_IDX BTA_DM_PM_SNIFF4 1332 #endif 1333 1334 #ifndef BTA_DM_PM_SNIFF_JV_IDX 1335 #define BTA_DM_PM_SNIFF_JV_IDX BTA_DM_PM_SNIFF 1336 #endif 1337 1338 #ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX 1339 #define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF4 1340 #endif 1341 1342 #ifndef BTA_DM_PM_SNIFF_AG_OPEN_IDX 1343 #define BTA_DM_PM_SNIFF_AG_OPEN_IDX BTA_DM_PM_SNIFF 1344 #endif 1345 1346 #ifndef BTA_DM_PM_SNIFF_AG_IDLE_IDX 1347 #define BTA_DM_PM_SNIFF_AG_IDLE_IDX BTA_DM_PM_SNIFF 1348 #endif 1349 1350 #ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX 1351 #define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3 1352 #endif 1353 1354 #ifndef BTA_DM_PM_SNIFF_SCO_CLOSE_IDX 1355 #define BTA_DM_PM_SNIFF_SCO_CLOSE_IDX BTA_DM_PM_SNIFF 1356 #endif 1357 1358 #ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX 1359 #define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF5 1360 #endif 1361 1362 #ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX 1363 #define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF4 1364 #endif 1365 1366 #ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX 1367 #define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF4 1368 #endif 1369 1370 #ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX 1371 #define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF4 1372 #endif 1373 1374 #ifndef BTA_DM_PM_HH_OPEN_DELAY 1375 #define BTA_DM_PM_HH_OPEN_DELAY 30000 1376 #endif 1377 1378 #ifndef BTA_DM_PM_HH_ACTIVE_DELAY 1379 #define BTA_DM_PM_HH_ACTIVE_DELAY 30000 1380 #endif 1381 1382 #ifndef BTA_DM_PM_HH_IDLE_DELAY 1383 #define BTA_DM_PM_HH_IDLE_DELAY 30000 1384 #endif 1385 1386 /* The Sniff Parameters defined below must be ordered from highest 1387 * latency (biggest interval) to lowest latency. If there is a conflict 1388 * among the connected services the setting with the lowest latency will 1389 * be selected. If a device should override a sniff parameter then it 1390 * must insure that order is maintained. 1391 */ 1392 #ifndef BTA_DM_PM_SNIFF_MAX 1393 #define BTA_DM_PM_SNIFF_MAX 800 1394 #define BTA_DM_PM_SNIFF_MIN 400 1395 #define BTA_DM_PM_SNIFF_ATTEMPT 4 1396 #define BTA_DM_PM_SNIFF_TIMEOUT 1 1397 #endif 1398 1399 #ifndef BTA_DM_PM_SNIFF1_MAX 1400 #define BTA_DM_PM_SNIFF1_MAX 400 1401 #define BTA_DM_PM_SNIFF1_MIN 200 1402 #define BTA_DM_PM_SNIFF1_ATTEMPT 4 1403 #define BTA_DM_PM_SNIFF1_TIMEOUT 1 1404 #endif 1405 1406 #ifndef BTA_DM_PM_SNIFF2_MAX 1407 #define BTA_DM_PM_SNIFF2_MAX 180 //54 1408 #define BTA_DM_PM_SNIFF2_MIN 150 //30 1409 #define BTA_DM_PM_SNIFF2_ATTEMPT 4 1410 #define BTA_DM_PM_SNIFF2_TIMEOUT 1 1411 #endif 1412 1413 #ifndef BTA_DM_PM_SNIFF3_MAX 1414 #define BTA_DM_PM_SNIFF3_MAX 150 1415 #define BTA_DM_PM_SNIFF3_MIN 50 1416 #define BTA_DM_PM_SNIFF3_ATTEMPT 4 1417 #define BTA_DM_PM_SNIFF3_TIMEOUT 1 1418 #endif 1419 1420 #ifndef BTA_DM_PM_SNIFF4_MAX 1421 #define BTA_DM_PM_SNIFF4_MAX 54 //18 1422 #define BTA_DM_PM_SNIFF4_MIN 30 //10 1423 #define BTA_DM_PM_SNIFF4_ATTEMPT 4 1424 #define BTA_DM_PM_SNIFF4_TIMEOUT 1 1425 #endif 1426 1427 #ifndef BTA_DM_PM_SNIFF5_MAX 1428 #define BTA_DM_PM_SNIFF5_MAX 18 1429 #define BTA_DM_PM_SNIFF5_MIN 10 1430 #define BTA_DM_PM_SNIFF5_ATTEMPT 4 1431 #define BTA_DM_PM_SNIFF5_TIMEOUT 1 1432 #endif 1433 1434 #ifndef BTA_DM_PM_PARK_MAX 1435 #define BTA_DM_PM_PARK_MAX 800 1436 #define BTA_DM_PM_PARK_MIN 400 1437 #define BTA_DM_PM_PARK_ATTEMPT 0 1438 #define BTA_DM_PM_PARK_TIMEOUT 0 1439 #endif 1440 1441 1442 /* Switch callback events */ 1443 #define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */ 1444 1445 typedef UINT8 tBTA_DM_SWITCH_EVT; 1446 typedef void (tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, tBTA_STATUS status); 1447 1448 /* Audio routing out configuration */ 1449 #define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */ 1450 #define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */ 1451 #define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */ 1452 #define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */ 1453 #define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */ 1454 #define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */ 1455 #define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */ 1456 #define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */ 1457 #define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */ 1458 1459 typedef UINT8 tBTA_DM_ROUTE_PATH; 1460 1461 #if (SDP_INCLUDED == TRUE) 1462 /* Device Identification (DI) data structure 1463 */ 1464 /* Used to set the DI record */ 1465 typedef tSDP_DI_RECORD tBTA_DI_RECORD; 1466 /* Used to get the DI record */ 1467 typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD; 1468 /* SDP discovery database */ 1469 typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB; 1470 #endif ///SDP_INCLUDED == TRUE 1471 1472 #ifndef BTA_DI_NUM_MAX 1473 #define BTA_DI_NUM_MAX 3 1474 #endif 1475 1476 /* Device features mask definitions */ 1477 #define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE 1478 #define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX 1479 /* ACL type 1480 */ 1481 #define BTA_DM_LINK_TYPE_BR_EDR 0x01 1482 #define BTA_DM_LINK_TYPE_LE 0x02 1483 #define BTA_DM_LINK_TYPE_ALL 0xFF 1484 typedef UINT8 tBTA_DM_LINK_TYPE; 1485 1486 #define IMMEDIATE_DELY_MODE 0x00 1487 #define ONFOUND_DELY_MODE 0x01 1488 #define BATCH_DELY_MODE 0x02 1489 #define ALLOW_ALL_FILTER 0x00 1490 #define LOWEST_RSSI_VALUE 129 1491 #if (BLE_50_FEATURE_SUPPORT == TRUE) 1492 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) 1493 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) 1494 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) 1495 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) 1496 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) 1497 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) 1498 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) 1499 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) 1500 1501 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ 1502 ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ 1503 ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) 1504 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_LD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ 1505 ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ 1506 ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED) 1507 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_HD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ 1508 ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\ 1509 ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED) 1510 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_SCAN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\ 1511 ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE) 1512 #define BTA_DM_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_NONCONN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY) 1513 typedef UINT16 tBTA_DM_BLE_EXT_ADV_TYPE_MASK; 1514 1515 1516 #define BTA_DM_BLE_GAP_PHY_1M 1 1517 #define BTA_DM_BLE_GAP_PHY_2M 2 1518 #define BTA_DM_BLE_GAP_PHY_CODED 3 1519 typedef UINT8 tBTA_DM_BLE_GAP_PHY; 1520 1521 #define BTA_DM_BLE_GAP_PHY_NO_TX_PREF_MASK (0x01) 1522 #define BTA_DM_BLE_GAP_PHY_NO_RX_PREF_MASK (0x02) 1523 #define BTA_DM_BLE_GAP_PHY_1M_PREF_MASK (0x03) 1524 #define BTA_DM_BLE_GAP_PHY_2M_PREF_MASK (0x04) 1525 #define BTA_DM_BLE_GAP_PHY_CODED_PREF_MASK (0x05) 1526 typedef UINT8 tBTA_DM_BLE_GAP_PHY_MASK; 1527 1528 #define BTA_DM_BLE_GAP_EXT_SCAN_UNCODE_MASK 0x01 1529 #define BTA_DM_BLE_GAP_EXT_SCAN_CODE_MASK 0x02 1530 typedef UINT8 tBTA_DM_BLE_EXT_SCAN_CFG_MASK; 1531 1532 1533 typedef struct { 1534 tBTA_DM_BLE_EXT_ADV_TYPE_MASK type; 1535 UINT32 interval_min; 1536 UINT32 interval_max; 1537 tBTA_BLE_ADV_CHNL_MAP channel_map; 1538 tBLE_ADDR_TYPE own_addr_type; 1539 tBLE_ADDR_TYPE peer_addr_type; 1540 BD_ADDR peer_addr; 1541 tBTA_BLE_AFP filter_policy; 1542 INT8 tx_power; 1543 tBTA_DM_BLE_GAP_PHY primary_phy; 1544 UINT8 max_skip; 1545 tBTA_DM_BLE_GAP_PHY secondary_phy; 1546 UINT8 sid; 1547 BOOLEAN scan_req_notif; 1548 } tBTA_DM_BLE_GAP_EXT_ADV_PARAMS; 1549 1550 typedef struct { 1551 UINT8 instance; 1552 int duration; 1553 int max_events; 1554 } tBTA_DM_BLE_EXT_ADV; 1555 1556 typedef struct { 1557 UINT16 interval_min; 1558 UINT16 interval_max; 1559 UINT8 properties; 1560 } tBTA_DM_BLE_Periodic_Adv_Params; 1561 1562 typedef struct { 1563 UINT8 filter_policy; 1564 #if (CONFIG_BT_BLE_FEAT_CREATE_SYNC_ENH) 1565 UINT8 reports_disabled; 1566 UINT8 filter_duplicates; 1567 #endif 1568 UINT8 sid; 1569 tBLE_ADDR_TYPE addr_type; 1570 BD_ADDR addr; 1571 UINT16 skip; 1572 UINT16 sync_timeout; 1573 } tBTA_DM_BLE_Periodic_Sync_Params; 1574 1575 typedef struct { 1576 tBLE_SCAN_MODE scan_type; 1577 UINT16 scan_interval; 1578 UINT16 scan_window; 1579 } tBTA_DM_BLE_EXT_SCAN_CFG; 1580 1581 typedef struct { 1582 tBLE_ADDR_TYPE own_addr_type; 1583 UINT8 filter_policy; 1584 UINT8 scan_duplicate; 1585 tBTA_DM_BLE_EXT_SCAN_CFG_MASK cfg_mask; 1586 tBTA_DM_BLE_EXT_SCAN_CFG uncoded_cfg; 1587 tBTA_DM_BLE_EXT_SCAN_CFG coded_cfg; 1588 } tBTA_DM_BLE_EXT_SCAN_PARAMS; 1589 1590 typedef struct { 1591 UINT16 scan_interval; 1592 UINT16 scan_window; 1593 UINT16 interval_min; 1594 UINT16 interval_max; 1595 UINT16 latency; 1596 UINT16 supervision_timeout; 1597 UINT16 min_ce_len; 1598 UINT16 max_ce_len; 1599 } tBTA_DM_BLE_CONN_PARAMS; 1600 1601 #define BTA_DM_BLE_5_GAP_READ_PHY_COMPLETE_EVT BTM_BLE_5_GAP_READ_PHY_COMPLETE_EVT 1602 #define BTA_DM_BLE_5_GAP_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT BTM_BLE_5_GAP_SET_PREFERED_DEFAULT_PHY_COMPLETE_EVT 1603 #define BTA_DM_BLE_5_GAP_SET_PREFERED_PHY_COMPLETE_EVT BTM_BLE_5_GAP_SET_PREFERED_PHY_COMPLETE_EVT 1604 #define BTA_DM_BLE_5_GAP_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT BTM_BLE_5_GAP_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT 1605 #define BTA_DM_BLE_5_GAP_EXT_ADV_SET_PARAMS_COMPLETE_EVT BTM_BLE_5_GAP_EXT_ADV_SET_PARAMS_COMPLETE_EVT 1606 #define BTA_DM_BLE_5_GAP_EXT_ADV_DATA_SET_COMPLETE_EVT BTM_BLE_5_GAP_EXT_ADV_DATA_SET_COMPLETE_EVT 1607 #define BTA_DM_BLE_5_GAP_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT BTM_BLE_5_GAP_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT 1608 #define BTA_DM_BLE_5_GAP_EXT_ADV_START_COMPLETE_EVT BTM_BLE_5_GAP_EXT_ADV_START_COMPLETE_EVT 1609 #define BTA_DM_BLE_5_GAP_EXT_ADV_STOP_COMPLETE_EVT BTM_BLE_5_GAP_EXT_ADV_STOP_COMPLETE_EVT 1610 #define BTA_DM_BLE_5_GAP_EXT_ADV_SET_REMOVE_COMPLETE_EVT BTM_BLE_5_GAP_EXT_ADV_SET_REMOVE_COMPLETE_EVT 1611 #define BTA_DM_BLE_5_GAP_EXT_ADV_SET_CLEAR_COMPLETE_EVT BTM_BLE_5_GAP_EXT_ADV_SET_CLEAR_COMPLETE_EVT 1612 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT 1613 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_DATA_SET_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_DATA_SET_COMPLETE_EVT 1614 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_START_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_START_COMPLETE_EVT 1615 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_STOP_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_STOP_COMPLETE_EVT 1616 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT 1617 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT 1618 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT 1619 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT 1620 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT 1621 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT BTM_BLE_5_GAP_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT 1622 #define BTA_DM_BLE_5_GAP_SET_EXT_SCAN_PARAMS_COMPLETE_EVT BTM_BLE_5_GAP_SET_EXT_SCAN_PARAMS_COMPLETE_EVT 1623 #define BTA_DM_BLE_5_GAP_EXT_SCAN_START_COMPLETE_EVT BTM_BLE_5_GAP_EXT_SCAN_START_COMPLETE_EVT 1624 #define BTA_DM_BLE_5_GAP_EXT_SCAN_STOP_COMPLETE_EVT BTM_BLE_5_GAP_EXT_SCAN_STOP_COMPLETE_EVT 1625 #define BTA_DM_BLE_5_GAP_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT BTM_BLE_5_GAP_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT 1626 #define BTA_DM_BLE_5_GAP_PHY_UPDATE_COMPLETE_EVT BTM_BLE_5_GAP_PHY_UPDATE_COMPLETE_EVT 1627 #define BTA_DM_BLE_5_GAP_EXT_ADV_REPORT_EVT BTM_BLE_5_GAP_EXT_ADV_REPORT_EVT 1628 #define BTA_DM_BLE_5_GAP_SCAN_TIMEOUT_EVT BTM_BLE_5_GAP_SCAN_TIMEOUT_EVT 1629 #define BTA_DM_BLE_5_GAP_ADV_TERMINATED_EVT BTM_BLE_5_GAP_ADV_TERMINATED_EVT 1630 #define BTA_DM_BLE_5_GAP_SCAN_REQ_RECEIVED_EVT BTM_BLE_5_GAP_SCAN_REQ_RECEIVED_EVT 1631 #define BTA_DM_BLE_5_GAP_CHANNEL_SELETE_ALGORITHM_EVT BTM_BLE_5_GAP_CHANNEL_SELETE_ALGORITHM_EVT 1632 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_REPORT_EVT BTM_BLE_5_GAP_PERIODIC_ADV_REPORT_EVT 1633 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_SYNC_LOST_EVT BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_LOST_EVT 1634 #define BTA_DM_BLE_5_GAP_PERIODIC_ADV_SYNC_ESTAB_EVT BTM_BLE_5_GAP_PERIODIC_ADV_SYNC_ESTAB_EVT 1635 #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) 1636 #define BTA_BLE_GAP_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT BTM_BLE_GAP_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT 1637 #define BTA_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT 1638 #define BTA_BLE_GAP_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT BTM_BLE_GAP_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT 1639 #define BTA_BLE_GAP_SET_PAST_PARAMS_COMPLETE_EVT BTM_BLE_GAP_SET_PAST_PARAMS_COMPLETE_EVT 1640 #define BTA_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_RECV_EVT BTM_BLE_GAP_PERIODIC_ADV_SYNC_TRANS_RECV_EVT 1641 #endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) 1642 #define BTA_DM_BLE_5_GAP_UNKNOWN_EVT BTM_BLE_5_GAP_UNKNOWN_EVT 1643 typedef tBTM_BLE_5_GAP_EVENT tBTA_DM_BLE_5_GAP_EVENT; 1644 1645 typedef tBTM_BLE_5_GAP_CB_PARAMS tBTA_DM_BLE_5_GAP_CB_PARAMS; 1646 typedef tBTM_BLE_5_HCI_CBACK tBTA_DM_BLE_5_HCI_CBCAK; 1647 1648 extern tBTM_BLE_5_HCI_CBACK ble_5_hci_cb; 1649 1650 #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) 1651 1652 #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) 1653 typedef struct { 1654 UINT8 mode; 1655 UINT16 skip; 1656 UINT16 sync_timeout; 1657 UINT8 cte_type; 1658 } tBTA_DM_BLE_PAST_PARAMS; 1659 #endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) 1660 1661 /***************************************************************************** 1662 ** External Function Declarations 1663 *****************************************************************************/ 1664 #ifdef __cplusplus 1665 extern "C" 1666 { 1667 #endif 1668 1669 /******************************************************************************* 1670 ** 1671 ** Function BTA_EnableBluetooth 1672 ** 1673 ** Description This function initializes BTA and prepares BTA and the 1674 ** Bluetooth protocol stack for use. This function is 1675 ** typically called at startup or when Bluetooth services 1676 ** are required by the phone. This function must be called 1677 ** before calling any other API function. 1678 ** 1679 ** 1680 ** Returns BTA_SUCCESS if successful. 1681 ** BTA_FAIL if internal failure. 1682 ** 1683 *******************************************************************************/ 1684 extern tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback); 1685 1686 /******************************************************************************* 1687 ** 1688 ** Function BTA_DisableBluetooth 1689 ** 1690 ** Description This function disables BTA and the Bluetooth protocol 1691 ** stack. It is called when BTA is no longer being used 1692 ** by any application in the system. 1693 ** 1694 ** 1695 ** Returns void 1696 ** 1697 *******************************************************************************/ 1698 extern tBTA_STATUS BTA_DisableBluetooth(void); 1699 1700 /******************************************************************************* 1701 ** 1702 ** Function BTA_EnableTestMode 1703 ** 1704 ** Description Enables bluetooth device under test mode 1705 ** 1706 ** 1707 ** Returns tBTA_STATUS 1708 ** 1709 *******************************************************************************/ 1710 extern tBTA_STATUS BTA_EnableTestMode(void); 1711 1712 /******************************************************************************* 1713 ** 1714 ** Function BTA_DisableTestMode 1715 ** 1716 ** Description Disable bluetooth device under test mode 1717 ** 1718 ** 1719 ** Returns None 1720 ** 1721 *******************************************************************************/ 1722 extern void BTA_DisableTestMode(void); 1723 1724 /******************************************************************************* 1725 ** 1726 ** Function BTA_DmSetDeviceName 1727 ** 1728 ** Description This function sets the Bluetooth name of the local device. 1729 ** 1730 ** 1731 ** Returns void 1732 ** 1733 *******************************************************************************/ 1734 extern void BTA_DmSetDeviceName(const char *p_name); 1735 1736 /******************************************************************************* 1737 ** 1738 ** Function BTA_DmGetDeviceName 1739 ** 1740 ** Description This function gets the Bluetooth name of the local device. 1741 ** 1742 ** 1743 ** Returns void 1744 ** 1745 *******************************************************************************/ 1746 extern void BTA_DmGetDeviceName(tBTA_GET_DEV_NAME_CBACK *p_cback); 1747 1748 extern void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf, tBTA_SEND_VENDOR_HCI_CMPL_CBACK p_vendor_cmd_complete_cback); 1749 1750 /******************************************************************************* 1751 ** 1752 ** Function BTA_DmGetRemoteName 1753 ** 1754 ** Description This function gets the peer device's Bluetooth name. 1755 ** 1756 ** 1757 ** Returns void 1758 ** 1759 *******************************************************************************/ 1760 extern void BTA_DmGetRemoteName(BD_ADDR remote_addr, tBTA_CMPL_CB *read_remote_name_cb); 1761 1762 /******************************************************************************* 1763 ** 1764 ** Function BTA_DmConfigEir 1765 ** 1766 ** Description This function config EIR data of the local device. 1767 ** 1768 ** 1769 ** Returns void 1770 ** 1771 *******************************************************************************/ 1772 extern void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config); 1773 1774 /******************************************************************************* 1775 ** 1776 ** Function BTA_DmSetAfhChannels 1777 ** 1778 ** Description This function sets the AFH channels 1779 ** 1780 ** 1781 ** Returns void 1782 ** 1783 *******************************************************************************/ 1784 void BTA_DmSetAfhChannels(const uint8_t *channels, tBTA_CMPL_CB *set_afh_cb); 1785 1786 #if (BTA_DM_QOS_INCLUDED == TRUE) 1787 /******************************************************************************* 1788 ** 1789 ** Function BTA_DmSetQos 1790 ** 1791 ** Description This function sets the QOS 1792 ** 1793 ** 1794 ** Returns void 1795 ** 1796 *******************************************************************************/ 1797 void BTA_DmSetQos(BD_ADDR bd_addr, UINT32 t_poll, tBTM_CMPL_CB *p_cb); 1798 #endif /// (BTA_DM_QOS_INCLUDED == TRUE) 1799 1800 /******************************************************************************* 1801 ** 1802 ** Function BTA_DmSetAclPktTypes 1803 ** 1804 ** Description This function sets the packet types used for ACL traffic. 1805 ** 1806 ** 1807 ** Returns void 1808 ** 1809 *******************************************************************************/ 1810 void BTA_DmSetAclPktTypes(BD_ADDR remote_addr, UINT16 pkt_types, tBTM_CMPL_CB *p_cb); 1811 1812 #if (BLE_INCLUDED == TRUE) 1813 /******************************************************************************* 1814 ** 1815 ** Function BTA_DmBleSetChannels 1816 ** 1817 ** Description This function sets BLE channels 1818 ** 1819 ** 1820 ** Returns void 1821 ** 1822 *******************************************************************************/ 1823 void BTA_DmBleSetChannels(const uint8_t *channels, tBTA_CMPL_CB *set_channels_cb); 1824 1825 extern void BTA_DmUpdateWhiteList(BOOLEAN add_remove, BD_ADDR remote_addr, tBLE_ADDR_TYPE addr_type, tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb); 1826 1827 extern void BTA_DmClearWhiteList(tBTA_UPDATE_WHITELIST_CBACK *update_wl_cb); 1828 1829 extern void BTA_DmBleReadAdvTxPower(tBTA_CMPL_CB *cmpl_cb); 1830 #endif ///BLE_INCLUDED == TRUE 1831 1832 extern void BTA_DmReadRSSI(BD_ADDR remote_addr, tBTA_TRANSPORT transport, tBTA_CMPL_CB *cmpl_cb); 1833 1834 /******************************************************************************* 1835 ** 1836 ** Function BTA_DmSetVisibility 1837 ** 1838 ** Description This function sets the Bluetooth connectable,discoverable, 1839 ** pairable and conn paired only modesmodes of the local device. 1840 ** This controls whether other Bluetooth devices can find and connect to 1841 ** the local device. 1842 ** 1843 ** 1844 ** Returns void 1845 ** 1846 *******************************************************************************/ 1847 extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, UINT8 pairable_mode, UINT8 conn_filter); 1848 1849 /******************************************************************************* 1850 ** 1851 ** Function BTA_DmSearch 1852 ** 1853 ** Description This function searches for peer Bluetooth devices. It 1854 ** first performs an inquiry; for each device found from the 1855 ** inquiry it gets the remote name of the device. If 1856 ** parameter services is nonzero, service discovery will be 1857 ** performed on each device for the services specified. 1858 ** 1859 ** 1860 ** Returns void 1861 ** 1862 *******************************************************************************/ 1863 extern void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services, 1864 tBTA_DM_SEARCH_CBACK *p_cback); 1865 1866 /******************************************************************************* 1867 ** 1868 ** Function BTA_DmSearchCancel 1869 ** 1870 ** Description This function cancels a search that has been initiated 1871 ** by calling BTA_DmSearch(). 1872 ** 1873 ** 1874 ** Returns void 1875 ** 1876 *******************************************************************************/ 1877 extern void BTA_DmSearchCancel(void); 1878 1879 /******************************************************************************* 1880 ** 1881 ** Function BTA_DmDiscover 1882 ** 1883 ** Description This function performs service discovery for the services 1884 ** of a particular peer device. 1885 ** 1886 ** 1887 ** Returns void 1888 ** 1889 *******************************************************************************/ 1890 #if (SDP_INCLUDED == TRUE) 1891 extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services, 1892 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search); 1893 // btla-specific ++ 1894 /******************************************************************************* 1895 ** 1896 ** Function BTA_DmDiscoverUUID 1897 ** 1898 ** Description This function performs service discovery for the services 1899 ** of a particular peer device. 1900 ** 1901 ** 1902 ** Returns void 1903 ** 1904 *******************************************************************************/ 1905 extern void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid, 1906 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search); 1907 #endif ///SDP_INCLUDED == TRUE 1908 /******************************************************************************* 1909 ** 1910 ** Function BTA_DmGetCachedRemoteName 1911 ** 1912 ** Description Retrieve cached remote name if available 1913 ** 1914 ** Returns BTA_SUCCESS if cached name was retrieved 1915 ** BTA_FAILURE if cached name is not available 1916 ** 1917 *******************************************************************************/ 1918 tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, UINT8 **pp_cached_name); 1919 // btla-specific -- 1920 1921 /******************************************************************************* 1922 ** 1923 ** Function BTA_DmBond 1924 ** 1925 ** Description This function initiates a bonding procedure with a peer 1926 ** device. The bonding procedure enables authentication 1927 ** and optionally encryption on the Bluetooth link. 1928 ** 1929 ** 1930 ** Returns void 1931 ** 1932 *******************************************************************************/ 1933 extern void BTA_DmBond(BD_ADDR bd_addr); 1934 1935 /******************************************************************************* 1936 ** 1937 ** Function BTA_DmBondByTransport 1938 ** 1939 ** Description This function initiates a bonding procedure with a peer 1940 ** device by designated transport. The bonding procedure enables 1941 ** authentication and optionally encryption on the Bluetooth link. 1942 ** 1943 ** 1944 ** Returns void 1945 ** 1946 *******************************************************************************/ 1947 extern void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport); 1948 1949 1950 /******************************************************************************* 1951 ** 1952 ** Function BTA_DmBondCancel 1953 ** 1954 ** Description This function cancels a bonding procedure with a peer 1955 ** device. 1956 ** 1957 ** 1958 ** Returns void 1959 ** 1960 *******************************************************************************/ 1961 extern void BTA_DmBondCancel(BD_ADDR bd_addr); 1962 1963 /******************************************************************************* 1964 ** 1965 ** Function BTA_DMSetPinType 1966 ** 1967 ** Description This function sets pin type as BTM_PIN_TYPE_FIXED or BTM_PIN_TYPE_VARIABLE 1968 ** 1969 ** 1970 ** Returns void 1971 ** 1972 *******************************************************************************/ 1973 extern void BTA_DMSetPinType (UINT8 pin_type, UINT8 *pin_code, UINT8 pin_code_len); 1974 1975 /******************************************************************************* 1976 ** 1977 ** Function BTA_DmPinReply 1978 ** 1979 ** Description This function provides a PIN when one is requested by DM 1980 ** during a bonding procedure. The application should call 1981 ** this function after the security callback is called with 1982 ** a BTA_DM_PIN_REQ_EVT. 1983 ** 1984 ** 1985 ** Returns void 1986 ** 1987 *******************************************************************************/ 1988 extern void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len, 1989 UINT8 *p_pin); 1990 1991 #if (BTM_OOB_INCLUDED == TRUE) 1992 /******************************************************************************* 1993 ** 1994 ** Function BTA_DmLocalOob 1995 ** 1996 ** Description This function retrieves the OOB data from local controller. 1997 ** The result is reported by bta_dm_co_loc_oob(). 1998 ** 1999 ** Returns void 2000 ** 2001 *******************************************************************************/ 2002 extern void BTA_DmLocalOob(void); 2003 2004 /******************************************************************************* 2005 ** 2006 ** Function BTA_DmOobReply 2007 ** 2008 ** This function is called to provide the OOB data for 2009 ** SMP in response to BTA_LE_OOB_REQ_EVT 2010 ** 2011 ** Parameters: bd_addr - Address of the peer device 2012 ** len - length of simple pairing Randomizer C 2013 ** p_value - simple pairing Randomizer C. 2014 ** 2015 ** Returns void 2016 ** 2017 *******************************************************************************/ 2018 extern void BTA_DmOobReply(BD_ADDR bd_addr, UINT8 len, UINT8 *p_value); 2019 2020 /******************************************************************************* 2021 ** 2022 ** Function BTA_DmSecureConnectionOobReply 2023 ** 2024 ** This function is called to provide the OOB data for 2025 ** SMP in response to BTA_LE_OOB_REQ_EVT when secure connection 2026 ** 2027 ** Parameters: bd_addr - Address of the peer device 2028 ** p_c - Pointer to Confirmation 2029 ** p_r - Pointer to Randomizer 2030 ** 2031 ** Returns void 2032 ** 2033 *******************************************************************************/ 2034 extern void BTA_DmSecureConnectionOobReply(BD_ADDR bd_addr, UINT8 *p_c, UINT8 *p_r); 2035 /******************************************************************************* 2036 ** 2037 ** Function BTA_DmSecureConnectionCreateOobData 2038 ** 2039 ** This function is called to create the OOB data for 2040 ** SMP when secure connection 2041 ** 2042 ** Returns void 2043 ** 2044 *******************************************************************************/ 2045 extern void BTA_DmSecureConnectionCreateOobData(void); 2046 #endif /* BTM_OOB_INCLUDED */ 2047 2048 /******************************************************************************* 2049 ** 2050 ** Function BTA_DmConfirm 2051 ** 2052 ** Description This function accepts or rejects the numerical value of the 2053 ** Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT 2054 ** 2055 ** Returns void 2056 ** 2057 *******************************************************************************/ 2058 extern void BTA_DmConfirm(BD_ADDR bd_addr, BOOLEAN accept); 2059 2060 /******************************************************************************* 2061 ** 2062 ** Function BTA_DmPasskeyReqReply 2063 ** 2064 ** Description This function is called to provide the passkey for 2065 ** Simple Pairing in response to BTA_DM_SP_KEY_REQ_EVT 2066 ** 2067 ** Returns void 2068 ** 2069 *******************************************************************************/ 2070 extern void BTA_DmPasskeyReqReply(BOOLEAN accept, BD_ADDR bd_addr, UINT32 passkey); 2071 2072 /******************************************************************************* 2073 ** 2074 ** Function BTA_DmAddDevice 2075 ** 2076 ** Description This function adds a device to the security database list 2077 ** of peer devices. This function would typically be called 2078 ** at system startup to initialize the security database with 2079 ** known peer devices. This is a direct execution function 2080 ** that may lock task scheduling on some platforms. 2081 ** 2082 ** Returns void 2083 ** 2084 *******************************************************************************/ 2085 extern void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class, 2086 LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask, 2087 BOOLEAN is_trusted, UINT8 key_type, 2088 tBTA_IO_CAP io_cap, UINT8 pin_length, 2089 UINT8 sc_support); 2090 2091 /******************************************************************************* 2092 ** 2093 ** Function BTA_DmRemoveDevice 2094 ** 2095 ** Description This function removes a device from the security database. 2096 ** This is a direct execution function that may lock task 2097 ** scheduling on some platforms. 2098 ** 2099 ** 2100 ** Returns BTA_SUCCESS if successful. 2101 ** BTA_FAIL if operation failed. 2102 ** 2103 *******************************************************************************/ 2104 extern tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr, tBT_TRANSPORT transport); 2105 2106 /******************************************************************************* 2107 ** 2108 ** Function BTA_GetEirService 2109 ** 2110 ** Description This function is called to get BTA service mask from EIR. 2111 ** 2112 ** Parameters p_eir - pointer of EIR significant part 2113 ** p_services - return the BTA service mask 2114 ** 2115 ** Returns None 2116 ** 2117 *******************************************************************************/ 2118 extern void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services ); 2119 2120 /******************************************************************************* 2121 ** 2122 ** Function BTA_DmGetConnectionState 2123 ** 2124 ** Description Returns whether the remote device is currently connected. 2125 ** 2126 ** Returns 0 if the device is NOT connected. 2127 ** 2128 *******************************************************************************/ 2129 extern UINT16 BTA_DmGetConnectionState( BD_ADDR bd_addr ); 2130 2131 #if (SDP_INCLUDED == TRUE) 2132 /******************************************************************************* 2133 ** 2134 ** Function BTA_DmSetLocalDiRecord 2135 ** 2136 ** Description This function adds a DI record to the local SDP database. 2137 ** 2138 ** Returns BTA_SUCCESS if record set successfully, otherwise error code. 2139 ** 2140 *******************************************************************************/ 2141 extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info, 2142 UINT32 *p_handle ); 2143 2144 /******************************************************************************* 2145 ** 2146 ** Function BTA_DmRemoveLocalDiRecord 2147 ** 2148 ** Description This function removes a DI record from the local SDP database. 2149 ** 2150 ** Returns BTA_SUCCESS if record is removed successfully, otherwise error code. 2151 ** 2152 *******************************************************************************/ 2153 extern tBTA_STATUS BTA_DmRemoveLocalDiRecord(UINT32 handle); 2154 #endif ///SDP_INCLUDED == TRUE 2155 /******************************************************************************* 2156 ** 2157 ** 2158 ** Function BTA_DmCloseACL 2159 ** 2160 ** Description This function force to close an ACL connection and remove the 2161 ** device from the security database list of known devices. 2162 ** 2163 ** Parameters: bd_addr - Address of the peer device 2164 ** remove_dev - remove device or not after link down 2165 ** transport - which transport to close 2166 2167 ** 2168 ** Returns void. 2169 ** 2170 *******************************************************************************/ 2171 extern void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transport); 2172 2173 /******************************************************************************* 2174 ** 2175 ** Function bta_dmexecutecallback 2176 ** 2177 ** Description This function will request BTA to execute a call back in the context of BTU task 2178 ** This API was named in lower case because it is only intended 2179 ** for the internal customers(like BTIF). 2180 ** 2181 ** Returns void 2182 ** 2183 *******************************************************************************/ 2184 extern void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK *p_callback, void *p_param); 2185 2186 #if (BTM_SCO_HCI_INCLUDED == TRUE) 2187 /******************************************************************************* 2188 ** 2189 ** Function BTA_DmPcmInitSamples 2190 ** 2191 ** Description initialize the down sample converter. 2192 ** 2193 ** src_sps: original samples per second (source audio data) 2194 ** (ex. 44100, 48000) 2195 ** bits: number of bits per pcm sample (16) 2196 ** n_channels: number of channels (i.e. mono(1), stereo(2)...) 2197 ** 2198 ** Returns none 2199 ** 2200 *******************************************************************************/ 2201 extern void BTA_DmPcmInitSamples (UINT32 src_sps, UINT32 bits, UINT32 n_channels); 2202 2203 /******************************************************************************* 2204 ** 2205 ** Function BTA_DmPcmDeinitSamples 2206 ** 2207 ** Description Deinitialize the down sample converter. 2208 ** 2209 ** Returns none 2210 ** 2211 *******************************************************************************/ 2212 extern void BTA_DmPcmDeinitSamples(void); 2213 2214 /************************************************************************************** 2215 ** Function BTA_DmPcmResample 2216 ** 2217 ** Description Down sampling utility to convert higher sampling rate into 8K/16bits 2218 ** PCM samples. 2219 ** 2220 ** Parameters p_src: pointer to the buffer where the original sampling PCM 2221 ** are stored. 2222 ** in_bytes: Length of the input PCM sample buffer in byte. 2223 ** p_dst: pointer to the buffer which is to be used to store 2224 ** the converted PCM samples. 2225 ** 2226 ** 2227 ** Returns INT32: number of samples converted. 2228 ** 2229 **************************************************************************************/ 2230 extern INT32 BTA_DmPcmResample (void *p_src, UINT32 in_bytes, void *p_dst); 2231 #endif 2232 2233 #if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) 2234 /* BLE related API functions */ 2235 /******************************************************************************* 2236 ** 2237 ** Function BTA_DmBleSecurityGrant 2238 ** 2239 ** Description Grant security request access. 2240 ** 2241 ** Parameters: bd_addr - BD address of the peer 2242 ** res - security grant status. 2243 ** 2244 ** Returns void 2245 ** 2246 *******************************************************************************/ 2247 extern void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res); 2248 2249 2250 2251 /******************************************************************************* 2252 ** 2253 ** Function BTA_DmBleSetBgConnType 2254 ** 2255 ** Description This function is called to set BLE connectable mode for a 2256 ** peripheral device. 2257 ** 2258 ** Parameters bg_conn_type: it can be auto connection, or selective connection. 2259 ** p_select_cback: callback function when selective connection procedure 2260 ** is being used. 2261 ** 2262 ** Returns void 2263 ** 2264 *******************************************************************************/ 2265 extern void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type, tBTA_DM_BLE_SEL_CBACK *p_select_cback); 2266 2267 /******************************************************************************* 2268 ** 2269 ** Function BTA_DmBlePasskeyReply 2270 ** 2271 ** Description Send BLE SMP passkey reply. 2272 ** 2273 ** Parameters: bd_addr - BD address of the peer 2274 ** accept - passkey entry successful or declined. 2275 ** passkey - passkey value, must be a 6 digit number, 2276 ** can be lead by 0. 2277 ** 2278 ** Returns void 2279 ** 2280 *******************************************************************************/ 2281 extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, BOOLEAN accept, UINT32 passkey); 2282 2283 /******************************************************************************* 2284 ** 2285 ** Function BTA_DmBleSetStaticPasskey 2286 ** 2287 ** Description Set BLE SMP static passkey. 2288 ** 2289 ** Parameters: add - add static passkey when add is true 2290 ** clear static passkey when add is false 2291 ** passkey - static passkey value 2292 ** 2293 ** 2294 ** Returns void 2295 ** 2296 *******************************************************************************/ 2297 extern void BTA_DmBleSetStaticPasskey(bool add, uint32_t passkey); 2298 2299 /******************************************************************************* 2300 ** 2301 ** Function BTA_DmBleConfirmReply 2302 ** 2303 ** Description Send BLE SMP SC user confirmation reply. 2304 ** 2305 ** Parameters: bd_addr - BD address of the peer 2306 ** accept - numbers to compare are the same or different. 2307 ** 2308 ** Returns void 2309 ** 2310 *******************************************************************************/ 2311 extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, BOOLEAN accept); 2312 2313 /******************************************************************************* 2314 ** 2315 ** Function BTA_DmAddBleDevice 2316 ** 2317 ** Description Add a BLE device. This function will be normally called 2318 ** during host startup to restore all required information 2319 ** for a LE device stored in the NVRAM. 2320 ** 2321 ** Parameters: bd_addr - BD address of the peer 2322 ** dev_type - Remote device's device type. 2323 ** auth_mode - auth mode 2324 ** addr_type - LE device address type. 2325 ** 2326 ** Returns void 2327 ** 2328 *******************************************************************************/ 2329 extern void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, int auth_mode, 2330 tBT_DEVICE_TYPE dev_type); 2331 2332 2333 /******************************************************************************* 2334 ** 2335 ** Function BTA_DmAddBleKey 2336 ** 2337 ** Description Add/modify LE device information. This function will be 2338 ** normally called during host startup to restore all required 2339 ** information stored in the NVRAM. 2340 ** 2341 ** Parameters: bd_addr - BD address of the peer 2342 ** p_le_key - LE key values. 2343 ** key_type - LE SMP key type. 2344 ** 2345 ** Returns void 2346 ** 2347 *******************************************************************************/ 2348 extern void BTA_DmAddBleKey (BD_ADDR bd_addr, 2349 tBTA_LE_KEY_VALUE *p_le_key, 2350 tBTA_LE_KEY_TYPE key_type); 2351 2352 /******************************************************************************* 2353 ** 2354 ** Function BTA_DmSetBlePrefConnParams 2355 ** 2356 ** Description This function is called to set the preferred connection 2357 ** parameters when default connection parameter is not desired. 2358 ** 2359 ** Parameters: bd_addr - BD address of the peripheral 2360 ** min_conn_int - minimum preferred connection interval 2361 ** max_conn_int - maximum preferred connection interval 2362 ** slave_latency - preferred slave latency 2363 ** supervision_tout - preferred supervision timeout 2364 ** 2365 ** 2366 ** Returns void 2367 ** 2368 *******************************************************************************/ 2369 extern void BTA_DmSetBlePrefConnParams(BD_ADDR bd_addr, 2370 UINT16 min_conn_int, UINT16 max_conn_int, 2371 UINT16 slave_latency, UINT16 supervision_tout ); 2372 2373 /******************************************************************************* 2374 ** 2375 ** Function BTA_DmSetBleConnScanParams 2376 ** 2377 ** Description This function is called to set scan parameters used in 2378 ** BLE connection request 2379 ** 2380 ** Parameters: scan_interval - scan interval 2381 ** scan_window - scan window 2382 ** 2383 ** Returns void 2384 ** 2385 *******************************************************************************/ 2386 extern void BTA_DmSetBleConnScanParams(UINT32 scan_interval, 2387 UINT32 scan_window); 2388 2389 /******************************************************************************* 2390 ** 2391 ** Function BTA_DmSetBleScanParams 2392 ** 2393 ** Description This function is called to set scan parameters 2394 ** 2395 ** Parameters: client_if - Client IF 2396 ** scan_interval - scan interval 2397 ** scan_window - scan window 2398 ** scan_mode - scan mode 2399 ** scan_param_setup_status_cback - Set scan param status callback 2400 ** 2401 ** Returns void 2402 ** 2403 *******************************************************************************/ 2404 extern void BTA_DmSetBleScanParams(tGATT_IF client_if, UINT32 scan_interval, 2405 UINT32 scan_window, tBLE_SCAN_MODE scan_mode, 2406 tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_status_cback); 2407 2408 2409 /******************************************************************************* 2410 ** 2411 ** Function BTA_DmSetBleScanFilterParams 2412 ** 2413 ** Description This function is called to set scan parameters 2414 ** 2415 ** Parameters: client_if - Client IF 2416 ** scan_interval - scan interval 2417 ** scan_window - scan window 2418 ** scan_mode - scan mode 2419 ** scan_duplicate_filter - scan duplicate filter 2420 ** scan_param_setup_status_cback - Set scan param status callback 2421 ** 2422 ** Returns void 2423 ** 2424 *******************************************************************************/ 2425 extern void BTA_DmSetBleScanFilterParams(tGATT_IF client_if, UINT32 scan_interval, 2426 UINT32 scan_window, tBLE_SCAN_MODE scan_mode, UINT8 scan_fil_poilcy, 2427 UINT8 addr_type_own, UINT8 scan_duplicate_filter, tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback); 2428 2429 2430 /******************************************************************************* 2431 ** 2432 ** Function BTA_DmSetBleAdvParams 2433 ** 2434 ** Description This function sets the advertising parameters BLE functionality. 2435 ** It is to be called when device act in peripheral or broadcaster 2436 ** role. 2437 ** 2438 ** Parameters: adv_int_min - adv interval minimum 2439 ** adv_int_max - adv interval max 2440 ** p_dir_bda - directed adv initiator address 2441 ** 2442 ** Returns void 2443 ** 2444 *******************************************************************************/ 2445 extern void BTA_DmSetBleAdvParams (UINT16 adv_int_min, UINT16 adv_int_max, 2446 tBLE_BD_ADDR *p_dir_bda); 2447 2448 extern void BTA_DmSetBleAdvParamsAll (UINT16 adv_int_min, UINT16 adv_int_max, 2449 UINT8 adv_type, tBLE_ADDR_TYPE addr_type_own, 2450 tBTM_BLE_ADV_CHNL_MAP chnl_map, tBTM_BLE_AFP adv_fil_pol, 2451 tBLE_BD_ADDR *p_dir_bda, tBTA_START_ADV_CMPL_CBACK p_start_adv_cb); 2452 2453 2454 /******************************************************************************* 2455 ** 2456 ** Function BTA_DmSearchExt 2457 ** 2458 ** Description This function searches for peer Bluetooth devices. It performs 2459 ** an inquiry and gets the remote name for devices. Service 2460 ** discovery is done if services is non zero 2461 ** 2462 ** Parameters p_dm_inq: inquiry conditions 2463 ** services: if service is not empty, service discovery will be done. 2464 ** for all GATT based service condition, put num_uuid, and 2465 ** p_uuid is the pointer to the list of UUID values. 2466 ** p_cback: callback function when search is completed. 2467 ** 2468 ** 2469 ** 2470 ** Returns void 2471 ** 2472 *******************************************************************************/ 2473 extern void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services, 2474 tBTA_DM_SEARCH_CBACK *p_cback); 2475 2476 /******************************************************************************* 2477 ** 2478 ** Function BTA_DmDiscoverExt 2479 ** 2480 ** Description This function does service discovery for services of a 2481 ** peer device. When services.num_uuid is 0, it indicates all 2482 ** GATT based services are to be searched; other wise a list of 2483 ** UUID of interested services should be provided through 2484 ** services.p_uuid. 2485 ** 2486 ** 2487 ** 2488 ** Returns void 2489 ** 2490 *******************************************************************************/ 2491 extern void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services, 2492 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search); 2493 2494 /******************************************************************************* 2495 ** 2496 ** Function BTA_DmDiscoverByTransport 2497 ** 2498 ** Description This function does service discovery on particular transport 2499 ** for services of a 2500 ** peer device. When services.num_uuid is 0, it indicates all 2501 ** GATT based services are to be searched; other wise a list of 2502 ** UUID of interested services should be provided through 2503 ** p_services->p_uuid. 2504 ** 2505 ** 2506 ** 2507 ** Returns void 2508 ** 2509 *******************************************************************************/ 2510 extern void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services, 2511 tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search, 2512 tBTA_TRANSPORT transport); 2513 2514 /******************************************************************************* 2515 ** 2516 ** Function BTA_DmSetEncryption 2517 ** 2518 ** Description This function is called to ensure that connection is 2519 ** encrypted. Should be called only on an open connection. 2520 ** Typically only needed for connections that first want to 2521 ** bring up unencrypted links, then later encrypt them. 2522 ** 2523 ** Parameters: bd_addr - Address of the peer device 2524 ** transport - transport of the link to be encruypted 2525 ** p_callback - Pointer to callback function to indicate the 2526 ** link encryption status 2527 ** sec_act - This is the security action to indicate 2528 ** what knid of BLE security level is required for 2529 ** the BLE link if the BLE is supported 2530 ** Note: This parameter is ignored for the BR/EDR link 2531 ** or the BLE is not supported 2532 ** 2533 ** Returns void 2534 ** 2535 ** 2536 *******************************************************************************/ 2537 extern void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport, 2538 tBTA_DM_ENCRYPT_CBACK *p_callback, 2539 tBTA_DM_BLE_SEC_ACT sec_act); 2540 2541 2542 /******************************************************************************* 2543 ** 2544 ** Function BTA_DmBleObserve 2545 ** 2546 ** Description This procedure keep the device listening for advertising 2547 ** events from a broadcast device. 2548 ** 2549 ** Parameters start: start or stop observe. 2550 ** duration : Duration of the scan. Continuous scan if 0 is passed 2551 ** p_results_cb: Callback to be called with scan results 2552 ** 2553 ** Returns void 2554 ** 2555 *******************************************************************************/ 2556 extern void BTA_DmBleObserve(BOOLEAN start, UINT32 duration, 2557 tBTA_DM_SEARCH_CBACK *p_results_cb, 2558 tBTA_START_STOP_SCAN_CMPL_CBACK *p_start_stop_scan_cb); 2559 2560 /******************************************************************************* 2561 ** 2562 ** Function BTA_DmBleScan 2563 ** 2564 ** Description This procedure keep the device listening for advertising 2565 ** events from a broadcast device. 2566 ** 2567 ** Parameters start: start or stop observe. 2568 ** duration : Duration of the scan. Continuous scan if 0 is passed 2569 ** p_results_cb: Callback to be called with scan results 2570 ** 2571 ** Returns void 2572 ** 2573 *******************************************************************************/ 2574 extern void BTA_DmBleScan(BOOLEAN start, UINT32 duration, 2575 tBTA_DM_SEARCH_CBACK *p_results_cb, 2576 tBTA_START_STOP_SCAN_CMPL_CBACK *p_start_stop_scan_cb); 2577 2578 extern void BTA_DmBleStopAdvertising(void); 2579 2580 extern void BTA_DmSetRandAddress(BD_ADDR rand_addr, tBTA_SET_RAND_ADDR_CBACK *p_set_rand_addr_cback); 2581 extern void BTA_DmClearRandAddress(void); 2582 extern void BTA_DmBleSetRpaTimeout(uint16_t rpa_timeout,tBTA_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback); 2583 extern void BTA_DmBleAddDevToResolvingList(BD_ADDR addr, 2584 uint8_t addr_type, 2585 PEER_IRK irk, 2586 tBTA_ADD_DEV_TO_RESOLVING_LIST_CMPL_CBACK *add_dev_to_resolving_list_callback); 2587 #endif 2588 2589 #if BLE_INCLUDED == TRUE 2590 // btla-specific -- 2591 /******************************************************************************* 2592 ** 2593 ** Function BTA_DmBleConfigLocalPrivacy 2594 ** 2595 ** Description Enable/disable privacy on the local device 2596 ** 2597 ** Parameters: privacy_enable - enable/disable privacy on remote device. 2598 ** set_local_privacy_cback -callback to be called with result 2599 ** Returns void 2600 ** 2601 *******************************************************************************/ 2602 extern void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable, tBTA_SET_LOCAL_PRIVACY_CBACK *set_local_privacy_cback); 2603 2604 /******************************************************************************* 2605 ** 2606 ** Function BTA_DmBleConfigLocalIcon 2607 ** 2608 ** Description set gap local icon 2609 ** 2610 ** Parameters: icon - appearance value. 2611 ** 2612 ** Returns void 2613 ** 2614 *******************************************************************************/ 2615 extern void BTA_DmBleConfigLocalIcon(uint16_t icon); 2616 2617 /******************************************************************************* 2618 ** 2619 ** Function BTA_DmBleEnableRemotePrivacy 2620 ** 2621 ** Description Enable/disable privacy on a remote device 2622 ** 2623 ** Parameters: bd_addr - BD address of the peer 2624 ** privacy_enable - enable/disable privacy on remote device. 2625 ** 2626 ** Returns void 2627 ** 2628 *******************************************************************************/ 2629 extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privacy_enable); 2630 2631 2632 /******************************************************************************* 2633 ** 2634 ** Function BTA_DmBleSetAdvConfig 2635 ** 2636 ** Description This function is called to override the BTA default ADV parameters. 2637 ** 2638 ** Parameters Pointer to User defined ADV data structure 2639 ** 2640 ** Returns None 2641 ** 2642 *******************************************************************************/ 2643 extern void BTA_DmBleSetAdvConfig (tBTA_BLE_AD_MASK data_mask, 2644 tBTA_BLE_ADV_DATA *p_adv_cfg, 2645 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback); 2646 2647 /******************************************************************************* 2648 ** 2649 ** Function BTA_DmBleSetAdvConfigRaw 2650 ** 2651 ** Description This function is called to set raw Advertising data 2652 ** 2653 ** Parameters p_raw_adv : raw advertising data. 2654 ** raw_adv_len : raw advertising data length. 2655 ** p_adv_data_cback : set adv data complete callback. 2656 ** 2657 ** Returns None 2658 ** 2659 *******************************************************************************/ 2660 extern void BTA_DmBleSetAdvConfigRaw (UINT8 *p_raw_adv, UINT32 raw_adv_len, 2661 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback); 2662 2663 /******************************************************************************* 2664 ** 2665 ** Function BTA_DmBleSetLongAdv 2666 ** 2667 ** Description This function is called to set long Advertising data 2668 ** 2669 ** Parameters adv_data : long advertising data. 2670 ** adv_data_len : long advertising data length. 2671 ** p_adv_data_cback : set long adv data complete callback. 2672 ** 2673 ** Returns None 2674 ** 2675 *******************************************************************************/ 2676 void BTA_DmBleSetLongAdv (UINT8 *adv_data, UINT32 adv_data_len, 2677 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback); 2678 2679 /******************************************************************************* 2680 ** 2681 ** Function BTA_DmBleClearAdv 2682 ** 2683 ** Description This function is called to clear Advertising 2684 ** 2685 ** Parameters p_adv_data_cback : clear adv complete callback. 2686 ** 2687 ** Returns None 2688 ** 2689 *******************************************************************************/ 2690 void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback); 2691 2692 /******************************************************************************* 2693 ** 2694 ** Function BTA_DmBleSetScanRsp 2695 ** 2696 ** Description This function is called to override the BTA scan response. 2697 ** 2698 ** Parameters Pointer to User defined ADV data structure 2699 ** 2700 ** Returns None 2701 ** 2702 *******************************************************************************/ 2703 extern void BTA_DmBleSetScanRsp (tBTA_BLE_AD_MASK data_mask, 2704 tBTA_BLE_ADV_DATA *p_adv_cfg, 2705 tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback); 2706 2707 /******************************************************************************* 2708 ** 2709 ** Function BTA_DmBleSetScanRspRaw 2710 ** 2711 ** Description This function is called to set raw scan response data 2712 ** 2713 ** Parameters p_raw_scan_rsp : raw scan_rspertising data. 2714 ** raw_scan_rsp_len : raw scan_rspertising data length. 2715 ** p_scan_rsp_data_cback : set scan_rsp data complete callback. 2716 ** 2717 ** Returns None 2718 ** 2719 *******************************************************************************/ 2720 extern void BTA_DmBleSetScanRspRaw (UINT8 *p_raw_scan_rsp, UINT32 raw_scan_rsp_len, 2721 tBTA_SET_ADV_DATA_CMPL_CBACK *p_scan_rsp_data_cback); 2722 2723 /******************************************************************************* 2724 ** 2725 ** Function BTA_DmUpdateDuplicateExceptionalList 2726 ** 2727 ** Description This function is called to update duplicate scan exceptional list 2728 ** 2729 ** Parameters subcode : add, remove or clean duplicate scan exceptional list. 2730 ** type : device info type. 2731 ** device_info: device info 2732 ** p_update_duplicate_ignore_list_cback : update complete callback. 2733 ** 2734 ** Returns None 2735 ** 2736 *******************************************************************************/ 2737 extern void BTA_DmUpdateDuplicateExceptionalList(UINT8 subcode, UINT32 type, 2738 BD_ADDR device_info, 2739 tBTA_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK p_update_duplicate_exceptional_list_cback); 2740 2741 /******************************************************************************* 2742 ** 2743 ** Function BTA_DmBleBroadcast 2744 ** 2745 ** Description This function starts or stops LE broadcasting. 2746 ** 2747 ** Parameters start: start or stop broadcast. 2748 ** p_start_stop_adv_cb: stop broadcast completed event 2749 ** 2750 ** Returns None 2751 ** 2752 *******************************************************************************/ 2753 extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p_start_stop_adv_cb); 2754 2755 2756 /******************************************************************************* 2757 ** 2758 ** Function BTA_BleEnableAdvInstance 2759 ** 2760 ** Description This function enables the Multi ADV instance feature 2761 ** 2762 ** Parameters p_params Pointer to ADV param user defined structure 2763 ** p_cback Pointer to Multi ADV callback structure 2764 ** p_ref - Reference pointer 2765 ** 2766 ** Returns None 2767 ** 2768 *******************************************************************************/ 2769 extern void BTA_BleEnableAdvInstance (tBTA_BLE_ADV_PARAMS *p_params, 2770 tBTA_BLE_MULTI_ADV_CBACK *p_cback, void *p_ref); 2771 2772 /******************************************************************************* 2773 ** 2774 ** Function BTA_BleUpdateAdvInstParam 2775 ** 2776 ** Description This function updates the Multi ADV instance params 2777 ** 2778 ** Parameters inst_id Instance ID 2779 ** p_params Pointer to ADV param user defined structure 2780 ** 2781 ** Returns None 2782 ** 2783 *******************************************************************************/ 2784 extern void BTA_BleUpdateAdvInstParam (UINT8 inst_id, 2785 tBTA_BLE_ADV_PARAMS *p_params); 2786 2787 /******************************************************************************* 2788 ** 2789 ** Function BTA_BleCfgAdvInstData 2790 ** 2791 ** Description This function is called to configure the ADV instance data 2792 ** 2793 ** Parameters inst_id - Instance ID 2794 ** is_scan_rsp - Boolean value Scan response 2795 ** Pointer to User defined ADV data structure 2796 ** Returns None 2797 ** 2798 *******************************************************************************/ 2799 extern void BTA_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp, 2800 tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_data); 2801 2802 /******************************************************************************* 2803 ** 2804 ** Function BTA_BleDisableAdvInstance 2805 ** 2806 ** Description This function is called to disable the ADV instance 2807 ** 2808 ** Parameters inst_id - Instance ID to be disabled 2809 ** 2810 ** Returns None 2811 ** 2812 *******************************************************************************/ 2813 extern void BTA_BleDisableAdvInstance(UINT8 inst_id); 2814 2815 /******************************************************************************* 2816 ** 2817 ** Function BTA_DmBleUpdateConnectionParams 2818 ** 2819 ** Description Update connection parameters, can only be used when connection is up. 2820 ** 2821 ** Parameters: bd_addr - BD address of the peer 2822 ** min_int - minimum connection interval, [0x0004~ 0x4000] 2823 ** max_int - maximum connection interval, [0x0004~ 0x4000] 2824 ** latency - slave latency [0 ~ 500] 2825 ** timeout - supervision timeout [0x000a ~ 0xc80] 2826 ** 2827 ** Returns void 2828 ** 2829 *******************************************************************************/ 2830 extern void BTA_DmBleUpdateConnectionParams(BD_ADDR bd_addr, UINT16 min_int, 2831 UINT16 max_int, UINT16 latency, UINT16 timeout); 2832 2833 /******************************************************************************* 2834 ** 2835 ** Function BTA_DmBleDisconnect 2836 ** 2837 ** Description This function is to disconnect the ble connection 2838 ** 2839 ** Returns void 2840 ** 2841 *******************************************************************************/ 2842 extern void BTA_DmBleDisconnect(BD_ADDR bd_addr); 2843 2844 /******************************************************************************* 2845 ** 2846 ** Function BTA_DmBleSetDataLength 2847 ** 2848 ** Description This function is to set maximum LE data packet size 2849 ** 2850 ** Returns void 2851 ** 2852 *******************************************************************************/ 2853 extern void BTA_DmBleSetDataLength(BD_ADDR remote_device, UINT16 tx_data_length, tBTA_SET_PKT_DATA_LENGTH_CBACK *p_set_pkt_data_cback); 2854 2855 extern void BTA_DmBleDtmTxStart(uint8_t tx_channel, uint8_t len_of_data, uint8_t pkt_payload, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback); 2856 extern void BTA_DmBleDtmRxStart(uint8_t rx_channel, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback); 2857 extern void BTA_DmBleDtmStop(tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback); 2858 2859 extern void BTA_DmBleSetPrivacyMode(uint8_t addr_type, BD_ADDR addr, uint8_t privacy_mode, tBTA_SET_PRIVACY_MODE_CMPL_CBACK *p_cback); 2860 2861 extern void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback); 2862 2863 /******************************************************************************* 2864 ** 2865 ** Function BTA_DmBleSetStorageParams 2866 ** 2867 ** Description This function is called to set the storage parameters 2868 ** 2869 ** Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning 2870 ** batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning 2871 ** batch_scan_notify_threshold - Setup notification level based on total space 2872 ** consumed by both pools. Setting it to 0 will disable threshold notification 2873 ** p_setup_cback - Setup callback 2874 ** p_thres_cback - Threshold callback 2875 ** p_rep_cback - Reports callback 2876 ** ref_value - Reference value 2877 ** 2878 ** Returns None 2879 ** 2880 *******************************************************************************/ 2881 extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max, 2882 UINT8 batch_scan_trunc_max, 2883 UINT8 batch_scan_notify_threshold, 2884 tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback, 2885 tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback, 2886 tBTA_BLE_SCAN_REP_CBACK *p_rep_cback, 2887 tBTA_DM_BLE_REF_VALUE ref_value); 2888 2889 /******************************************************************************* 2890 ** 2891 ** Function BTA_DmBleEnableBatchScan 2892 ** 2893 ** Description This function is called to enable the batch scan 2894 ** 2895 ** Parameters scan_mode -Batch scan mode 2896 ** scan_interval - Scan interval 2897 ** scan_window - Scan window 2898 ** discard_rule -Discard rules 2899 ** addr_type - Address type 2900 ** ref_value - Reference value 2901 ** 2902 ** Returns None 2903 ** 2904 *******************************************************************************/ 2905 extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode, 2906 UINT32 scan_interval, UINT32 scan_window, 2907 tBTA_BLE_DISCARD_RULE discard_rule, 2908 tBLE_ADDR_TYPE addr_type, 2909 tBTA_DM_BLE_REF_VALUE ref_value); 2910 2911 /******************************************************************************* 2912 ** 2913 ** Function BTA_DmBleReadScanReports 2914 ** 2915 ** Description This function is called to read the batch scan reports 2916 ** 2917 ** Parameters scan_mode -Batch scan mode 2918 ** ref_value - Reference value 2919 ** 2920 ** Returns None 2921 ** 2922 *******************************************************************************/ 2923 extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type, 2924 tBTA_DM_BLE_REF_VALUE ref_value); 2925 2926 /******************************************************************************* 2927 ** 2928 ** Function BTA_DmBleDisableBatchScan 2929 ** 2930 ** Description This function is called to disable the batch scanning 2931 ** 2932 ** Parameters ref_value - Reference value 2933 ** 2934 ** Returns None 2935 ** 2936 *******************************************************************************/ 2937 extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value); 2938 2939 /******************************************************************************* 2940 ** 2941 ** Function BTA_DmEnableScanFilter 2942 ** 2943 ** Description This function is called to enable the adv data payload filter 2944 ** 2945 ** Parameters action - enable or disable the APCF feature 2946 ** p_cmpl_cback - Command completed callback 2947 ** ref_value - Reference value 2948 ** 2949 ** Returns void 2950 ** 2951 *******************************************************************************/ 2952 extern void BTA_DmEnableScanFilter(UINT8 action, 2953 tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback, 2954 tBTA_DM_BLE_REF_VALUE ref_value); 2955 2956 /******************************************************************************* 2957 ** 2958 ** Function BTA_DmBleScanFilterSetup 2959 ** 2960 ** Description This function is called to setup the filter params 2961 ** 2962 ** Parameters p_target: enable the filter condition on a target device; if NULL 2963 ** filt_index - Filter index 2964 ** p_filt_params -Filter parameters 2965 ** ref_value - Reference value 2966 ** action - Add, delete or clear 2967 ** p_cmpl_back - Command completed callback 2968 ** 2969 ** Returns void 2970 ** 2971 *******************************************************************************/ 2972 extern void BTA_DmBleScanFilterSetup(UINT8 action, 2973 tBTA_DM_BLE_PF_FILT_INDEX filt_index, 2974 tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params, 2975 tBLE_BD_ADDR *p_target, 2976 tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback, 2977 tBTA_DM_BLE_REF_VALUE ref_value); 2978 2979 /******************************************************************************* 2980 ** 2981 ** Function BTA_DmBleCfgFilterCondition 2982 ** 2983 ** Description This function is called to configure the adv data payload filter 2984 ** condition. 2985 ** 2986 ** Parameters action: to read/write/clear 2987 ** cond_type: filter condition type 2988 ** filt_index - Filter index 2989 ** p_cond: filter condition parameter 2990 ** p_cmpl_back - Command completed callback 2991 ** ref_value - Reference value 2992 ** 2993 ** Returns void 2994 ** 2995 *******************************************************************************/ 2996 extern void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action, 2997 tBTA_DM_BLE_PF_COND_TYPE cond_type, 2998 tBTA_DM_BLE_PF_FILT_INDEX filt_index, 2999 tBTA_DM_BLE_PF_COND_PARAM *p_cond, 3000 tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback, 3001 tBTA_DM_BLE_REF_VALUE ref_value); 3002 3003 3004 /******************************************************************************* 3005 ** 3006 ** Function BTA_DmBleTrackAdvertiser 3007 ** 3008 ** Description This function is called to track the advertiser 3009 ** 3010 ** Parameters ref_value - Reference value 3011 ** p_track_adv_cback - ADV callback 3012 ** 3013 ** Returns None 3014 ** 3015 *******************************************************************************/ 3016 extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value, 3017 tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback); 3018 3019 /******************************************************************************* 3020 ** 3021 ** Function BTA_DmBleGetEnergyInfo 3022 ** 3023 ** Description This function is called to obtain the energy info 3024 ** 3025 ** Parameters p_cmpl_cback - Command complete callback 3026 ** 3027 ** Returns void 3028 ** 3029 *******************************************************************************/ 3030 extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback); 3031 3032 /******************************************************************************* 3033 ** 3034 ** Function BTA_BrcmInit 3035 ** 3036 ** Description This function initializes Broadcom specific VS handler in BTA 3037 ** 3038 ** Returns void 3039 ** 3040 *******************************************************************************/ 3041 extern void BTA_VendorInit (void); 3042 3043 /******************************************************************************* 3044 ** 3045 ** Function BTA_BrcmCleanup 3046 ** 3047 ** Description This function frees up Broadcom specific VS specific dynamic memory 3048 ** 3049 ** Returns void 3050 ** 3051 *******************************************************************************/ 3052 extern void BTA_VendorCleanup (void); 3053 3054 #if (BLE_50_FEATURE_SUPPORT == TRUE) 3055 extern void BTA_DmBleGapReadPHY(BD_ADDR addr); 3056 3057 extern void BTA_DmBleGapSetPreferedDefaultPHY(tBTA_DM_BLE_GAP_PHY_MASK tx_phy_mask, 3058 tBTA_DM_BLE_GAP_PHY_MASK rx_phy_mask); 3059 3060 extern void BTA_DmBleGapSetPreferedPHY(BD_ADDR addr, 3061 UINT8 all_phys, 3062 tBTA_DM_BLE_GAP_PHY_MASK tx_phy_mask, 3063 tBTA_DM_BLE_GAP_PHY_MASK rx_phy_mask, 3064 UINT16 phy_options); 3065 3066 extern void BTA_DmBleGapExtAdvSetRandaddr(UINT16 instance, BD_ADDR addr); 3067 3068 extern void BTA_DmBleGapExtAdvSetParams(UINT16 instance, 3069 const tBTA_DM_BLE_GAP_EXT_ADV_PARAMS *params); 3070 3071 extern void BTA_DmBleGapConfigExtAdvDataRaw(BOOLEAN is_scan_rsp, UINT8 instance, UINT16 length, 3072 const UINT8 *data); 3073 3074 extern void BTA_DmBleGapStartExtAdv(UINT8 num, tBTA_DM_BLE_EXT_ADV *ext_adv); 3075 3076 extern void BTA_DmBleGapExtAdvEnable(BOOLEAN enable, UINT8 num, tBTA_DM_BLE_EXT_ADV *ext_adv); 3077 3078 extern void BTA_DmBleGapExtAdvSetRemove(UINT8 instance); 3079 3080 extern void BTA_DmBleGapExtAdvSetClear(void); 3081 3082 extern void BTA_DmBleGapPeriodicAdvSetParams(UINT8 instance, 3083 tBTA_DM_BLE_Periodic_Adv_Params *params); 3084 3085 extern void BTA_DmBleGapPeriodicAdvCfgDataRaw(UINT8 instance, UINT16 length, 3086 const UINT8 *data,BOOLEAN only_update_did); 3087 3088 extern void BTA_DmBleGapPeriodicAdvEnable(UINT8 enable, UINT8 instance); 3089 3090 extern void BTA_DmBleGapPeriodicAdvCreateSync(tBTA_DM_BLE_Periodic_Sync_Params *params); 3091 3092 extern void BTA_DmBleGapPeriodicAdvSyncCancel(void); 3093 3094 extern void BTA_DmBleGapPeriodicAdvSyncTerm(UINT16 sync_handle); 3095 3096 extern void BTA_DmBleGapPeriodicAdvAddDevToList(tBLE_ADDR_TYPE addr_type, 3097 BD_ADDR addr, 3098 UINT16 sid); 3099 3100 extern void BTA_DmBleGapPeriodicAdvRemoveDevFromList(tBLE_ADDR_TYPE addr_type, 3101 BD_ADDR addr, 3102 UINT16 sid); 3103 3104 extern void BTA_DmBleGapPeriodicAdvClearDev(void); 3105 3106 extern void BTA_DmBleGapSetExtScanParams(tBTA_DM_BLE_EXT_SCAN_PARAMS *params); 3107 3108 extern void BTA_DmBleGapExtScan(BOOLEAN start, UINT32 duration, UINT16 period); 3109 3110 extern void BTA_DmBleGapPreferExtConnectParamsSet(BD_ADDR bd_addr, 3111 UINT8 phy_mask, 3112 const tBTA_DM_BLE_CONN_PARAMS *phy_1m_conn_params, 3113 const tBTA_DM_BLE_CONN_PARAMS *phy_2m_conn_params, 3114 const tBTA_DM_BLE_CONN_PARAMS *phy_coded_conn_params); 3115 3116 extern void BTA_DmBleGapExtConnect(tBLE_ADDR_TYPE own_addr_type, const BD_ADDR peer_addr); 3117 3118 extern void BTA_DmBleDtmEnhTxStart(uint8_t tx_channel, uint8_t len_of_data, uint8_t pkt_payload, uint8_t phy, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback); 3119 3120 extern void BTA_DmBleDtmEnhRxStart(uint8_t rx_channel, uint8_t phy, uint8_t modulation_index, tBTA_DTM_CMD_CMPL_CBACK *p_dtm_cmpl_cback); 3121 #endif // #if (BLE_50_FEATURE_SUPPORT == TRUE) 3122 3123 #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) 3124 extern void BTA_DmBleGapPeriodicAdvRecvEnable(UINT16 sync_handle, UINT8 enable); 3125 3126 extern void BTA_DmBleGapPeriodicAdvSyncTrans(BD_ADDR peer_addr, UINT16 service_data, UINT16 sync_handle); 3127 3128 extern void BTA_DmBleGapPeriodicAdvSetInfoTrans(BD_ADDR peer_addr, UINT16 service_data, UINT8 adv_handle); 3129 3130 extern void BTA_DmBleGapSetPeriodicAdvSyncTransParams(BD_ADDR peer_addr, tBTA_DM_BLE_PAST_PARAMS *params); 3131 #endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE) 3132 3133 #endif 3134 3135 enum { 3136 BTA_COEX_EVT_SCAN_STARTED = 1, 3137 BTA_COEX_EVT_SCAN_STOPPED, 3138 BTA_COEX_EVT_ACL_CONNECTED, 3139 BTA_COEX_EVT_ACL_DISCONNECTED, 3140 BTA_COEX_EVT_STREAMING_STARTED, 3141 BTA_COEX_EVT_STREAMING_STOPPED, 3142 BTA_COEX_EVT_SNIFF_ENTER, 3143 BTA_COEX_EVT_SNIFF_EXIT, 3144 BTA_COEX_EVT_A2DP_PAUSED_ENTER, 3145 BTA_COEX_EVT_A2DP_PAUSED_EXIT, 3146 }; 3147 3148 extern void BTA_DmCoexEventTrigger(uint32_t event); 3149 3150 #ifdef __cplusplus 3151 } 3152 #endif 3153 3154 #endif /* BTA_API_H */ 3155