The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Jakub Pawlowski | 5b790fe | 2017-09-18 09:00:20 -0700 | [diff] [blame] | 3 | * Copyright 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 | |
Jakub Pawlowski | 7098432 | 2016-12-16 10:43:49 -0800 | [diff] [blame] | 28 | #include <hardware/bt_common_types.h> |
| 29 | #include <memory> |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 30 | #include "bt_target.h" |
| 31 | #include "bt_types.h" |
| 32 | #include "btm_api.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 33 | #include "btm_ble_api.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 34 | |
| 35 | /***************************************************************************** |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 36 | * Constants and data types |
| 37 | ****************************************************************************/ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 38 | |
| 39 | /* Status Return Value */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 40 | #define BTA_SUCCESS 0 /* Successful operation. */ |
| 41 | #define BTA_FAILURE 1 /* Generic failure. */ |
| 42 | #define BTA_PENDING 2 /* API cannot be completed right now */ |
| 43 | #define BTA_BUSY 3 |
| 44 | #define BTA_NO_RESOURCES 4 |
| 45 | #define BTA_WRONG_MODE 5 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 46 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 47 | typedef uint8_t tBTA_STATUS; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 48 | |
| 49 | /* |
| 50 | * Service ID |
| 51 | * |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 52 | * NOTES: When you add a new Service ID for BTA AND require to change the value |
| 53 | * of BTA_MAX_SERVICE_ID, |
| 54 | * make sure that the correct security ID of the new service from |
| 55 | * Security service definitions (btm_api.h) |
| 56 | * should be added to bta_service_id_to_btm_srv_id_lkup_tbl table in |
| 57 | * bta_dm_act.c. |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 58 | */ |
| 59 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 60 | #define BTA_RES_SERVICE_ID 0 /* Reserved */ |
| 61 | #define BTA_SPP_SERVICE_ID 1 /* Serial port profile. */ |
| 62 | #define BTA_DUN_SERVICE_ID 2 /* Dial-up networking profile. */ |
| 63 | #define BTA_A2DP_SOURCE_SERVICE_ID 3 /* A2DP Source profile. */ |
| 64 | #define BTA_LAP_SERVICE_ID 4 /* LAN access profile. */ |
| 65 | #define BTA_HSP_SERVICE_ID 5 /* Headset profile. */ |
| 66 | #define BTA_HFP_SERVICE_ID 6 /* Hands-free profile. */ |
| 67 | #define BTA_OPP_SERVICE_ID 7 /* Object push */ |
| 68 | #define BTA_FTP_SERVICE_ID 8 /* File transfer */ |
| 69 | #define BTA_CTP_SERVICE_ID 9 /* Cordless Terminal */ |
| 70 | #define BTA_ICP_SERVICE_ID 10 /* Intercom Terminal */ |
| 71 | #define BTA_SYNC_SERVICE_ID 11 /* Synchronization */ |
| 72 | #define BTA_BPP_SERVICE_ID 12 /* Basic printing profile */ |
| 73 | #define BTA_BIP_SERVICE_ID 13 /* Basic Imaging profile */ |
| 74 | #define BTA_PANU_SERVICE_ID 14 /* PAN User */ |
| 75 | #define BTA_NAP_SERVICE_ID 15 /* PAN Network access point */ |
| 76 | #define BTA_GN_SERVICE_ID 16 /* PAN Group Ad-hoc networks */ |
| 77 | #define BTA_SAP_SERVICE_ID 17 /* SIM Access profile */ |
| 78 | #define BTA_A2DP_SINK_SERVICE_ID 18 /* A2DP Sink */ |
| 79 | #define BTA_AVRCP_SERVICE_ID 19 /* A/V remote control */ |
| 80 | #define BTA_HID_SERVICE_ID 20 /* HID */ |
| 81 | #define BTA_VDP_SERVICE_ID 21 /* Video distribution */ |
| 82 | #define BTA_PBAP_SERVICE_ID 22 /* PhoneBook Access Server*/ |
| 83 | #define BTA_HSP_HS_SERVICE_ID 23 /* HFP HS role */ |
| 84 | #define BTA_HFP_HS_SERVICE_ID 24 /* HSP HS role */ |
| 85 | #define BTA_MAP_SERVICE_ID 25 /* Message Access Profile */ |
| 86 | #define BTA_MN_SERVICE_ID 26 /* Message Notification Service */ |
| 87 | #define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */ |
Hemant Gupta | 8843cc8 | 2014-04-18 12:34:55 +0530 | [diff] [blame] | 88 | #define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client */ |
| 89 | #define BTA_SDP_SERVICE_ID 29 /* SDP Search */ |
| 90 | #define BTA_HIDD_SERVICE_ID 30 /* HID Device */ |
Myles Watson | 9979121 | 2016-11-18 08:42:23 -0800 | [diff] [blame] | 91 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 92 | /* BLE profile service ID */ |
Hemant Gupta | 8843cc8 | 2014-04-18 12:34:55 +0530 | [diff] [blame] | 93 | #define BTA_BLE_SERVICE_ID 31 /* GATT profile */ |
| 94 | #define BTA_USER_SERVICE_ID 32 /* User requested UUID */ |
| 95 | #define BTA_MAX_SERVICE_ID 33 |
Myles Watson | 9979121 | 2016-11-18 08:42:23 -0800 | [diff] [blame] | 96 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 97 | /* service IDs (BTM_SEC_SERVICE_FIRST_EMPTY + 1) to (BTM_SEC_MAX_SERVICES - 1) |
| 98 | * are used by BTA JV */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 99 | #define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1) |
| 100 | #define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 101 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 102 | typedef uint8_t tBTA_SERVICE_ID; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 103 | |
| 104 | /* Service ID Mask */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 105 | #define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */ |
| 106 | #define BTA_SPP_SERVICE_MASK 0x00000002 /* Serial port profile. */ |
| 107 | #define BTA_DUN_SERVICE_MASK 0x00000004 /* Dial-up networking profile. */ |
| 108 | #define BTA_FAX_SERVICE_MASK 0x00000008 /* Fax profile. */ |
| 109 | #define BTA_LAP_SERVICE_MASK 0x00000010 /* LAN access profile. */ |
| 110 | #define BTA_HSP_SERVICE_MASK 0x00000020 /* HSP AG role. */ |
| 111 | #define BTA_HFP_SERVICE_MASK 0x00000040 /* HFP AG role */ |
| 112 | #define BTA_OPP_SERVICE_MASK 0x00000080 /* Object push */ |
| 113 | #define BTA_FTP_SERVICE_MASK 0x00000100 /* File transfer */ |
| 114 | #define BTA_CTP_SERVICE_MASK 0x00000200 /* Cordless Terminal */ |
| 115 | #define BTA_ICP_SERVICE_MASK 0x00000400 /* Intercom Terminal */ |
| 116 | #define BTA_SYNC_SERVICE_MASK 0x00000800 /* Synchronization */ |
| 117 | #define BTA_BPP_SERVICE_MASK 0x00001000 /* Print server */ |
| 118 | #define BTA_BIP_SERVICE_MASK 0x00002000 /* Basic Imaging */ |
| 119 | #define BTA_PANU_SERVICE_MASK 0x00004000 /* PAN User */ |
| 120 | #define BTA_NAP_SERVICE_MASK 0x00008000 /* PAN Network access point */ |
| 121 | #define BTA_GN_SERVICE_MASK 0x00010000 /* PAN Group Ad-hoc networks */ |
| 122 | #define BTA_SAP_SERVICE_MASK 0x00020000 /* PAN Group Ad-hoc networks */ |
| 123 | #define BTA_A2DP_SERVICE_MASK 0x00040000 /* Advanced audio distribution */ |
| 124 | #define BTA_AVRCP_SERVICE_MASK 0x00080000 /* A/V remote control */ |
| 125 | #define BTA_HID_SERVICE_MASK 0x00100000 /* HID */ |
| 126 | #define BTA_VDP_SERVICE_MASK 0x00200000 /* Video distribution */ |
| 127 | #define BTA_PBAP_SERVICE_MASK 0x00400000 /* Phone Book Server */ |
| 128 | #define BTA_HSP_HS_SERVICE_MASK 0x00800000 /* HFP HS role */ |
| 129 | #define BTA_HFP_HS_SERVICE_MASK 0x01000000 /* HSP HS role */ |
| 130 | #define BTA_MAS_SERVICE_MASK 0x02000000 /* Message Access Profile */ |
| 131 | #define BTA_MN_SERVICE_MASK 0x04000000 /* Message Notification Profile */ |
| 132 | #define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */ |
| 133 | #define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */ |
Hemant Gupta | 8843cc8 | 2014-04-18 12:34:55 +0530 | [diff] [blame] | 134 | #define BTA_HIDD_SERVICE_MASK 0x20000000 /* HID Device */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 135 | |
Hemant Gupta | 8843cc8 | 2014-04-18 12:34:55 +0530 | [diff] [blame] | 136 | #define BTA_BLE_SERVICE_MASK 0x40000000 /* GATT based service */ |
| 137 | #define BTA_ALL_SERVICE_MASK 0x7FFFFFFF /* All services supported by BTA. */ |
| 138 | #define BTA_USER_SERVICE_MASK 0x80000000 /* Message Notification Profile */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 139 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 140 | typedef uint32_t tBTA_SERVICE_MASK; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 141 | |
| 142 | /* extended service mask, including mask with one or more GATT UUID */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 143 | typedef struct { |
| 144 | tBTA_SERVICE_MASK srvc_mask; |
| 145 | uint8_t num_uuid; |
Jakub Pawlowski | 819e2ec | 2017-07-10 09:56:09 -0700 | [diff] [blame] | 146 | bluetooth::Uuid* p_uuid; |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 147 | } tBTA_SERVICE_MASK_EXT; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 148 | |
| 149 | /* Security Setting Mask */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 150 | #define BTA_SEC_NONE BTM_SEC_NONE /* No security. */ |
| 151 | #define BTA_SEC_AUTHORIZE \ |
| 152 | (BTM_SEC_IN_AUTHORIZE) /* Authorization required (only needed for out \ |
| 153 | going connection )*/ |
| 154 | #define BTA_SEC_AUTHENTICATE \ |
| 155 | (BTM_SEC_IN_AUTHENTICATE | \ |
| 156 | BTM_SEC_OUT_AUTHENTICATE) /* Authentication required. */ |
| 157 | #define BTA_SEC_ENCRYPT \ |
| 158 | (BTM_SEC_IN_ENCRYPT | BTM_SEC_OUT_ENCRYPT) /* Encryption required. */ |
| 159 | #define BTA_SEC_MODE4_LEVEL4 \ |
| 160 | (BTM_SEC_MODE4_LEVEL4) /* Mode 4 level 4 service, i.e. incoming/outgoing \ |
| 161 | MITM and P-256 encryption */ |
| 162 | #define BTA_SEC_MITM \ |
| 163 | (BTM_SEC_IN_MITM | BTM_SEC_OUT_MITM) /* Man-In-The_Middle protection */ |
| 164 | #define BTA_SEC_IN_16_DIGITS \ |
| 165 | (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] | 166 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 167 | typedef uint16_t tBTA_SEC; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 168 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 169 | /* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only |
| 170 | * device modes */ |
| 171 | #define BTA_DM_IGNORE 0x00FF |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 172 | |
VenkatRaghavan VijayaRaghavan | 76356ae | 2015-04-21 11:32:29 -0700 | [diff] [blame] | 173 | /* Ignore for Discoverable, Connectable only for LE modes */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 174 | #define BTA_DM_LE_IGNORE 0xFF00 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 175 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 176 | #define BTA_APP_ID_PAN_MULTI 0xFE /* app id for pan multiple connection */ |
| 177 | #define BTA_ALL_APP_ID 0xFF |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 178 | |
| 179 | /* Discoverable Modes */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 180 | #define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */ |
| 181 | #define BTA_DM_GENERAL_DISC \ |
| 182 | BTM_GENERAL_DISCOVERABLE /* General discoverable. \ |
| 183 | */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 184 | #define BTA_DM_BLE_NON_DISCOVERABLE \ |
| 185 | BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */ |
| 186 | #define BTA_DM_BLE_GENERAL_DISCOVERABLE \ |
| 187 | BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */ |
| 188 | #define BTA_DM_BLE_LIMITED_DISCOVERABLE \ |
| 189 | BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 190 | typedef uint16_t |
| 191 | tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and |
| 192 | LE mode */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 193 | |
| 194 | /* Connectable Modes */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 195 | #define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */ |
| 196 | #define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 197 | #define BTA_DM_BLE_NON_CONNECTABLE \ |
| 198 | BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */ |
| 199 | #define BTA_DM_BLE_CONNECTABLE \ |
| 200 | BTM_BLE_CONNECTABLE /* Device is LE connectable. */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 201 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 202 | typedef uint16_t tBTA_DM_CONN; |
Ganesh Ganapathi Batta | 7fa4fba | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 203 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 204 | #define BTA_TRANSPORT_UNKNOWN 0 |
| 205 | #define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR |
| 206 | #define BTA_TRANSPORT_LE BT_TRANSPORT_LE |
Ganesh Ganapathi Batta | 7fa4fba | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 207 | typedef tBT_TRANSPORT tBTA_TRANSPORT; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 208 | |
| 209 | /* Pairable Modes */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 210 | #define BTA_DM_PAIRABLE 1 |
| 211 | #define BTA_DM_NON_PAIRABLE 0 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 212 | |
| 213 | /* Connectable Paired Only Mode */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 214 | #define BTA_DM_CONN_ALL 0 |
| 215 | #define BTA_DM_CONN_PAIRED 1 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 216 | |
| 217 | /* Inquiry Modes */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 218 | #define BTA_DM_INQUIRY_NONE BTM_INQUIRY_NONE /*No BR inquiry. */ |
| 219 | #define BTA_DM_GENERAL_INQUIRY \ |
| 220 | BTM_GENERAL_INQUIRY /* Perform general inquiry. */ |
| 221 | #define BTA_DM_LIMITED_INQUIRY \ |
| 222 | BTM_LIMITED_INQUIRY /* Perform limited inquiry. */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 223 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 224 | #define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE |
| 225 | #define BTA_BLE_GENERAL_INQUIRY \ |
| 226 | BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */ |
| 227 | #define BTA_BLE_LIMITED_INQUIRY \ |
| 228 | BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 229 | typedef uint8_t tBTA_DM_INQ_MODE; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 230 | |
| 231 | /* Inquiry Filter Type */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 232 | #define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */ |
| 233 | #define BTA_DM_INQ_DEV_CLASS \ |
| 234 | BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */ |
| 235 | #define BTA_DM_INQ_BD_ADDR \ |
| 236 | BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 237 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 238 | typedef uint8_t tBTA_DM_INQ_FILT; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 239 | |
| 240 | /* Authorize Response */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 241 | #define BTA_DM_AUTH_PERM \ |
| 242 | 0 /* Authorized for future connections to the service */ |
| 243 | #define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */ |
| 244 | #define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 245 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 246 | typedef uint8_t tBTA_AUTH_RESP; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 247 | |
| 248 | /* M/S preferred roles */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 249 | #define BTA_ANY_ROLE 0x00 |
| 250 | #define BTA_MASTER_ROLE_PREF 0x01 |
| 251 | #define BTA_MASTER_ROLE_ONLY 0x02 |
| 252 | #define BTA_SLAVE_ROLE_ONLY \ |
| 253 | 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] | 254 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 255 | typedef uint8_t tBTA_PREF_ROLES; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 256 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 257 | enum { |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 258 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 259 | BTA_DM_NO_SCATTERNET, /* Device doesn't support scatternet, it might |
| 260 | support "role switch during connection" for |
| 261 | an incoming connection, when it already has |
| 262 | another connection in master role */ |
| 263 | BTA_DM_PARTIAL_SCATTERNET, /* Device supports partial scatternet. It can have |
| 264 | simulateous connection in Master and Slave roles |
| 265 | for short period of time */ |
| 266 | BTA_DM_FULL_SCATTERNET /* Device can have simultaneous connection in master |
| 267 | and slave roles */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 268 | |
| 269 | }; |
| 270 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 271 | /* Inquiry filter device class condition */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 272 | typedef struct { |
| 273 | DEV_CLASS dev_class; /* device class of interest */ |
| 274 | DEV_CLASS dev_class_mask; /* mask to determine the bits of device class of |
| 275 | interest */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 276 | } tBTA_DM_COD_COND; |
| 277 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 278 | /* Inquiry Filter Condition */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 279 | typedef union { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 280 | RawAddress bd_addr; /* BD address of device to filter. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 281 | tBTA_DM_COD_COND dev_class_cond; /* Device class filter condition */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 282 | } tBTA_DM_INQ_COND; |
| 283 | |
| 284 | /* Inquiry Parameters */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 285 | typedef struct { |
| 286 | tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */ |
| 287 | uint8_t duration; /* Inquiry duration in 1.28 sec units. */ |
| 288 | uint8_t max_resps; /* Maximum inquiry responses. Set to zero for unlimited |
| 289 | responses. */ |
| 290 | bool report_dup; /* report duplicated inquiry response with higher RSSI value |
| 291 | */ |
| 292 | tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */ |
| 293 | tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 294 | #if (BTA_HOST_INTERLEAVE_SEARCH == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 295 | uint8_t intl_duration |
| 296 | [4]; /*duration array storing the interleave scan's time portions*/ |
Matthew Xie | 7f3e429 | 2013-09-30 12:44:10 -0700 | [diff] [blame] | 297 | #endif |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 298 | } tBTA_DM_INQ; |
| 299 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 300 | typedef struct { |
| 301 | uint8_t bta_dm_eir_min_name_len; /* minimum length of local name when it is |
| 302 | shortened */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 303 | #if (BTA_EIR_CANNED_UUID_LIST == TRUE) |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 304 | uint8_t bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */ |
| 305 | uint8_t* bta_dm_eir_uuid16; /* 16-bit UUIDs */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 306 | #else |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 307 | 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] | 308 | #endif |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 309 | int8_t* bta_dm_eir_inq_tx_power; /* Inquiry TX power */ |
| 310 | uint8_t bta_dm_eir_flag_len; /* length of flags in bytes */ |
| 311 | uint8_t* bta_dm_eir_flags; /* flags for EIR */ |
| 312 | uint8_t bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in |
| 313 | bytes */ |
| 314 | uint8_t* bta_dm_eir_manufac_spec; /* manufacturer specific */ |
| 315 | uint8_t bta_dm_eir_additional_len; /* length of additional data in bytes */ |
| 316 | uint8_t* bta_dm_eir_additional; /* additional data */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 317 | } tBTA_DM_EIR_CONF; |
| 318 | |
Wei Wang | a6ce775 | 2014-05-20 06:30:32 +0000 | [diff] [blame] | 319 | /* advertising filter policy */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 320 | typedef tBTM_BLE_AFP tBTA_BLE_AFP; |
Wei Wang | a6ce775 | 2014-05-20 06:30:32 +0000 | [diff] [blame] | 321 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 322 | enum { |
| 323 | BTA_BLE_BATCH_SCAN_MODE_PASS = 1, |
| 324 | BTA_BLE_BATCH_SCAN_MODE_ACTI = 2, |
| 325 | BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3 |
Satya Calloji | c4e2596 | 2014-05-10 23:46:24 -0700 | [diff] [blame] | 326 | }; |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 327 | typedef uint8_t tBTA_BLE_BATCH_SCAN_MODE; |
Satya Calloji | c4e2596 | 2014-05-10 23:46:24 -0700 | [diff] [blame] | 328 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 329 | enum { BTA_BLE_DISCARD_OLD_ITEMS = 0, BTA_BLE_DISCARD_LOWER_RSSI_ITEMS = 1 }; |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 330 | typedef uint8_t tBTA_BLE_DISCARD_RULE; |
Satya Calloji | c4e2596 | 2014-05-10 23:46:24 -0700 | [diff] [blame] | 331 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 332 | enum { BTA_BLE_ADV_SEEN_FIRST_TIME = 0, BTA_BLE_ADV_TRACKING_TIMEOUT = 1 }; |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 333 | typedef uint8_t tBTA_BLE_ADV_CHANGE_REASON; |
Satya Calloji | c4e2596 | 2014-05-10 23:46:24 -0700 | [diff] [blame] | 334 | |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 335 | /* BLE customer specific feature function type definitions */ |
| 336 | /* data type used on customer specific feature for RSSI monitoring */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 337 | #define BTA_BLE_RSSI_ALERT_HI 0 |
| 338 | #define BTA_BLE_RSSI_ALERT_RANGE 1 |
| 339 | #define BTA_BLE_RSSI_ALERT_LO 2 |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 340 | typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_TYPE; |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 341 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 342 | #define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */ |
| 343 | #define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */ |
| 344 | #define BTA_BLE_RSSI_ALERT_RANGE_BIT \ |
| 345 | BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */ |
| 346 | #define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */ |
| 347 | typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_MASK; |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 348 | |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 349 | typedef void(tBTA_DM_BLE_RSSI_CBACK)(const RawAddress& bd_addr, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 350 | tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, |
| 351 | int8_t rssi); |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 352 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 353 | typedef int8_t tBTA_DM_RSSI_VALUE; |
| 354 | typedef uint8_t tBTA_DM_LINK_QUALITY_VALUE; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 355 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 356 | typedef uint8_t tBTA_SIG_STRENGTH_MASK; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 357 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 358 | /* Security Callback Events */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 359 | #define BTA_DM_ENABLE_EVT 0 /* Enable Event */ |
| 360 | #define BTA_DM_DISABLE_EVT 1 /* Disable Event */ |
| 361 | #define BTA_DM_PIN_REQ_EVT 2 /* PIN request. */ |
| 362 | #define BTA_DM_AUTH_CMPL_EVT 3 /* Authentication complete indication. */ |
| 363 | #define BTA_DM_AUTHORIZE_EVT 4 /* Authorization request. */ |
| 364 | #define BTA_DM_LINK_UP_EVT 5 /* Connection UP event */ |
| 365 | #define BTA_DM_LINK_DOWN_EVT 6 /* Connection DOWN event */ |
| 366 | #define BTA_DM_SIG_STRENGTH_EVT \ |
| 367 | 7 /* Signal strength for bluetooth connection \ |
| 368 | */ |
| 369 | #define BTA_DM_BUSY_LEVEL_EVT 8 /* System busy level */ |
| 370 | #define BTA_DM_BOND_CANCEL_CMPL_EVT 9 /* Bond cancel complete indication */ |
| 371 | #define BTA_DM_SP_CFM_REQ_EVT \ |
| 372 | 10 /* Simple Pairing User Confirmation request. \ |
| 373 | */ |
| 374 | #define BTA_DM_SP_KEY_NOTIF_EVT 11 /* Simple Pairing Passkey Notification */ |
| 375 | #define BTA_DM_SP_RMT_OOB_EVT 12 /* Simple Pairing Remote OOB Data request. */ |
| 376 | #define BTA_DM_SP_KEYPRESS_EVT 13 /* Key press notification event. */ |
| 377 | #define BTA_DM_ROLE_CHG_EVT 14 /* Role Change event. */ |
| 378 | #define BTA_DM_BLE_KEY_EVT 15 /* BLE SMP key event for peer device keys */ |
| 379 | #define BTA_DM_BLE_SEC_REQ_EVT 16 /* BLE SMP security request */ |
| 380 | #define BTA_DM_BLE_PASSKEY_NOTIF_EVT 17 /* SMP passkey notification event */ |
| 381 | #define BTA_DM_BLE_PASSKEY_REQ_EVT 18 /* SMP passkey request event */ |
| 382 | #define BTA_DM_BLE_OOB_REQ_EVT 19 /* SMP OOB request event */ |
| 383 | #define BTA_DM_BLE_LOCAL_IR_EVT 20 /* BLE local IR event */ |
| 384 | #define BTA_DM_BLE_LOCAL_ER_EVT 21 /* BLE local ER event */ |
| 385 | #define BTA_DM_BLE_NC_REQ_EVT 22 /* SMP Numeric Comparison request event */ |
| 386 | #define BTA_DM_SP_RMT_OOB_EXT_EVT \ |
| 387 | 23 /* Simple Pairing Remote OOB Extended Data request. */ |
| 388 | #define BTA_DM_BLE_AUTH_CMPL_EVT 24 /* BLE Auth complete */ |
| 389 | #define BTA_DM_DEV_UNPAIRED_EVT 25 |
| 390 | #define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */ |
| 391 | #define BTA_DM_LE_FEATURES_READ \ |
| 392 | 27 /* Cotroller specific LE features are read \ |
| 393 | */ |
| 394 | #define BTA_DM_ENER_INFO_READ 28 /* Energy info read */ |
| 395 | #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] | 396 | typedef uint8_t tBTA_DM_SEC_EVT; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 397 | |
| 398 | /* Structure associated with BTA_DM_ENABLE_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 399 | typedef struct { tBTA_STATUS status; } tBTA_DM_ENABLE; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 400 | |
| 401 | /* Structure associated with BTA_DM_PIN_REQ_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 402 | typedef struct { |
| 403 | /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in |
| 404 | * order */ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 405 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 406 | DEV_CLASS dev_class; /* Class of Device */ |
| 407 | BD_NAME bd_name; /* Name of peer device. */ |
| 408 | 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] | 409 | } tBTA_DM_PIN_REQ; |
| 410 | |
| 411 | /* BLE related definition */ |
| 412 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 413 | #define BTA_DM_AUTH_FAIL_BASE (HCI_ERR_MAX_ERR + 10) |
Jacky Cheung | 07c7892 | 2016-07-06 15:11:30 -0700 | [diff] [blame] | 414 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 415 | /* Converts SMP error codes defined in smp_api.h to SMP auth fail reasons below. |
| 416 | */ |
| 417 | #define BTA_DM_AUTH_CONVERT_SMP_CODE(x) (BTA_DM_AUTH_FAIL_BASE + (x)) |
Jacky Cheung | 07c7892 | 2016-07-06 15:11:30 -0700 | [diff] [blame] | 418 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 419 | #define BTA_DM_AUTH_SMP_PASSKEY_FAIL \ |
| 420 | (BTA_DM_AUTH_FAIL_BASE + SMP_PASSKEY_ENTRY_FAIL) |
| 421 | #define BTA_DM_AUTH_SMP_OOB_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_OOB_FAIL) |
| 422 | #define BTA_DM_AUTH_SMP_PAIR_AUTH_FAIL \ |
| 423 | (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_AUTH_FAIL) |
| 424 | #define BTA_DM_AUTH_SMP_CONFIRM_VALUE_FAIL \ |
| 425 | (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_VALUE_ERR) |
| 426 | #define BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT \ |
| 427 | (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_NOT_SUPPORT) |
| 428 | #define BTA_DM_AUTH_SMP_ENC_KEY_SIZE (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_KEY_SIZE) |
| 429 | #define BTA_DM_AUTH_SMP_INVALID_CMD (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_CMD) |
| 430 | #define BTA_DM_AUTH_SMP_UNKNOWN_ERR \ |
| 431 | (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_FAIL_UNKNOWN) |
| 432 | #define BTA_DM_AUTH_SMP_REPEATED_ATTEMPT \ |
| 433 | (BTA_DM_AUTH_FAIL_BASE + SMP_REPEATED_ATTEMPTS) |
| 434 | #define BTA_DM_AUTH_SMP_INVALID_PARAMETERS \ |
| 435 | (BTA_DM_AUTH_FAIL_BASE + SMP_INVALID_PARAMETERS) |
| 436 | #define BTA_DM_AUTH_SMP_INTERNAL_ERR \ |
| 437 | (BTA_DM_AUTH_FAIL_BASE + SMP_PAIR_INTERNAL_ERR) |
| 438 | #define BTA_DM_AUTH_SMP_UNKNOWN_IO (BTA_DM_AUTH_FAIL_BASE + SMP_UNKNOWN_IO_CAP) |
| 439 | #define BTA_DM_AUTH_SMP_INIT_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_INIT_FAIL) |
| 440 | #define BTA_DM_AUTH_SMP_CONFIRM_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_CONFIRM_FAIL) |
| 441 | #define BTA_DM_AUTH_SMP_BUSY (BTA_DM_AUTH_FAIL_BASE + SMP_BUSY) |
| 442 | #define BTA_DM_AUTH_SMP_ENC_FAIL (BTA_DM_AUTH_FAIL_BASE + SMP_ENC_FAIL) |
| 443 | #define BTA_DM_AUTH_SMP_RSP_TIMEOUT (BTA_DM_AUTH_FAIL_BASE + SMP_RSP_TIMEOUT) |
| 444 | #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] | 445 | |
| 446 | /* connection parameter boundary value and dummy value */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 447 | #define BTA_DM_BLE_SCAN_INT_MIN BTM_BLE_SCAN_INT_MIN |
| 448 | #define BTA_DM_BLE_SCAN_INT_MAX BTM_BLE_SCAN_INT_MAX |
| 449 | #define BTA_DM_BLE_SCAN_WIN_MIN BTM_BLE_SCAN_WIN_MIN |
| 450 | #define BTA_DM_BLE_SCAN_WIN_MAX BTM_BLE_SCAN_WIN_MAX |
| 451 | #define BTA_DM_BLE_CONN_INT_MIN BTM_BLE_CONN_INT_MIN |
| 452 | #define BTA_DM_BLE_CONN_INT_MAX BTM_BLE_CONN_INT_MAX |
| 453 | #define BTA_DM_BLE_CONN_LATENCY_MAX BTM_BLE_CONN_LATENCY_MAX |
| 454 | #define BTA_DM_BLE_CONN_SUP_TOUT_MIN BTM_BLE_CONN_SUP_TOUT_MIN |
| 455 | #define BTA_DM_BLE_CONN_SUP_TOUT_MAX BTM_BLE_CONN_SUP_TOUT_MAX |
| 456 | #define BTA_DM_BLE_CONN_PARAM_UNDEF \ |
| 457 | BTM_BLE_CONN_PARAM_UNDEF /* use this value when a specific value not to be \ |
| 458 | overwritten */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 459 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 460 | #define BTA_LE_KEY_PENC \ |
| 461 | BTM_LE_KEY_PENC /* encryption information of peer device */ |
| 462 | #define BTA_LE_KEY_PID BTM_LE_KEY_PID /* identity key of the peer device */ |
| 463 | #define BTA_LE_KEY_PCSRK BTM_LE_KEY_PCSRK /* peer SRK */ |
| 464 | #define BTA_LE_KEY_LENC \ |
| 465 | BTM_LE_KEY_LENC /* master role security information:div */ |
| 466 | #define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */ |
| 467 | #define BTA_LE_KEY_LCSRK \ |
| 468 | BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 469 | 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] | 470 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 471 | typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 472 | typedef tBTM_LE_PCSRK_KEYS tBTA_LE_PCSRK_KEYS; |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 473 | typedef tBTM_LE_LENC_KEYS tBTA_LE_LENC_KEYS; |
| 474 | typedef tBTM_LE_LCSRK_KEYS tBTA_LE_LCSRK_KEYS; |
| 475 | typedef tBTM_LE_PID_KEYS tBTA_LE_PID_KEYS; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 476 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 477 | typedef union { |
| 478 | tBTA_LE_PENC_KEYS penc_key; /* received peer encryption key */ |
| 479 | tBTA_LE_PCSRK_KEYS psrk_key; /* received peer device SRK */ |
| 480 | tBTA_LE_PID_KEYS pid_key; /* peer device ID key */ |
| 481 | tBTA_LE_LENC_KEYS |
| 482 | lenc_key; /* local encryption reproduction keys LTK = = d1(ER,DIV,0)*/ |
| 483 | tBTA_LE_LCSRK_KEYS lcsrk_key; /* local device CSRK = d1(ER,DIV,1)*/ |
| 484 | tBTA_LE_PID_KEYS lid_key; /* local device ID key for the particular remote */ |
| 485 | } tBTA_LE_KEY_VALUE; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 486 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 487 | #define BTA_BLE_LOCAL_KEY_TYPE_ID 1 |
| 488 | #define BTA_BLE_LOCAL_KEY_TYPE_ER 2 |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 489 | typedef uint8_t tBTA_DM_BLE_LOCAL_KEY_MASK; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 490 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 491 | typedef struct { |
| 492 | BT_OCTET16 ir; |
| 493 | BT_OCTET16 irk; |
| 494 | BT_OCTET16 dhk; |
| 495 | } tBTA_BLE_LOCAL_ID_KEYS; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 496 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 497 | #define BTA_DM_SEC_GRANTED BTA_SUCCESS |
| 498 | #define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT |
| 499 | #define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 500 | typedef uint8_t tBTA_DM_BLE_SEC_GRANT; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 501 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 502 | /* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 503 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 504 | RawAddress bd_addr; /* peer address */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 505 | BD_NAME bd_name; /* peer device name */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 506 | } tBTA_DM_BLE_SEC_REQ; |
| 507 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 508 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 509 | RawAddress bd_addr; /* peer address */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 510 | tBTM_LE_KEY_TYPE key_type; |
| 511 | tBTM_LE_KEY_VALUE* p_key_value; |
| 512 | } tBTA_DM_BLE_KEY; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 513 | |
| 514 | /* Structure associated with BTA_DM_AUTH_CMPL_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 515 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 516 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 517 | BD_NAME bd_name; /* Name of peer device. */ |
| 518 | bool key_present; /* Valid link key value in key element */ |
| 519 | LINK_KEY key; /* Link key associated with peer device. */ |
| 520 | uint8_t key_type; /* The type of Link Key */ |
| 521 | bool success; /* true of authentication succeeded, false if failed. */ |
| 522 | uint8_t fail_reason; /* The HCI reason/error code for when success=false */ |
| 523 | tBLE_ADDR_TYPE addr_type; /* Peer device address type */ |
| 524 | tBT_DEVICE_TYPE dev_type; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 525 | } tBTA_DM_AUTH_CMPL; |
| 526 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 527 | /* Structure associated with BTA_DM_AUTHORIZE_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 528 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 529 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 530 | BD_NAME bd_name; /* Name of peer device. */ |
| 531 | tBTA_SERVICE_ID service; /* Service ID to authorize. */ |
| 532 | DEV_CLASS dev_class; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 533 | } tBTA_DM_AUTHORIZE; |
| 534 | |
| 535 | /* Structure associated with BTA_DM_LINK_UP_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 536 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 537 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 538 | tBTA_TRANSPORT link_type; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 539 | } tBTA_DM_LINK_UP; |
| 540 | |
| 541 | /* Structure associated with BTA_DM_LINK_DOWN_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 542 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 543 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 544 | uint8_t status; /* connection open/closed */ |
| 545 | bool is_removed; /* true if device is removed when link is down */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 546 | tBTA_TRANSPORT link_type; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 547 | } tBTA_DM_LINK_DOWN; |
| 548 | |
| 549 | /* Structure associated with BTA_DM_ROLE_CHG_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 550 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 551 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 552 | uint8_t new_role; /* the new connection role */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 553 | } tBTA_DM_ROLE_CHG; |
| 554 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 555 | /* Structure associated with BTA_DM_BUSY_LEVEL_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 556 | typedef struct { |
| 557 | uint8_t level; /* when paging or inquiring, level is 10. |
| 558 | Otherwise, the number of ACL links */ |
| 559 | uint8_t level_flags; /* indicates individual flags */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 560 | } tBTA_DM_BUSY_LEVEL; |
| 561 | |
Myles Watson | 2e8e9f4 | 2016-11-14 16:45:15 -0800 | [diff] [blame] | 562 | #define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */ |
| 563 | #define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */ |
| 564 | #define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */ |
| 565 | #define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 566 | #define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 567 | typedef tBTM_IO_CAP tBTA_IO_CAP; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 568 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 569 | #define BTA_AUTH_SP_NO \ |
| 570 | BTM_AUTH_SP_NO /* 0 MITM Protection Not Required - Single \ |
| 571 | Profile/non-bonding \ |
| 572 | Numeric comparison with automatic accept allowed */ |
| 573 | #define BTA_AUTH_SP_YES \ |
| 574 | BTM_AUTH_SP_YES /* 1 MITM Protection Required - Single Profile/non-bonding \ |
| 575 | Use IO Capabilities to determine authentication procedure \ |
| 576 | */ |
| 577 | #define BTA_AUTH_AP_NO \ |
| 578 | BTM_AUTH_AP_NO /* 2 MITM Protection Not Required - All Profiles/dedicated \ |
| 579 | bonding \ |
| 580 | Numeric comparison with automatic accept allowed */ |
| 581 | #define BTA_AUTH_AP_YES \ |
| 582 | BTM_AUTH_AP_YES /* 3 MITM Protection Required - All Profiles/dedicated \ |
| 583 | bonding \ |
| 584 | Use IO Capabilities to determine authentication procedure \ |
| 585 | */ |
| 586 | #define BTA_AUTH_SPGB_NO \ |
| 587 | BTM_AUTH_SPGB_NO /* 4 MITM Protection Not Required - Single Profiles/general \ |
| 588 | bonding \ |
| 589 | Numeric comparison with automatic accept allowed */ |
| 590 | #define BTA_AUTH_SPGB_YES \ |
| 591 | BTM_AUTH_SPGB_YES /* 5 MITM Protection Required - Single Profiles/general \ |
| 592 | bonding \ |
| 593 | Use IO Capabilities to determine authentication \ |
| 594 | procedure */ |
| 595 | typedef tBTM_AUTH_REQ tBTA_AUTH_REQ; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 596 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 597 | #define BTA_AUTH_DD_BOND \ |
| 598 | BTM_AUTH_DD_BOND /* 2 this bit is set for dedicated bonding */ |
| 599 | #define BTA_AUTH_GEN_BOND \ |
| 600 | BTM_AUTH_SPGB_NO /* 4 this bit is set for general bonding */ |
| 601 | #define BTA_AUTH_BONDS \ |
| 602 | BTM_AUTH_BONDS /* 6 the general/dedicated bonding bits */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 603 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 604 | #define BTA_LE_AUTH_NO_BOND BTM_LE_AUTH_REQ_NO_BOND /* 0*/ |
| 605 | #define BTA_LE_AUTH_BOND BTM_LE_AUTH_REQ_BOND /* 1 << 0 */ |
| 606 | #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] | 607 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 608 | #define BTA_LE_AUTH_REQ_SC_ONLY BTM_LE_AUTH_REQ_SC_ONLY /* 1 << 3 */ |
| 609 | #define BTA_LE_AUTH_REQ_SC_BOND BTM_LE_AUTH_REQ_SC_BOND /* 1001 */ |
| 610 | #define BTA_LE_AUTH_REQ_SC_MITM BTM_LE_AUTH_REQ_SC_MITM /* 1100 */ |
| 611 | #define BTA_LE_AUTH_REQ_SC_MITM_BOND BTM_LE_AUTH_REQ_SC_MITM_BOND /* 1101 */ |
| 612 | typedef tBTM_LE_AUTH_REQ |
| 613 | tBTA_LE_AUTH_REQ; /* combination of the above bit pattern */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 614 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 615 | #define BTA_OOB_NONE BTM_OOB_NONE |
| 616 | #define BTA_OOB_PRESENT BTM_OOB_PRESENT |
| 617 | #define BTA_OOB_UNKNOWN BTM_OOB_UNKNOWN |
Jakub Pawlowski | 175da70 | 2015-11-12 15:00:58 -0800 | [diff] [blame] | 618 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 619 | typedef tBTM_OOB_DATA tBTA_OOB_DATA; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 620 | |
| 621 | /* Structure associated with BTA_DM_SP_CFM_REQ_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 622 | typedef struct { |
| 623 | /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in |
| 624 | * order */ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 625 | RawAddress bd_addr; /* peer address */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 626 | DEV_CLASS dev_class; /* peer CoD */ |
| 627 | BD_NAME bd_name; /* peer device name */ |
| 628 | uint32_t num_val; /* the numeric value for comparison. If just_works, do not |
| 629 | show this number to UI */ |
| 630 | bool just_works; /* true, if "Just Works" association model */ |
| 631 | tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */ |
| 632 | tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */ |
| 633 | tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */ |
| 634 | tBTA_AUTH_REQ rmt_io_caps; /* IO Capabilities of remote device */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 635 | } tBTA_DM_SP_CFM_REQ; |
| 636 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 637 | enum { |
| 638 | BTA_SP_KEY_STARTED, /* passkey entry started */ |
| 639 | BTA_SP_KEY_ENTERED, /* passkey digit entered */ |
| 640 | BTA_SP_KEY_ERASED, /* passkey digit erased */ |
| 641 | BTA_SP_KEY_CLEARED, /* passkey cleared */ |
| 642 | BTA_SP_KEY_COMPLT /* passkey entry completed */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 643 | }; |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 644 | typedef uint8_t tBTA_SP_KEY_TYPE; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 645 | |
| 646 | /* Structure associated with BTA_DM_SP_KEYPRESS_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 647 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 648 | RawAddress bd_addr; /* peer address */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 649 | tBTA_SP_KEY_TYPE notif_type; |
| 650 | } tBTA_DM_SP_KEY_PRESS; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 651 | |
| 652 | /* Structure associated with BTA_DM_SP_KEY_NOTIF_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 653 | typedef struct { |
| 654 | /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in |
| 655 | * order */ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 656 | RawAddress bd_addr; /* peer address */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 657 | DEV_CLASS dev_class; /* peer CoD */ |
| 658 | BD_NAME bd_name; /* peer device name */ |
| 659 | uint32_t passkey; /* the numeric value for comparison. If just_works, do not |
| 660 | show this number to UI */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 661 | } tBTA_DM_SP_KEY_NOTIF; |
| 662 | |
| 663 | /* Structure associated with BTA_DM_SP_RMT_OOB_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 664 | typedef struct { |
| 665 | /* Note: First 3 data members must be, bd_addr, dev_class, and bd_name in |
| 666 | * order */ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 667 | RawAddress bd_addr; /* peer address */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 668 | DEV_CLASS dev_class; /* peer CoD */ |
| 669 | BD_NAME bd_name; /* peer device name */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 670 | } tBTA_DM_SP_RMT_OOB; |
| 671 | |
| 672 | /* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 673 | typedef struct { |
| 674 | 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] | 675 | } tBTA_DM_BOND_CANCEL_CMPL; |
| 676 | |
| 677 | /* Union of all security callback structures */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 678 | typedef union { |
| 679 | tBTA_DM_ENABLE enable; /* BTA enabled */ |
| 680 | tBTA_DM_PIN_REQ pin_req; /* PIN request. */ |
| 681 | tBTA_DM_AUTH_CMPL auth_cmpl; /* Authentication complete indication. */ |
| 682 | tBTA_DM_AUTHORIZE authorize; /* Authorization request. */ |
| 683 | tBTA_DM_LINK_UP link_up; /* ACL connection down event */ |
| 684 | tBTA_DM_LINK_DOWN link_down; /* ACL connection down event */ |
| 685 | tBTA_DM_BUSY_LEVEL busy_level; /* System busy level */ |
| 686 | tBTA_DM_SP_CFM_REQ cfm_req; /* user confirm request */ |
| 687 | tBTA_DM_SP_KEY_NOTIF key_notif; /* passkey notification */ |
| 688 | tBTA_DM_SP_RMT_OOB rmt_oob; /* remote oob */ |
| 689 | tBTA_DM_BOND_CANCEL_CMPL |
| 690 | bond_cancel_cmpl; /* Bond Cancel Complete indication */ |
| 691 | tBTA_DM_SP_KEY_PRESS key_press; /* key press notification event */ |
| 692 | tBTA_DM_ROLE_CHG role_chg; /* role change event */ |
| 693 | tBTA_DM_BLE_SEC_REQ ble_req; /* BLE SMP related request */ |
| 694 | tBTA_DM_BLE_KEY ble_key; /* BLE SMP keys used when pairing */ |
| 695 | tBTA_BLE_LOCAL_ID_KEYS ble_id_keys; /* IR event */ |
| 696 | BT_OCTET16 ble_er; /* ER event data */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 697 | } tBTA_DM_SEC; |
| 698 | |
| 699 | /* Security callback */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 700 | typedef void(tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 701 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 702 | #define BTA_DM_BLE_PF_LIST_LOGIC_OR 1 |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 703 | #define BTA_DM_BLE_PF_FILT_LOGIC_OR 0 |
Satya Calloji | 1a9247a | 2014-06-05 13:15:15 -0700 | [diff] [blame] | 704 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 705 | /* Search callback events */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 706 | #define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */ |
| 707 | #define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */ |
| 708 | #define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */ |
| 709 | #define BTA_DM_DISC_BLE_RES_EVT \ |
| 710 | 3 /* Discovery result for BLE GATT based servoce on a peer device. */ |
| 711 | #define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */ |
| 712 | #define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */ |
| 713 | #define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 714 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 715 | typedef uint8_t tBTA_DM_SEARCH_EVT; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 716 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 717 | #define BTA_DM_INQ_RES_IGNORE_RSSI \ |
| 718 | BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 719 | |
| 720 | /* Structure associated with BTA_DM_INQ_RES_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 721 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 722 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 723 | DEV_CLASS dev_class; /* Device class of peer device. */ |
| 724 | bool remt_name_not_required; /* Application sets this flag if it already knows |
| 725 | the name of the device */ |
| 726 | /* If the device name is known to application BTA skips the remote name |
| 727 | * request */ |
| 728 | bool is_limited; /* true, if the limited inquiry bit is set in the CoD */ |
| 729 | int8_t rssi; /* The rssi value */ |
| 730 | uint8_t* p_eir; /* received EIR */ |
Jakub Pawlowski | f7100bb | 2017-02-13 14:31:52 -0800 | [diff] [blame] | 731 | uint16_t eir_len; /* received EIR length */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 732 | uint8_t inq_result_type; |
| 733 | uint8_t ble_addr_type; |
Jakub Pawlowski | d64bf4f | 2017-01-27 05:53:07 -0800 | [diff] [blame] | 734 | uint16_t ble_evt_type; |
Jakub Pawlowski | 7de0f9b | 2017-01-27 08:06:20 -0800 | [diff] [blame] | 735 | uint8_t ble_primary_phy; |
| 736 | uint8_t ble_secondary_phy; |
| 737 | uint8_t ble_advertising_sid; |
| 738 | int8_t ble_tx_power; |
| 739 | uint16_t ble_periodic_adv_int; |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 740 | tBT_DEVICE_TYPE device_type; |
| 741 | uint8_t flag; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 742 | } tBTA_DM_INQ_RES; |
| 743 | |
| 744 | /* Structure associated with BTA_DM_INQ_CMPL_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 745 | typedef struct { |
| 746 | uint8_t num_resps; /* Number of inquiry responses. */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 747 | } tBTA_DM_INQ_CMPL; |
| 748 | |
| 749 | /* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 750 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 751 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 752 | uint8_t num_record; /* Number of DI record */ |
| 753 | tBTA_STATUS result; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 754 | } tBTA_DM_DI_DISC_CMPL; |
| 755 | |
| 756 | /* Structure associated with BTA_DM_DISC_RES_EVT */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 757 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 758 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 759 | BD_NAME bd_name; /* Name of peer device. */ |
| 760 | tBTA_SERVICE_MASK services; /* Services found on peer device. */ |
| 761 | uint8_t* p_raw_data; /* Raw data for discovery DB */ |
| 762 | uint32_t raw_data_size; /* size of raw data */ |
| 763 | tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */ |
| 764 | uint32_t num_uuids; |
Jakub Pawlowski | 819e2ec | 2017-07-10 09:56:09 -0700 | [diff] [blame] | 765 | bluetooth::Uuid* p_uuid_list; |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 766 | tBTA_STATUS result; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 767 | } tBTA_DM_DISC_RES; |
| 768 | |
| 769 | /* Structure associated with tBTA_DM_DISC_BLE_RES */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 770 | typedef struct { |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 771 | RawAddress bd_addr; /* BD address peer device. */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 772 | BD_NAME bd_name; /* Name of peer device. */ |
Jakub Pawlowski | 819e2ec | 2017-07-10 09:56:09 -0700 | [diff] [blame] | 773 | bluetooth::Uuid service; /* GATT based Services UUID found on peer device. */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 774 | } tBTA_DM_DISC_BLE_RES; |
| 775 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 776 | /* Union of all search callback structures */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 777 | typedef union { |
| 778 | tBTA_DM_INQ_RES inq_res; /* Inquiry result for a peer device. */ |
| 779 | tBTA_DM_INQ_CMPL inq_cmpl; /* Inquiry complete. */ |
| 780 | tBTA_DM_DISC_RES disc_res; /* Discovery result for a peer device. */ |
| 781 | tBTA_DM_DISC_BLE_RES |
| 782 | disc_ble_res; /* discovery result for GATT based service */ |
| 783 | tBTA_DM_DI_DISC_CMPL di_disc; /* DI discovery result for a peer device */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 784 | |
| 785 | } tBTA_DM_SEARCH; |
| 786 | |
| 787 | /* Search callback */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 788 | typedef void(tBTA_DM_SEARCH_CBACK)(tBTA_DM_SEARCH_EVT event, |
| 789 | tBTA_DM_SEARCH* p_data); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 790 | |
| 791 | /* Execute call back */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 792 | typedef void(tBTA_DM_EXEC_CBACK)(void* p_param); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 793 | |
| 794 | /* Encryption callback*/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 795 | typedef void(tBTA_DM_ENCRYPT_CBACK)(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 796 | tBTA_TRANSPORT transport, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 797 | tBTA_STATUS result); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 798 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 799 | #define BTA_DM_BLE_SEC_NONE BTM_BLE_SEC_NONE |
| 800 | #define BTA_DM_BLE_SEC_ENCRYPT BTM_BLE_SEC_ENCRYPT |
| 801 | #define BTA_DM_BLE_SEC_NO_MITM BTM_BLE_SEC_ENCRYPT_NO_MITM |
| 802 | #define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM |
| 803 | typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT; |
Satya Calloji | c4e2596 | 2014-05-10 23:46:24 -0700 | [diff] [blame] | 804 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 805 | typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS; |
| 806 | typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS; |
| 807 | typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS; |
| 808 | typedef tBTM_BLE_ENERGY_USED tBTA_DM_BLE_ENERGY_USED; |
Satya Calloji | e5ba884 | 2014-07-03 17:18:02 -0700 | [diff] [blame] | 809 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 810 | #define BTA_DM_CONTRL_UNKNOWN 0 /* Unknown state */ |
| 811 | #define BTA_DM_CONTRL_ACTIVE 1 /* ACL link on, SCO link ongoing, sniff mode */ |
| 812 | #define BTA_DM_CONTRL_SCAN \ |
| 813 | 2 /* Scan state - paging/inquiry/trying to \ |
| 814 | connect*/ |
| 815 | #define BTA_DM_CONTRL_IDLE \ |
| 816 | 3 /* Idle state - page scan, LE advt, inquiry scan \ |
| 817 | */ |
Satya Calloji | e5ba884 | 2014-07-03 17:18:02 -0700 | [diff] [blame] | 818 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 819 | typedef uint8_t tBTA_DM_CONTRL_STATE; |
Satya Calloji | e5ba884 | 2014-07-03 17:18:02 -0700 | [diff] [blame] | 820 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 821 | typedef uint8_t tBTA_DM_BLE_ADV_STATE; |
| 822 | typedef uint8_t tBTA_DM_BLE_ADV_INFO_PRESENT; |
| 823 | typedef uint8_t tBTA_DM_BLE_RSSI_VALUE; |
| 824 | typedef uint16_t tBTA_DM_BLE_ADV_INFO_TIMESTAMP; |
Satya Calloji | f538707 | 2015-02-09 17:40:52 -0800 | [diff] [blame] | 825 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 826 | typedef void(tBTA_BLE_ENERGY_INFO_CBACK)(tBTA_DM_BLE_TX_TIME_MS tx_time, |
| 827 | tBTA_DM_BLE_RX_TIME_MS rx_time, |
| 828 | tBTA_DM_BLE_IDLE_TIME_MS idle_time, |
| 829 | tBTA_DM_BLE_ENERGY_USED energy_used, |
| 830 | tBTA_DM_CONTRL_STATE ctrl_state, |
| 831 | tBTA_STATUS status); |
Satya Calloji | e5ba884 | 2014-07-03 17:18:02 -0700 | [diff] [blame] | 832 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 833 | /* Maximum service name length */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 834 | #define BTA_SERVICE_NAME_LEN 35 |
| 835 | #define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN |
| 836 | #define BTA_PROVIDER_NAME_LEN BTA_SERVICE_NAME_LEN |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 837 | |
| 838 | /* link policy masks */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 839 | #define BTA_DM_LP_SWITCH HCI_ENABLE_MASTER_SLAVE_SWITCH |
| 840 | #define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE |
| 841 | #define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE |
| 842 | #define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 843 | typedef uint16_t tBTA_DM_LP_MASK; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 844 | |
| 845 | /* power mode actions */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 846 | #define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */ |
| 847 | #define BTA_DM_PM_PARK 0x10 /* prefers park mode */ |
| 848 | #define BTA_DM_PM_SNIFF 0x20 /* prefers sniff mode */ |
| 849 | #define BTA_DM_PM_SNIFF1 0x21 /* prefers sniff1 mode */ |
| 850 | #define BTA_DM_PM_SNIFF2 0x22 /* prefers sniff2 mode */ |
| 851 | #define BTA_DM_PM_SNIFF3 0x23 /* prefers sniff3 mode */ |
| 852 | #define BTA_DM_PM_SNIFF4 0x24 /* prefers sniff4 mode */ |
| 853 | #define BTA_DM_PM_SNIFF5 0x25 /* prefers sniff5 mode */ |
| 854 | #define BTA_DM_PM_SNIFF6 0x26 /* prefers sniff6 mode */ |
| 855 | #define BTA_DM_PM_SNIFF7 0x27 /* prefers sniff7 mode */ |
| 856 | #define BTA_DM_PM_SNIFF_USER0 \ |
| 857 | 0x28 /* prefers user-defined sniff0 mode (testtool only) */ |
| 858 | #define BTA_DM_PM_SNIFF_USER1 \ |
| 859 | 0x29 /* prefers user-defined sniff1 mode (testtool only) */ |
| 860 | #define BTA_DM_PM_ACTIVE 0x40 /* prefers active mode */ |
| 861 | #define BTA_DM_PM_RETRY 0x80 /* retry power mode based on current settings */ |
| 862 | #define BTA_DM_PM_SUSPEND 0x04 /* prefers suspend mode */ |
| 863 | #define BTA_DM_PM_NO_PREF \ |
| 864 | 0x01 /* service has no prefernce on power mode setting. eg. connection to \ |
| 865 | service got closed */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 866 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 867 | typedef uint8_t tBTA_DM_PM_ACTION; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 868 | |
| 869 | /* index to bta_dm_ssr_spec */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 870 | #define BTA_DM_PM_SSR0 0 |
| 871 | #define BTA_DM_PM_SSR1 \ |
| 872 | 1 /* BTA_DM_PM_SSR1 will be dedicated for \ |
| 873 | HH SSR setting entry, no other profile can use it */ |
| 874 | #define BTA_DM_PM_SSR2 2 |
| 875 | #define BTA_DM_PM_SSR3 3 |
| 876 | #define BTA_DM_PM_SSR4 4 |
| 877 | #define BTA_DM_PM_SSR5 5 |
| 878 | #define BTA_DM_PM_SSR6 6 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 879 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 880 | #define BTA_DM_PM_NUM_EVTS 9 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 881 | |
| 882 | #ifndef BTA_DM_PM_PARK_IDX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 883 | #define BTA_DM_PM_PARK_IDX \ |
| 884 | 5 /* the actual index to bta_dm_pm_md[] for PARK mode */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 885 | #endif |
| 886 | |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 887 | #ifndef BTA_DM_PM_SNIFF_A2DP_IDX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 888 | #define BTA_DM_PM_SNIFF_A2DP_IDX BTA_DM_PM_SNIFF |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 889 | #endif |
| 890 | |
| 891 | #ifndef BTA_DM_PM_SNIFF_HD_IDLE_IDX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 892 | #define BTA_DM_PM_SNIFF_HD_IDLE_IDX BTA_DM_PM_SNIFF2 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 893 | #endif |
| 894 | |
| 895 | #ifndef BTA_DM_PM_SNIFF_SCO_OPEN_IDX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 896 | #define BTA_DM_PM_SNIFF_SCO_OPEN_IDX BTA_DM_PM_SNIFF3 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 897 | #endif |
| 898 | |
| 899 | #ifndef BTA_DM_PM_SNIFF_HD_ACTIVE_IDX |
| 900 | #define BTA_DM_PM_SNIFF_HD_ACTIVE_IDX BTA_DM_PM_SNIFF4 |
| 901 | #endif |
| 902 | |
| 903 | #ifndef BTA_DM_PM_SNIFF_HH_OPEN_IDX |
| 904 | #define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF2 |
| 905 | #endif |
| 906 | |
| 907 | #ifndef BTA_DM_PM_SNIFF_HH_ACTIVE_IDX |
| 908 | #define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF2 |
| 909 | #endif |
| 910 | |
| 911 | #ifndef BTA_DM_PM_SNIFF_HH_IDLE_IDX |
| 912 | #define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF2 |
| 913 | #endif |
| 914 | |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 915 | #ifndef BTA_DM_PM_HH_OPEN_DELAY |
| 916 | #define BTA_DM_PM_HH_OPEN_DELAY 30000 |
| 917 | #endif |
| 918 | |
| 919 | #ifndef BTA_DM_PM_HH_ACTIVE_DELAY |
| 920 | #define BTA_DM_PM_HH_ACTIVE_DELAY 30000 |
| 921 | #endif |
| 922 | |
| 923 | #ifndef BTA_DM_PM_HH_IDLE_DELAY |
| 924 | #define BTA_DM_PM_HH_IDLE_DELAY 30000 |
| 925 | #endif |
| 926 | |
| 927 | /* The Sniff Parameters defined below must be ordered from highest |
| 928 | * latency (biggest interval) to lowest latency. If there is a conflict |
| 929 | * among the connected services the setting with the lowest latency will |
| 930 | * be selected. If a device should override a sniff parameter then it |
| 931 | * must insure that order is maintained. |
| 932 | */ |
| 933 | #ifndef BTA_DM_PM_SNIFF_MAX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 934 | #define BTA_DM_PM_SNIFF_MAX 800 |
| 935 | #define BTA_DM_PM_SNIFF_MIN 400 |
| 936 | #define BTA_DM_PM_SNIFF_ATTEMPT 4 |
| 937 | #define BTA_DM_PM_SNIFF_TIMEOUT 1 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 938 | #endif |
| 939 | |
| 940 | #ifndef BTA_DM_PM_SNIFF1_MAX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 941 | #define BTA_DM_PM_SNIFF1_MAX 400 |
| 942 | #define BTA_DM_PM_SNIFF1_MIN 200 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 943 | #define BTA_DM_PM_SNIFF1_ATTEMPT 4 |
| 944 | #define BTA_DM_PM_SNIFF1_TIMEOUT 1 |
| 945 | #endif |
| 946 | |
| 947 | #ifndef BTA_DM_PM_SNIFF2_MAX |
Hemant Gupta | 8843cc8 | 2014-04-18 12:34:55 +0530 | [diff] [blame] | 948 | #define BTA_DM_PM_SNIFF2_MAX 54 |
| 949 | #define BTA_DM_PM_SNIFF2_MIN 30 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 950 | #define BTA_DM_PM_SNIFF2_ATTEMPT 4 |
| 951 | #define BTA_DM_PM_SNIFF2_TIMEOUT 1 |
| 952 | #endif |
| 953 | |
| 954 | #ifndef BTA_DM_PM_SNIFF3_MAX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 955 | #define BTA_DM_PM_SNIFF3_MAX 150 |
| 956 | #define BTA_DM_PM_SNIFF3_MIN 50 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 957 | #define BTA_DM_PM_SNIFF3_ATTEMPT 4 |
| 958 | #define BTA_DM_PM_SNIFF3_TIMEOUT 1 |
| 959 | #endif |
| 960 | |
| 961 | #ifndef BTA_DM_PM_SNIFF4_MAX |
Ivan Podogov | be6d6ce | 2017-01-03 21:20:33 +0000 | [diff] [blame] | 962 | #define BTA_DM_PM_SNIFF4_MAX 18 |
| 963 | #define BTA_DM_PM_SNIFF4_MIN 10 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 964 | #define BTA_DM_PM_SNIFF4_ATTEMPT 4 |
| 965 | #define BTA_DM_PM_SNIFF4_TIMEOUT 1 |
| 966 | #endif |
| 967 | |
Pavlin Radoslavov | 1076b7b | 2015-07-22 22:49:26 -0700 | [diff] [blame] | 968 | #ifndef BTA_DM_PM_SNIFF5_MAX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 969 | #define BTA_DM_PM_SNIFF5_MAX 36 |
| 970 | #define BTA_DM_PM_SNIFF5_MIN 30 |
Pavlin Radoslavov | 1076b7b | 2015-07-22 22:49:26 -0700 | [diff] [blame] | 971 | #define BTA_DM_PM_SNIFF5_ATTEMPT 2 |
| 972 | #define BTA_DM_PM_SNIFF5_TIMEOUT 0 |
| 973 | #endif |
| 974 | |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 975 | #ifndef BTA_DM_PM_PARK_MAX |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 976 | #define BTA_DM_PM_PARK_MAX 800 |
| 977 | #define BTA_DM_PM_PARK_MIN 400 |
| 978 | #define BTA_DM_PM_PARK_ATTEMPT 0 |
| 979 | #define BTA_DM_PM_PARK_TIMEOUT 0 |
Adam Hampson | 63399d9 | 2014-05-19 16:23:45 -0700 | [diff] [blame] | 980 | #endif |
| 981 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 982 | /* Switch callback events */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 983 | #define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 984 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 985 | typedef uint8_t tBTA_DM_SWITCH_EVT; |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 986 | typedef void(tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, |
| 987 | tBTA_STATUS status); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 988 | |
| 989 | /* Audio routing out configuration */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 990 | #define BTA_DM_ROUTE_NONE 0x00 /* No Audio output */ |
| 991 | #define BTA_DM_ROUTE_DAC 0x01 /* routing over analog output */ |
| 992 | #define BTA_DM_ROUTE_I2S 0x02 /* routing over digital (I2S) output */ |
| 993 | #define BTA_DM_ROUTE_BT_MONO 0x04 /* routing over SCO */ |
| 994 | #define BTA_DM_ROUTE_BT_STEREO 0x08 /* routing over BT Stereo */ |
| 995 | #define BTA_DM_ROUTE_HOST 0x10 /* routing over Host */ |
| 996 | #define BTA_DM_ROUTE_FMTX 0x20 /* routing over FMTX */ |
| 997 | #define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */ |
| 998 | #define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 999 | |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 1000 | typedef uint8_t tBTA_DM_ROUTE_PATH; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1001 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1002 | /* Device Identification (DI) data structure |
| 1003 | */ |
| 1004 | /* Used to set the DI record */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1005 | typedef tSDP_DI_RECORD tBTA_DI_RECORD; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1006 | /* Used to get the DI record */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1007 | typedef tSDP_DI_GET_RECORD tBTA_DI_GET_RECORD; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1008 | /* SDP discovery database */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1009 | typedef tSDP_DISCOVERY_DB tBTA_DISCOVERY_DB; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1010 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1011 | #ifndef BTA_DI_NUM_MAX |
| 1012 | #define BTA_DI_NUM_MAX 3 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1013 | #endif |
| 1014 | |
Andre Eisenbach | 3aa6054 | 2013-03-22 18:00:51 -0700 | [diff] [blame] | 1015 | /* Device features mask definitions */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1016 | #define BTA_FEATURE_BYTES_PER_PAGE BTM_FEATURE_BYTES_PER_PAGE |
| 1017 | #define BTA_EXT_FEATURES_PAGE_MAX BTM_EXT_FEATURES_PAGE_MAX |
Ganesh Ganapathi Batta | 7fa4fba | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 1018 | /* ACL type |
| 1019 | */ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1020 | #define BTA_DM_LINK_TYPE_BR_EDR 0x01 |
| 1021 | #define BTA_DM_LINK_TYPE_LE 0x02 |
| 1022 | #define BTA_DM_LINK_TYPE_ALL 0xFF |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 1023 | typedef uint8_t tBTA_DM_LINK_TYPE; |
Andre Eisenbach | 3aa6054 | 2013-03-22 18:00:51 -0700 | [diff] [blame] | 1024 | |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1025 | #define IMMEDIATE_DELY_MODE 0x00 |
| 1026 | #define ONFOUND_DELY_MODE 0x01 |
| 1027 | #define BATCH_DELY_MODE 0x02 |
| 1028 | #define ALLOW_ALL_FILTER 0x00 |
| 1029 | #define LOWEST_RSSI_VALUE 129 |
Satya Calloji | 6e2d9db | 2014-07-08 16:18:58 -0700 | [diff] [blame] | 1030 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1031 | /***************************************************************************** |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1032 | * External Function Declarations |
| 1033 | ****************************************************************************/ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1034 | |
| 1035 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1036 | * |
| 1037 | * Function BTA_EnableBluetooth |
| 1038 | * |
| 1039 | * Description This function initializes BTA and prepares BTA and the |
| 1040 | * Bluetooth protocol stack for use. This function is |
| 1041 | * typically called at startup or when Bluetooth services |
| 1042 | * are required by the phone. This function must be called |
| 1043 | * before calling any other API function. |
| 1044 | * |
| 1045 | * |
| 1046 | * Returns BTA_SUCCESS if successful. |
| 1047 | * BTA_FAIL if internal failure. |
| 1048 | * |
| 1049 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1050 | 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] | 1051 | |
| 1052 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1053 | * |
| 1054 | * Function BTA_DisableBluetooth |
| 1055 | * |
| 1056 | * Description This function disables BTA and the Bluetooth protocol |
| 1057 | * stack. It is called when BTA is no longer being used |
| 1058 | * by any application in the system. |
| 1059 | * |
| 1060 | * |
| 1061 | * Returns void |
| 1062 | * |
| 1063 | ******************************************************************************/ |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1064 | extern tBTA_STATUS BTA_DisableBluetooth(void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1065 | |
| 1066 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1067 | * |
| 1068 | * Function BTA_EnableTestMode |
| 1069 | * |
| 1070 | * Description Enables bluetooth device under test mode |
| 1071 | * |
| 1072 | * |
| 1073 | * Returns tBTA_STATUS |
| 1074 | * |
| 1075 | ******************************************************************************/ |
Jakub Pawlowski | 154be11 | 2018-01-22 10:22:43 -0800 | [diff] [blame^] | 1076 | extern void BTA_EnableTestMode(void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1077 | |
| 1078 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1079 | * |
| 1080 | * Function BTA_DisableTestMode |
| 1081 | * |
| 1082 | * Description Disable bluetooth device under test mode |
| 1083 | * |
| 1084 | * |
| 1085 | * Returns None |
| 1086 | * |
| 1087 | ******************************************************************************/ |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1088 | extern void BTA_DisableTestMode(void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1089 | |
| 1090 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1091 | * |
| 1092 | * Function BTA_DmSetDeviceName |
| 1093 | * |
| 1094 | * Description This function sets the Bluetooth name of the local device. |
| 1095 | * |
| 1096 | * |
| 1097 | * Returns void |
| 1098 | * |
| 1099 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1100 | extern void BTA_DmSetDeviceName(char* p_name); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1101 | |
| 1102 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1103 | * |
| 1104 | * Function BTA_DmSetVisibility |
| 1105 | * |
| 1106 | * Description This function sets the Bluetooth connectable,discoverable, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1107 | * pairable and conn paired only modesmodes of the local |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1108 | * device. |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1109 | * This controls whether other Bluetooth devices can find and |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1110 | * connect to the local device. |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1111 | * |
| 1112 | * |
| 1113 | * Returns void |
| 1114 | * |
| 1115 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1116 | extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, |
| 1117 | uint8_t pairable_mode, uint8_t conn_filter); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1118 | |
| 1119 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1120 | * |
| 1121 | * Function BTA_DmSearch |
| 1122 | * |
| 1123 | * Description This function searches for peer Bluetooth devices. It |
| 1124 | * first performs an inquiry; for each device found from the |
| 1125 | * inquiry it gets the remote name of the device. If |
| 1126 | * parameter services is nonzero, service discovery will be |
| 1127 | * performed on each device for the services specified. |
| 1128 | * |
| 1129 | * |
| 1130 | * Returns void |
| 1131 | * |
| 1132 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1133 | extern void BTA_DmSearch(tBTA_DM_INQ* p_dm_inq, tBTA_SERVICE_MASK services, |
| 1134 | tBTA_DM_SEARCH_CBACK* p_cback); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1135 | |
| 1136 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1137 | * |
| 1138 | * Function BTA_DmSearchCancel |
| 1139 | * |
| 1140 | * Description This function cancels a search that has been initiated |
| 1141 | * by calling BTA_DmSearch(). |
| 1142 | * |
| 1143 | * |
| 1144 | * Returns void |
| 1145 | * |
| 1146 | ******************************************************************************/ |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1147 | extern void BTA_DmSearchCancel(void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1148 | |
| 1149 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1150 | * |
| 1151 | * Function BTA_DmDiscover |
| 1152 | * |
| 1153 | * Description This function performs service discovery for the services |
| 1154 | * of a particular peer device. |
| 1155 | * |
| 1156 | * |
| 1157 | * Returns void |
| 1158 | * |
| 1159 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1160 | extern void BTA_DmDiscover(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1161 | tBTA_SERVICE_MASK services, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1162 | tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1163 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1164 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1165 | * |
| 1166 | * Function BTA_DmDiscoverUUID |
| 1167 | * |
| 1168 | * Description This function performs service discovery for the services |
| 1169 | * of a particular peer device. |
| 1170 | * |
| 1171 | * |
| 1172 | * Returns void |
| 1173 | * |
| 1174 | ******************************************************************************/ |
Jakub Pawlowski | 819e2ec | 2017-07-10 09:56:09 -0700 | [diff] [blame] | 1175 | extern void BTA_DmDiscoverUUID(const RawAddress& bd_addr, |
| 1176 | const bluetooth::Uuid& uuid, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1177 | tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1178 | |
| 1179 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1180 | * |
| 1181 | * Function BTA_DmGetCachedRemoteName |
| 1182 | * |
| 1183 | * Description Retieve cached remote name if available |
| 1184 | * |
| 1185 | * Returns BTA_SUCCESS if cached name was retrieved |
| 1186 | * BTA_FAILURE if cached name is not available |
| 1187 | * |
| 1188 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1189 | tBTA_STATUS BTA_DmGetCachedRemoteName(const RawAddress& remote_device, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1190 | uint8_t** pp_cached_name); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1191 | |
| 1192 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1193 | * |
| 1194 | * Function BTA_DmBond |
| 1195 | * |
| 1196 | * Description This function initiates a bonding procedure with a peer |
| 1197 | * device. The bonding procedure enables authentication |
| 1198 | * and optionally encryption on the Bluetooth link. |
| 1199 | * |
| 1200 | * |
| 1201 | * Returns void |
| 1202 | * |
| 1203 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1204 | extern void BTA_DmBond(const RawAddress& bd_addr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1205 | |
| 1206 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1207 | * |
| 1208 | * Function BTA_DmBondByTransport |
| 1209 | * |
| 1210 | * Description This function initiates a bonding procedure with a peer |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1211 | * device by designated transport. The bonding procedure |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1212 | * enables authentication and optionally encryption on the |
| 1213 | * Bluetooth link. |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1214 | * |
| 1215 | * |
| 1216 | * Returns void |
| 1217 | * |
| 1218 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1219 | extern void BTA_DmBondByTransport(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1220 | tBTA_TRANSPORT transport); |
Ganesh Ganapathi Batta | 7fa4fba | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 1221 | |
Ganesh Ganapathi Batta | 7fa4fba | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 1222 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1223 | * |
| 1224 | * Function BTA_DmBondCancel |
| 1225 | * |
| 1226 | * Description This function cancels a bonding procedure with a peer |
| 1227 | * device. |
| 1228 | * |
| 1229 | * |
| 1230 | * Returns void |
| 1231 | * |
| 1232 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1233 | extern void BTA_DmBondCancel(const RawAddress& bd_addr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1234 | |
| 1235 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1236 | * |
| 1237 | * Function BTA_DmPinReply |
| 1238 | * |
| 1239 | * Description This function provides a PIN when one is requested by DM |
| 1240 | * during a bonding procedure. The application should call |
| 1241 | * this function after the security callback is called with |
| 1242 | * a BTA_DM_PIN_REQ_EVT. |
| 1243 | * |
| 1244 | * |
| 1245 | * Returns void |
| 1246 | * |
| 1247 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1248 | extern void BTA_DmPinReply(const RawAddress& bd_addr, bool accept, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1249 | uint8_t pin_len, uint8_t* p_pin); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1250 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1251 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1252 | * |
| 1253 | * Function BTA_DmLocalOob |
| 1254 | * |
| 1255 | * Description This function retrieves the OOB data from local controller. |
| 1256 | * The result is reported by bta_dm_co_loc_oob(). |
| 1257 | * |
| 1258 | * Returns void |
| 1259 | * |
| 1260 | ******************************************************************************/ |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1261 | extern void BTA_DmLocalOob(void); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1262 | |
| 1263 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1264 | * |
| 1265 | * Function BTA_DmConfirm |
| 1266 | * |
| 1267 | * Description This function accepts or rejects the numerical value of the |
| 1268 | * Simple Pairing process on BTA_DM_SP_CFM_REQ_EVT |
| 1269 | * |
| 1270 | * Returns void |
| 1271 | * |
| 1272 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1273 | extern void BTA_DmConfirm(const RawAddress& bd_addr, bool accept); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1274 | |
| 1275 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1276 | * |
| 1277 | * Function BTA_DmAddDevice |
| 1278 | * |
| 1279 | * Description This function adds a device to the security database list |
| 1280 | * of peer devices. This function would typically be called |
| 1281 | * at system startup to initialize the security database with |
| 1282 | * known peer devices. This is a direct execution function |
| 1283 | * that may lock task scheduling on some platforms. |
| 1284 | * |
| 1285 | * Returns void |
| 1286 | * |
| 1287 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1288 | extern void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1289 | LINK_KEY link_key, tBTA_SERVICE_MASK trusted_mask, |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 1290 | bool is_trusted, uint8_t key_type, |
| 1291 | tBTA_IO_CAP io_cap, uint8_t pin_length); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1292 | |
| 1293 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1294 | * |
| 1295 | * Function BTA_DmRemoveDevice |
| 1296 | * |
| 1297 | * Description This function removes a device from the security database. |
| 1298 | * This is a direct execution function that may lock task |
| 1299 | * scheduling on some platforms. |
| 1300 | * |
| 1301 | * |
| 1302 | * Returns BTA_SUCCESS if successful. |
| 1303 | * BTA_FAIL if operation failed. |
| 1304 | * |
| 1305 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1306 | extern tBTA_STATUS BTA_DmRemoveDevice(const RawAddress& bd_addr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1307 | |
| 1308 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1309 | * |
| 1310 | * Function BTA_GetEirService |
| 1311 | * |
| 1312 | * Description This function is called to get BTA service mask from EIR. |
| 1313 | * |
| 1314 | * Parameters p_eir - pointer of EIR significant part |
Jakub Pawlowski | 0595ca0 | 2017-02-07 12:15:06 -0800 | [diff] [blame] | 1315 | * eir_len - EIR length |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1316 | * p_services - return the BTA service mask |
| 1317 | * |
| 1318 | * Returns None |
| 1319 | * |
| 1320 | ******************************************************************************/ |
Jakub Pawlowski | 0595ca0 | 2017-02-07 12:15:06 -0800 | [diff] [blame] | 1321 | extern void BTA_GetEirService(uint8_t* p_eir, size_t eir_len, |
| 1322 | tBTA_SERVICE_MASK* p_services); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1323 | |
Andre Eisenbach | 5c0b052 | 2014-06-18 12:20:37 -0700 | [diff] [blame] | 1324 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1325 | * |
| 1326 | * Function BTA_DmGetConnectionState |
| 1327 | * |
| 1328 | * Description Returns whether the remote device is currently connected. |
| 1329 | * |
| 1330 | * Returns 0 if the device is NOT connected. |
| 1331 | * |
| 1332 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1333 | extern uint16_t BTA_DmGetConnectionState(const RawAddress& bd_addr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1334 | |
| 1335 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1336 | * |
| 1337 | * Function BTA_DmSetLocalDiRecord |
| 1338 | * |
| 1339 | * Description This function adds a DI record to the local SDP database. |
| 1340 | * |
| 1341 | * Returns BTA_SUCCESS if record set sucessfully, otherwise error code. |
| 1342 | * |
| 1343 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1344 | extern tBTA_STATUS BTA_DmSetLocalDiRecord(tBTA_DI_RECORD* p_device_info, |
| 1345 | uint32_t* p_handle); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1346 | |
| 1347 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1348 | * |
| 1349 | * |
| 1350 | * Function BTA_DmCloseACL |
| 1351 | * |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1352 | * Description This function force to close an ACL connection and remove |
| 1353 | the |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1354 | * device from the security database list of known devices. |
| 1355 | * |
| 1356 | * Parameters: bd_addr - Address of the peer device |
| 1357 | * remove_dev - remove device or not after link down |
| 1358 | * transport - which transport to close |
Ganesh Ganapathi Batta | 7fa4fba | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 1359 | |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1360 | * |
| 1361 | * Returns void. |
| 1362 | * |
| 1363 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1364 | extern void BTA_DmCloseACL(const RawAddress& bd_addr, bool remove_dev, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1365 | tBTA_TRANSPORT transport); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1366 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1367 | /* BLE related API functions */ |
| 1368 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1369 | * |
| 1370 | * Function BTA_DmBleSecurityGrant |
| 1371 | * |
| 1372 | * Description Grant security request access. |
| 1373 | * |
| 1374 | * Parameters: bd_addr - BD address of the peer |
| 1375 | * res - security grant status. |
| 1376 | * |
| 1377 | * Returns void |
| 1378 | * |
| 1379 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1380 | extern void BTA_DmBleSecurityGrant(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1381 | tBTA_DM_BLE_SEC_GRANT res); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1382 | |
Jakub Pawlowski | 83211b0 | 2016-12-07 11:25:15 -0800 | [diff] [blame] | 1383 | /** |
| 1384 | * Set BLE connectable mode to auto connect |
| 1385 | */ |
| 1386 | extern void BTA_DmBleStartAutoConn(); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1387 | |
| 1388 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1389 | * |
| 1390 | * Function BTA_DmBlePasskeyReply |
| 1391 | * |
| 1392 | * Description Send BLE SMP passkey reply. |
| 1393 | * |
| 1394 | * Parameters: bd_addr - BD address of the peer |
| 1395 | * accept - passkey entry sucessful or declined. |
| 1396 | * passkey - passkey value, must be a 6 digit number, |
| 1397 | * can be lead by 0. |
| 1398 | * |
| 1399 | * Returns void |
| 1400 | * |
| 1401 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1402 | extern void BTA_DmBlePasskeyReply(const RawAddress& bd_addr, bool accept, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1403 | uint32_t passkey); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1404 | |
| 1405 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1406 | * |
| 1407 | * Function BTA_DmBleConfirmReply |
| 1408 | * |
| 1409 | * Description Send BLE SMP SC user confirmation reply. |
| 1410 | * |
| 1411 | * Parameters: bd_addr - BD address of the peer |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1412 | * accept - numbers to compare are the same or |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1413 | * different. |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1414 | * |
| 1415 | * Returns void |
| 1416 | * |
| 1417 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1418 | extern void BTA_DmBleConfirmReply(const RawAddress& bd_addr, bool accept); |
Satya Calloji | 444a8da | 2015-03-06 10:38:22 -0800 | [diff] [blame] | 1419 | |
| 1420 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1421 | * |
| 1422 | * Function BTA_DmAddBleDevice |
| 1423 | * |
| 1424 | * Description Add a BLE device. This function will be normally called |
| 1425 | * during host startup to restore all required information |
| 1426 | * for a LE device stored in the NVRAM. |
| 1427 | * |
| 1428 | * Parameters: bd_addr - BD address of the peer |
| 1429 | * dev_type - Remote device's device type. |
| 1430 | * addr_type - LE device address type. |
| 1431 | * |
| 1432 | * Returns void |
| 1433 | * |
| 1434 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1435 | extern void BTA_DmAddBleDevice(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1436 | tBLE_ADDR_TYPE addr_type, |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1437 | tBT_DEVICE_TYPE dev_type); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1438 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1439 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1440 | * |
| 1441 | * Function BTA_DmAddBleKey |
| 1442 | * |
| 1443 | * Description Add/modify LE device information. This function will be |
| 1444 | * normally called during host startup to restore all required |
| 1445 | * information stored in the NVRAM. |
| 1446 | * |
| 1447 | * Parameters: bd_addr - BD address of the peer |
| 1448 | * p_le_key - LE key values. |
| 1449 | * key_type - LE SMP key type. |
| 1450 | * |
| 1451 | * Returns void |
| 1452 | * |
| 1453 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1454 | extern void BTA_DmAddBleKey(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1455 | tBTA_LE_KEY_VALUE* p_le_key, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1456 | tBTA_LE_KEY_TYPE key_type); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1457 | |
| 1458 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1459 | * |
| 1460 | * Function BTA_DmSetBlePrefConnParams |
| 1461 | * |
| 1462 | * Description This function is called to set the preferred connection |
| 1463 | * parameters when default connection parameter is not desired. |
| 1464 | * |
| 1465 | * Parameters: bd_addr - BD address of the peripheral |
| 1466 | * min_conn_int - minimum preferred connection interval |
| 1467 | * max_conn_int - maximum preferred connection interval |
| 1468 | * slave_latency - preferred slave latency |
| 1469 | * supervision_tout - preferred supervision timeout |
| 1470 | * |
| 1471 | * |
| 1472 | * Returns void |
| 1473 | * |
| 1474 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1475 | extern void BTA_DmSetBlePrefConnParams(const RawAddress& bd_addr, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1476 | uint16_t min_conn_int, |
| 1477 | uint16_t max_conn_int, |
| 1478 | uint16_t slave_latency, |
| 1479 | uint16_t supervision_tout); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1480 | |
| 1481 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1482 | * |
| 1483 | * Function BTA_DmSetBleConnScanParams |
| 1484 | * |
| 1485 | * Description This function is called to set scan parameters used in |
| 1486 | * BLE connection request |
| 1487 | * |
| 1488 | * Parameters: scan_interval - scan interval |
| 1489 | * scan_window - scan window |
| 1490 | * |
| 1491 | * Returns void |
| 1492 | * |
| 1493 | ******************************************************************************/ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 1494 | extern void BTA_DmSetBleConnScanParams(uint32_t scan_interval, |
| 1495 | uint32_t scan_window); |
Satya Calloji | 5725fc6 | 2015-03-31 13:24:32 -0700 | [diff] [blame] | 1496 | |
| 1497 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1498 | * |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1499 | * Function BTA_DmSearchExt |
| 1500 | * |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1501 | * Description This function searches for peer Bluetooth devices. It |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1502 | * performs an inquiry and gets the remote name for devices. |
| 1503 | * Service discovery is done if services is non zero |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1504 | * |
| 1505 | * Parameters p_dm_inq: inquiry conditions |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1506 | * services: if service is not empty, service discovery will be |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1507 | * done. |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1508 | * for all GATT based service condition, put |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1509 | * num_uuid, and p_uuid is the pointer to the list of |
| 1510 | * UUID values. |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1511 | * p_cback: callback functino when search is completed. |
| 1512 | * |
| 1513 | * |
| 1514 | * |
| 1515 | * Returns void |
| 1516 | * |
| 1517 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1518 | extern void BTA_DmSearchExt(tBTA_DM_INQ* p_dm_inq, |
| 1519 | tBTA_SERVICE_MASK_EXT* p_services, |
| 1520 | tBTA_DM_SEARCH_CBACK* p_cback); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1521 | |
| 1522 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1523 | * |
| 1524 | * Function BTA_DmDiscoverExt |
| 1525 | * |
| 1526 | * Description This function does service discovery for services of a |
| 1527 | * peer device. When services.num_uuid is 0, it indicates all |
| 1528 | * GATT based services are to be searched; other wise a list of |
| 1529 | * UUID of interested services should be provided through |
| 1530 | * services.p_uuid. |
| 1531 | * |
| 1532 | * |
| 1533 | * |
| 1534 | * Returns void |
| 1535 | * |
| 1536 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1537 | extern void BTA_DmDiscoverExt(const RawAddress& bd_addr, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1538 | tBTA_SERVICE_MASK_EXT* p_services, |
| 1539 | tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1540 | |
Ganesh Ganapathi Batta | 7fa4fba | 2014-04-16 16:50:09 -0700 | [diff] [blame] | 1541 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1542 | * |
| 1543 | * Function BTA_DmDiscoverByTransport |
| 1544 | * |
| 1545 | * Description This function does service discovery on particular transport |
| 1546 | * for services of a |
| 1547 | * peer device. When services.num_uuid is 0, it indicates all |
| 1548 | * GATT based services are to be searched; other wise a list of |
| 1549 | * UUID of interested services should be provided through |
| 1550 | * p_services->p_uuid. |
| 1551 | * |
| 1552 | * |
| 1553 | * |
| 1554 | * Returns void |
| 1555 | * |
| 1556 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1557 | extern void BTA_DmDiscoverByTransport(const RawAddress& bd_addr, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1558 | tBTA_SERVICE_MASK_EXT* p_services, |
| 1559 | tBTA_DM_SEARCH_CBACK* p_cback, |
| 1560 | bool sdp_search, |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1561 | tBTA_TRANSPORT transport); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1562 | |
| 1563 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1564 | * |
| 1565 | * Function BTA_DmSetEncryption |
| 1566 | * |
| 1567 | * Description This function is called to ensure that connection is |
| 1568 | * encrypted. Should be called only on an open connection. |
| 1569 | * Typically only needed for connections that first want to |
| 1570 | * bring up unencrypted links, then later encrypt them. |
| 1571 | * |
| 1572 | * Parameters: bd_addr - Address of the peer device |
| 1573 | * transport - transport of the link to be encruypted |
| 1574 | * p_callback - Pointer to callback function to indicat the |
| 1575 | * link encryption status |
| 1576 | * sec_act - This is the security action to indicate |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1577 | * what kind of BLE security level is required |
| 1578 | * for the BLE link if BLE is supported |
| 1579 | * Note: This parameter is ignored for |
| 1580 | * BR/EDR or if BLE is not supported. |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1581 | * |
| 1582 | * Returns void |
| 1583 | * |
| 1584 | * |
| 1585 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1586 | extern void BTA_DmSetEncryption(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1587 | tBTA_TRANSPORT transport, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1588 | tBTA_DM_ENCRYPT_CBACK* p_callback, |
June R. Tate-Gans | 24933b5 | 2014-09-24 15:25:02 -0700 | [diff] [blame] | 1589 | tBTA_DM_BLE_SEC_ACT sec_act); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1590 | |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 1591 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1592 | * |
| 1593 | * Function BTA_DmBleObserve |
| 1594 | * |
| 1595 | * Description This procedure keep the device listening for advertising |
| 1596 | * events from a broadcast device. |
| 1597 | * |
| 1598 | * Parameters start: start or stop observe. |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1599 | * duration : Duration of the scan. Continuous scan if 0 is |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1600 | * passed |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1601 | * p_results_cb: Callback to be called with scan results |
| 1602 | * |
| 1603 | * Returns void |
| 1604 | * |
| 1605 | ******************************************************************************/ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 1606 | extern void BTA_DmBleObserve(bool start, uint8_t duration, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1607 | tBTA_DM_SEARCH_CBACK* p_results_cb); |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 1608 | |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 1609 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1610 | * |
| 1611 | * Function BTA_DmBleConfigLocalPrivacy |
| 1612 | * |
| 1613 | * Description Enable/disable privacy on the local device |
| 1614 | * |
| 1615 | * Parameters: privacy_enable - enable/disabe privacy on remote device. |
| 1616 | * |
| 1617 | * Returns void |
| 1618 | * |
| 1619 | ******************************************************************************/ |
Marie Janssen | e9e58ce | 2016-06-17 14:12:17 -0700 | [diff] [blame] | 1620 | extern void BTA_DmBleConfigLocalPrivacy(bool privacy_enable); |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 1621 | |
| 1622 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1623 | * |
| 1624 | * Function BTA_DmBleEnableRemotePrivacy |
| 1625 | * |
| 1626 | * Description Enable/disable privacy on a remote device |
| 1627 | * |
| 1628 | * Parameters: bd_addr - BD address of the peer |
| 1629 | * privacy_enable - enable/disabe privacy on remote device. |
| 1630 | * |
| 1631 | * Returns void |
| 1632 | * |
| 1633 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1634 | extern void BTA_DmBleEnableRemotePrivacy(const RawAddress& bd_addr, |
Jakub Pawlowski | c2276b0 | 2017-06-09 16:00:25 -0700 | [diff] [blame] | 1635 | bool privacy_enable); |
Ganesh Ganapathi Batta | ead3cde | 2013-02-05 15:22:31 -0800 | [diff] [blame] | 1636 | |
Jakub Pawlowski | 6a96661 | 2016-08-16 03:25:45 -0700 | [diff] [blame] | 1637 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1638 | * |
| 1639 | * Function BTA_DmBleUpdateConnectionParams |
| 1640 | * |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1641 | * Description Update connection parameters, can only be used when |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1642 | * connection is up. |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1643 | * |
| 1644 | * Parameters: bd_addr - BD address of the peer |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1645 | * min_int - minimum connection interval, [0x0004 ~ 0x4000] |
| 1646 | * max_int - maximum connection interval, [0x0004 ~ 0x4000] |
| 1647 | * latency - slave latency [0 ~ 500] |
| 1648 | * timeout - supervision timeout [0x000a ~ 0xc80] |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1649 | * |
| 1650 | * Returns void |
| 1651 | * |
| 1652 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1653 | extern void BTA_DmBleUpdateConnectionParams(const RawAddress& bd_addr, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1654 | uint16_t min_int, uint16_t max_int, |
| 1655 | uint16_t latency, uint16_t timeout); |
Satya Calloji | c4e2596 | 2014-05-10 23:46:24 -0700 | [diff] [blame] | 1656 | |
| 1657 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1658 | * |
| 1659 | * Function BTA_DmBleSetDataLength |
| 1660 | * |
| 1661 | * Description This function is to set maximum LE data packet size |
| 1662 | * |
| 1663 | * Returns void |
| 1664 | * |
| 1665 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 1666 | extern void BTA_DmBleSetDataLength(const RawAddress& remote_device, |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1667 | uint16_t tx_data_length); |
Priti Aghera | 636d671 | 2014-12-18 13:55:48 -0800 | [diff] [blame] | 1668 | |
| 1669 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1670 | * |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1671 | * Function BTA_DmBleGetEnergyInfo |
| 1672 | * |
| 1673 | * Description This function is called to obtain the energy info |
| 1674 | * |
| 1675 | * Parameters p_cmpl_cback - Command complete callback |
| 1676 | * |
| 1677 | * Returns void |
| 1678 | * |
| 1679 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1680 | extern void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback); |
Satya Calloji | e5ba884 | 2014-07-03 17:18:02 -0700 | [diff] [blame] | 1681 | |
Prerepa Viswanadham | 16fe082 | 2014-08-07 11:38:06 -0700 | [diff] [blame] | 1682 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1683 | * |
| 1684 | * Function BTA_BrcmInit |
| 1685 | * |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1686 | * Description This function initializes Broadcom specific VS handler in |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1687 | * BTA |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1688 | * |
| 1689 | * Returns void |
| 1690 | * |
| 1691 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1692 | extern void BTA_VendorInit(void); |
Prerepa Viswanadham | 16fe082 | 2014-08-07 11:38:06 -0700 | [diff] [blame] | 1693 | |
| 1694 | /******************************************************************************* |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1695 | * |
| 1696 | * Function BTA_BrcmCleanup |
| 1697 | * |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1698 | * Description This function frees up Broadcom specific VS specific dynamic |
Myles Watson | 1baaae3 | 2016-11-09 14:25:23 -0800 | [diff] [blame] | 1699 | * memory |
Myles Watson | 8af480e | 2016-11-09 10:40:23 -0800 | [diff] [blame] | 1700 | * |
| 1701 | * Returns void |
| 1702 | * |
| 1703 | ******************************************************************************/ |
Myles Watson | cd1fd07 | 2016-11-09 13:17:43 -0800 | [diff] [blame] | 1704 | extern void BTA_VendorCleanup(void); |
Prerepa Viswanadham | 16fe082 | 2014-08-07 11:38:06 -0700 | [diff] [blame] | 1705 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1706 | #endif /* BTA_API_H */ |