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