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