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