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