blob: eabb4f277fc296657b8789a0f69edde608da8289 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
2 *
3 * Copyright (C) 1999-2012 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19#ifndef HCIMSGS_H
20#define HCIMSGS_H
21
22#include "bt_target.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080023#include "bt_types.h"
Mudumba Ananth181863e2017-02-09 09:05:48 -080024#include "device/include/esco_parameters.h"
Myles Watson911d1ae2016-11-28 16:44:40 -080025#include "hcidefs.h"
The Android Open Source Project5738f832012-12-12 16:00:35 -080026
Jakub Pawlowski0c683232017-02-24 09:49:59 -080027#include <base/callback_forward.h>
28
Myles Watson911d1ae2016-11-28 16:44:40 -080029void bte_main_hci_send(BT_HDR* p_msg, uint16_t event);
Chris Mantonf857d642014-09-26 13:31:41 -070030
The Android Open Source Project5738f832012-12-12 16:00:35 -080031/* Message by message.... */
32
Jakub Pawlowski763abdf2016-10-10 11:39:39 -070033extern void btsnd_hcic_inquiry(const LAP inq_lap, uint8_t duration,
Myles Watson911d1ae2016-11-28 16:44:40 -080034 uint8_t response_cnt);
The Android Open Source Project5738f832012-12-12 16:00:35 -080035
36#define HCIC_PARAM_SIZE_INQUIRY 5
37
Myles Watson911d1ae2016-11-28 16:44:40 -080038#define HCIC_INQ_INQ_LAP_OFF 0
39#define HCIC_INQ_DUR_OFF 3
40#define HCIC_INQ_RSP_CNT_OFF 4
41/* Inquiry */
The Android Open Source Project5738f832012-12-12 16:00:35 -080042
Myles Watson911d1ae2016-11-28 16:44:40 -080043/* Inquiry Cancel */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -070044extern void btsnd_hcic_inq_cancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -080045
Myles Watson911d1ae2016-11-28 16:44:40 -080046#define HCIC_PARAM_SIZE_INQ_CANCEL 0
The Android Open Source Project5738f832012-12-12 16:00:35 -080047
Myles Watson911d1ae2016-11-28 16:44:40 -080048/* Periodic Inquiry Mode */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -070049extern void btsnd_hcic_per_inq_mode(uint16_t max_period, uint16_t min_period,
Myles Watson911d1ae2016-11-28 16:44:40 -080050 const LAP inq_lap, uint8_t duration,
51 uint8_t response_cnt);
The Android Open Source Project5738f832012-12-12 16:00:35 -080052
Myles Watson911d1ae2016-11-28 16:44:40 -080053#define HCIC_PARAM_SIZE_PER_INQ_MODE 9
The Android Open Source Project5738f832012-12-12 16:00:35 -080054
Myles Watson911d1ae2016-11-28 16:44:40 -080055#define HCI_PER_INQ_MAX_INTRVL_OFF 0
56#define HCI_PER_INQ_MIN_INTRVL_OFF 2
57#define HCI_PER_INQ_INQ_LAP_OFF 4
58#define HCI_PER_INQ_DURATION_OFF 7
59#define HCI_PER_INQ_RSP_CNT_OFF 8
60/* Periodic Inquiry Mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -080061
Myles Watson911d1ae2016-11-28 16:44:40 -080062/* Exit Periodic Inquiry Mode */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -070063extern void btsnd_hcic_exit_per_inq(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -080064
Myles Watson911d1ae2016-11-28 16:44:40 -080065#define HCIC_PARAM_SIZE_EXIT_PER_INQ 0
66/* Create Connection */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -070067extern void btsnd_hcic_create_conn(BD_ADDR dest, uint16_t packet_types,
Myles Watson911d1ae2016-11-28 16:44:40 -080068 uint8_t page_scan_rep_mode,
69 uint8_t page_scan_mode,
70 uint16_t clock_offset, uint8_t allow_switch);
The Android Open Source Project5738f832012-12-12 16:00:35 -080071
Myles Watson911d1ae2016-11-28 16:44:40 -080072#define HCIC_PARAM_SIZE_CREATE_CONN 13
The Android Open Source Project5738f832012-12-12 16:00:35 -080073
Myles Watson911d1ae2016-11-28 16:44:40 -080074#define HCIC_CR_CONN_BD_ADDR_OFF 0
75#define HCIC_CR_CONN_PKT_TYPES_OFF 6
76#define HCIC_CR_CONN_REP_MODE_OFF 8
The Android Open Source Project5738f832012-12-12 16:00:35 -080077#define HCIC_CR_CONN_PAGE_SCAN_MODE_OFF 9
Myles Watson911d1ae2016-11-28 16:44:40 -080078#define HCIC_CR_CONN_CLK_OFF_OFF 10
79#define HCIC_CR_CONN_ALLOW_SWITCH_OFF 12
80/* Create Connection */
The Android Open Source Project5738f832012-12-12 16:00:35 -080081
Myles Watson911d1ae2016-11-28 16:44:40 -080082/* Disconnect */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -070083extern void btsnd_hcic_disconnect(uint16_t handle, uint8_t reason);
The Android Open Source Project5738f832012-12-12 16:00:35 -080084
85#define HCIC_PARAM_SIZE_DISCONNECT 3
86
Myles Watson911d1ae2016-11-28 16:44:40 -080087#define HCI_DISC_HANDLE_OFF 0
88#define HCI_DISC_REASON_OFF 2
89/* Disconnect */
The Android Open Source Project5738f832012-12-12 16:00:35 -080090
Marie Janssend19e0782016-07-15 12:48:27 -070091#if (BTM_SCO_INCLUDED == TRUE)
Myles Watson911d1ae2016-11-28 16:44:40 -080092/* Add SCO Connection */
93extern void btsnd_hcic_add_SCO_conn(uint16_t handle, uint16_t packet_types);
The Android Open Source Project5738f832012-12-12 16:00:35 -080094#endif /* BTM_SCO_INCLUDED */
95
Myles Watson911d1ae2016-11-28 16:44:40 -080096#define HCIC_PARAM_SIZE_ADD_SCO_CONN 4
The Android Open Source Project5738f832012-12-12 16:00:35 -080097
Myles Watson911d1ae2016-11-28 16:44:40 -080098#define HCI_ADD_SCO_HANDLE_OFF 0
99#define HCI_ADD_SCO_PACKET_TYPES_OFF 2
100/* Add SCO Connection */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800101
Myles Watson911d1ae2016-11-28 16:44:40 -0800102/* Create Connection Cancel */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700103extern void btsnd_hcic_create_conn_cancel(BD_ADDR dest);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800104
Myles Watson911d1ae2016-11-28 16:44:40 -0800105#define HCIC_PARAM_SIZE_CREATE_CONN_CANCEL 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800106
Myles Watson911d1ae2016-11-28 16:44:40 -0800107#define HCIC_CR_CONN_CANCEL_BD_ADDR_OFF 0
108/* Create Connection Cancel */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800109
Myles Watson911d1ae2016-11-28 16:44:40 -0800110/* Accept Connection Request */
111extern void btsnd_hcic_accept_conn(BD_ADDR bd_addr, uint8_t role);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800112
Myles Watson911d1ae2016-11-28 16:44:40 -0800113#define HCIC_PARAM_SIZE_ACCEPT_CONN 7
The Android Open Source Project5738f832012-12-12 16:00:35 -0800114
Myles Watson911d1ae2016-11-28 16:44:40 -0800115#define HCI_ACC_CONN_BD_ADDR_OFF 0
116#define HCI_ACC_CONN_ROLE_OFF 6
117/* Accept Connection Request */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800118
Myles Watson911d1ae2016-11-28 16:44:40 -0800119/* Reject Connection Request */
120extern void btsnd_hcic_reject_conn(BD_ADDR bd_addr, uint8_t reason);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800121
Myles Watson911d1ae2016-11-28 16:44:40 -0800122#define HCIC_PARAM_SIZE_REJECT_CONN 7
The Android Open Source Project5738f832012-12-12 16:00:35 -0800123
Myles Watson911d1ae2016-11-28 16:44:40 -0800124#define HCI_REJ_CONN_BD_ADDR_OFF 0
125#define HCI_REJ_CONN_REASON_OFF 6
126/* Reject Connection Request */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800127
Myles Watson911d1ae2016-11-28 16:44:40 -0800128/* Link Key Request Reply */
129extern void btsnd_hcic_link_key_req_reply(BD_ADDR bd_addr, LINK_KEY link_key);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800130
Myles Watson911d1ae2016-11-28 16:44:40 -0800131#define HCIC_PARAM_SIZE_LINK_KEY_REQ_REPLY 22
The Android Open Source Project5738f832012-12-12 16:00:35 -0800132
Myles Watson911d1ae2016-11-28 16:44:40 -0800133#define HCI_LINK_KEY_REPLY_BD_ADDR_OFF 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800134#define HCI_LINK_KEY_REPLY_LINK_KEY_OFF 6
Myles Watson911d1ae2016-11-28 16:44:40 -0800135/* Link Key Request Reply */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800136
Myles Watson911d1ae2016-11-28 16:44:40 -0800137/* Link Key Request Neg Reply */
138extern void btsnd_hcic_link_key_neg_reply(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800139
Myles Watson911d1ae2016-11-28 16:44:40 -0800140#define HCIC_PARAM_SIZE_LINK_KEY_NEG_REPLY 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800141
142#define HCI_LINK_KEY_NEG_REP_BD_ADR_OFF 0
Myles Watson911d1ae2016-11-28 16:44:40 -0800143/* Link Key Request Neg Reply */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800144
Myles Watson911d1ae2016-11-28 16:44:40 -0800145/* PIN Code Request Reply */
146extern void btsnd_hcic_pin_code_req_reply(BD_ADDR bd_addr, uint8_t pin_code_len,
147 PIN_CODE pin_code);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800148
Myles Watson911d1ae2016-11-28 16:44:40 -0800149#define HCIC_PARAM_SIZE_PIN_CODE_REQ_REPLY 23
The Android Open Source Project5738f832012-12-12 16:00:35 -0800150
Myles Watson911d1ae2016-11-28 16:44:40 -0800151#define HCI_PIN_CODE_REPLY_BD_ADDR_OFF 0
152#define HCI_PIN_CODE_REPLY_PIN_LEN_OFF 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800153#define HCI_PIN_CODE_REPLY_PIN_CODE_OFF 7
Myles Watson911d1ae2016-11-28 16:44:40 -0800154/* PIN Code Request Reply */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800155
Myles Watson911d1ae2016-11-28 16:44:40 -0800156/* Link Key Request Neg Reply */
157extern void btsnd_hcic_pin_code_neg_reply(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800158
Myles Watson911d1ae2016-11-28 16:44:40 -0800159#define HCIC_PARAM_SIZE_PIN_CODE_NEG_REPLY 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800160
161#define HCI_PIN_CODE_NEG_REP_BD_ADR_OFF 0
Myles Watson911d1ae2016-11-28 16:44:40 -0800162/* Link Key Request Neg Reply */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800163
Myles Watson911d1ae2016-11-28 16:44:40 -0800164/* Change Connection Type */
165extern void btsnd_hcic_change_conn_type(uint16_t handle, uint16_t packet_types);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800166
Myles Watson911d1ae2016-11-28 16:44:40 -0800167#define HCIC_PARAM_SIZE_CHANGE_CONN_TYPE 4
The Android Open Source Project5738f832012-12-12 16:00:35 -0800168
Myles Watson911d1ae2016-11-28 16:44:40 -0800169#define HCI_CHNG_PKT_TYPE_HANDLE_OFF 0
170#define HCI_CHNG_PKT_TYPE_PKT_TYPE_OFF 2
171/* Change Connection Type */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800172
Myles Watson911d1ae2016-11-28 16:44:40 -0800173#define HCIC_PARAM_SIZE_CMD_HANDLE 2
The Android Open Source Project5738f832012-12-12 16:00:35 -0800174
Myles Watson911d1ae2016-11-28 16:44:40 -0800175#define HCI_CMD_HANDLE_HANDLE_OFF 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800176
Myles Watson911d1ae2016-11-28 16:44:40 -0800177extern void btsnd_hcic_auth_request(
178 uint16_t handle); /* Authentication Request */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800179
Myles Watson911d1ae2016-11-28 16:44:40 -0800180/* Set Connection Encryption */
181extern void btsnd_hcic_set_conn_encrypt(uint16_t handle, bool enable);
182#define HCIC_PARAM_SIZE_SET_CONN_ENCRYPT 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800183
Myles Watson911d1ae2016-11-28 16:44:40 -0800184#define HCI_SET_ENCRYPT_HANDLE_OFF 0
185#define HCI_SET_ENCRYPT_ENABLE_OFF 2
186/* Set Connection Encryption */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800187
Myles Watson911d1ae2016-11-28 16:44:40 -0800188/* Remote Name Request */
189extern void btsnd_hcic_rmt_name_req(BD_ADDR bd_addr, uint8_t page_scan_rep_mode,
190 uint8_t page_scan_mode,
191 uint16_t clock_offset);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800192
Myles Watson911d1ae2016-11-28 16:44:40 -0800193#define HCIC_PARAM_SIZE_RMT_NAME_REQ 10
The Android Open Source Project5738f832012-12-12 16:00:35 -0800194
Myles Watson911d1ae2016-11-28 16:44:40 -0800195#define HCI_RMT_NAME_BD_ADDR_OFF 0
196#define HCI_RMT_NAME_REP_MODE_OFF 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800197#define HCI_RMT_NAME_PAGE_SCAN_MODE_OFF 7
Myles Watson911d1ae2016-11-28 16:44:40 -0800198#define HCI_RMT_NAME_CLK_OFF_OFF 8
199/* Remote Name Request */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800200
Myles Watson911d1ae2016-11-28 16:44:40 -0800201/* Remote Name Request Cancel */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700202extern void btsnd_hcic_rmt_name_req_cancel(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800203
Myles Watson911d1ae2016-11-28 16:44:40 -0800204#define HCIC_PARAM_SIZE_RMT_NAME_REQ_CANCEL 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800205
Myles Watson911d1ae2016-11-28 16:44:40 -0800206#define HCI_RMT_NAME_CANCEL_BD_ADDR_OFF 0
207/* Remote Name Request Cancel */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800208
Myles Watson911d1ae2016-11-28 16:44:40 -0800209extern void btsnd_hcic_rmt_features_req(
210 uint16_t handle); /* Remote Features Request */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800211
Myles Watson911d1ae2016-11-28 16:44:40 -0800212/* Remote Extended Features */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700213extern void btsnd_hcic_rmt_ext_features(uint16_t handle, uint8_t page_num);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800214
Myles Watson911d1ae2016-11-28 16:44:40 -0800215#define HCIC_PARAM_SIZE_RMT_EXT_FEATURES 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800216
Myles Watson911d1ae2016-11-28 16:44:40 -0800217#define HCI_RMT_EXT_FEATURES_HANDLE_OFF 0
218#define HCI_RMT_EXT_FEATURES_PAGE_NUM_OFF 2
219/* Remote Extended Features */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800220
Myles Watson911d1ae2016-11-28 16:44:40 -0800221extern void btsnd_hcic_rmt_ver_req(
222 uint16_t handle); /* Remote Version Info Request */
223extern void btsnd_hcic_read_rmt_clk_offset(
224 uint16_t handle); /* Remote Clock Offset */
225extern void btsnd_hcic_read_lmp_handle(uint16_t handle); /* Remote LMP Handle */
Mudumba Ananth181863e2017-02-09 09:05:48 -0800226extern void btsnd_hcic_setup_esco_conn(uint16_t handle,
227 uint32_t transmit_bandwidth,
228 uint32_t receive_bandwidth,
229 uint16_t max_latency, uint16_t voice,
230 uint8_t retrans_effort,
Myles Watson911d1ae2016-11-28 16:44:40 -0800231 uint16_t packet_types);
232#define HCIC_PARAM_SIZE_SETUP_ESCO 17
The Android Open Source Project5738f832012-12-12 16:00:35 -0800233
Myles Watson911d1ae2016-11-28 16:44:40 -0800234#define HCI_SETUP_ESCO_HANDLE_OFF 0
235#define HCI_SETUP_ESCO_TX_BW_OFF 2
236#define HCI_SETUP_ESCO_RX_BW_OFF 6
237#define HCI_SETUP_ESCO_MAX_LAT_OFF 10
238#define HCI_SETUP_ESCO_VOICE_OFF 12
239#define HCI_SETUP_ESCO_RETRAN_EFF_OFF 14
240#define HCI_SETUP_ESCO_PKT_TYPES_OFF 15
The Android Open Source Project5738f832012-12-12 16:00:35 -0800241
Mudumba Ananth181863e2017-02-09 09:05:48 -0800242extern void btsnd_hcic_accept_esco_conn(
243 BD_ADDR bd_addr, uint32_t transmit_bandwidth, uint32_t receive_bandwidth,
244 uint16_t max_latency, uint16_t content_fmt, uint8_t retrans_effort,
245 uint16_t packet_types);
Myles Watson911d1ae2016-11-28 16:44:40 -0800246#define HCIC_PARAM_SIZE_ACCEPT_ESCO 21
The Android Open Source Project5738f832012-12-12 16:00:35 -0800247
Myles Watson911d1ae2016-11-28 16:44:40 -0800248#define HCI_ACCEPT_ESCO_BDADDR_OFF 0
249#define HCI_ACCEPT_ESCO_TX_BW_OFF 6
250#define HCI_ACCEPT_ESCO_RX_BW_OFF 10
251#define HCI_ACCEPT_ESCO_MAX_LAT_OFF 14
252#define HCI_ACCEPT_ESCO_VOICE_OFF 16
253#define HCI_ACCEPT_ESCO_RETRAN_EFF_OFF 18
254#define HCI_ACCEPT_ESCO_PKT_TYPES_OFF 19
The Android Open Source Project5738f832012-12-12 16:00:35 -0800255
Myles Watson911d1ae2016-11-28 16:44:40 -0800256extern void btsnd_hcic_reject_esco_conn(BD_ADDR bd_addr, uint8_t reason);
257#define HCIC_PARAM_SIZE_REJECT_ESCO 7
The Android Open Source Project5738f832012-12-12 16:00:35 -0800258
Myles Watson911d1ae2016-11-28 16:44:40 -0800259#define HCI_REJECT_ESCO_BDADDR_OFF 0
260#define HCI_REJECT_ESCO_REASON_OFF 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800261
262/* Hold Mode */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700263extern void btsnd_hcic_hold_mode(uint16_t handle, uint16_t max_hold_period,
Myles Watson911d1ae2016-11-28 16:44:40 -0800264 uint16_t min_hold_period);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800265
Myles Watson911d1ae2016-11-28 16:44:40 -0800266#define HCIC_PARAM_SIZE_HOLD_MODE 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800267
Myles Watson911d1ae2016-11-28 16:44:40 -0800268#define HCI_HOLD_MODE_HANDLE_OFF 0
269#define HCI_HOLD_MODE_MAX_PER_OFF 2
270#define HCI_HOLD_MODE_MIN_PER_OFF 4
271/* Hold Mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800272
Myles Watson911d1ae2016-11-28 16:44:40 -0800273/* Sniff Mode */
274extern void btsnd_hcic_sniff_mode(uint16_t handle, uint16_t max_sniff_period,
275 uint16_t min_sniff_period,
276 uint16_t sniff_attempt,
277 uint16_t sniff_timeout);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800278
Myles Watson911d1ae2016-11-28 16:44:40 -0800279#define HCIC_PARAM_SIZE_SNIFF_MODE 10
The Android Open Source Project5738f832012-12-12 16:00:35 -0800280
Myles Watson911d1ae2016-11-28 16:44:40 -0800281#define HCI_SNIFF_MODE_HANDLE_OFF 0
282#define HCI_SNIFF_MODE_MAX_PER_OFF 2
283#define HCI_SNIFF_MODE_MIN_PER_OFF 4
284#define HCI_SNIFF_MODE_ATTEMPT_OFF 6
285#define HCI_SNIFF_MODE_TIMEOUT_OFF 8
286/* Sniff Mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800287
Myles Watson911d1ae2016-11-28 16:44:40 -0800288extern void btsnd_hcic_exit_sniff_mode(uint16_t handle); /* Exit Sniff Mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800289
Myles Watson911d1ae2016-11-28 16:44:40 -0800290/* Park Mode */
291extern void btsnd_hcic_park_mode(uint16_t handle, uint16_t beacon_max_interval,
292 uint16_t beacon_min_interval);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800293
Myles Watson911d1ae2016-11-28 16:44:40 -0800294#define HCIC_PARAM_SIZE_PARK_MODE 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800295
Myles Watson911d1ae2016-11-28 16:44:40 -0800296#define HCI_PARK_MODE_HANDLE_OFF 0
297#define HCI_PARK_MODE_MAX_PER_OFF 2
298#define HCI_PARK_MODE_MIN_PER_OFF 4
299/* Park Mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800300
Myles Watson911d1ae2016-11-28 16:44:40 -0800301extern void btsnd_hcic_exit_park_mode(uint16_t handle); /* Exit Park Mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800302
Myles Watson911d1ae2016-11-28 16:44:40 -0800303/* QoS Setup */
304extern void btsnd_hcic_qos_setup(uint16_t handle, uint8_t flags,
305 uint8_t service_type, uint32_t token_rate,
306 uint32_t peak, uint32_t latency,
307 uint32_t delay_var);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800308
Myles Watson911d1ae2016-11-28 16:44:40 -0800309#define HCIC_PARAM_SIZE_QOS_SETUP 20
The Android Open Source Project5738f832012-12-12 16:00:35 -0800310
Myles Watson911d1ae2016-11-28 16:44:40 -0800311#define HCI_QOS_HANDLE_OFF 0
312#define HCI_QOS_FLAGS_OFF 2
313#define HCI_QOS_SERVICE_TYPE_OFF 3
314#define HCI_QOS_TOKEN_RATE_OFF 4
315#define HCI_QOS_PEAK_BANDWIDTH_OFF 8
316#define HCI_QOS_LATENCY_OFF 12
317#define HCI_QOS_DELAY_VAR_OFF 16
318/* QoS Setup */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800319
Myles Watson911d1ae2016-11-28 16:44:40 -0800320/* Switch Role Request */
321extern void btsnd_hcic_switch_role(BD_ADDR bd_addr, uint8_t role);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800322
Myles Watson911d1ae2016-11-28 16:44:40 -0800323#define HCIC_PARAM_SIZE_SWITCH_ROLE 7
The Android Open Source Project5738f832012-12-12 16:00:35 -0800324
Myles Watson911d1ae2016-11-28 16:44:40 -0800325#define HCI_SWITCH_BD_ADDR_OFF 0
326#define HCI_SWITCH_ROLE_OFF 6
327/* Switch Role Request */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800328
Myles Watson911d1ae2016-11-28 16:44:40 -0800329/* Write Policy Settings */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700330extern void btsnd_hcic_write_policy_set(uint16_t handle, uint16_t settings);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800331
Myles Watson911d1ae2016-11-28 16:44:40 -0800332#define HCIC_PARAM_SIZE_WRITE_POLICY_SET 4
The Android Open Source Project5738f832012-12-12 16:00:35 -0800333
Myles Watson911d1ae2016-11-28 16:44:40 -0800334#define HCI_WRITE_POLICY_HANDLE_OFF 0
335#define HCI_WRITE_POLICY_SETTINGS_OFF 2
336/* Write Policy Settings */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800337
Myles Watson911d1ae2016-11-28 16:44:40 -0800338/* Write Default Policy Settings */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700339extern void btsnd_hcic_write_def_policy_set(uint16_t settings);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800340
Myles Watson911d1ae2016-11-28 16:44:40 -0800341#define HCIC_PARAM_SIZE_WRITE_DEF_POLICY_SET 2
The Android Open Source Project5738f832012-12-12 16:00:35 -0800342
Myles Watson911d1ae2016-11-28 16:44:40 -0800343#define HCI_WRITE_DEF_POLICY_SETTINGS_OFF 0
344/* Write Default Policy Settings */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800345
The Android Open Source Project5738f832012-12-12 16:00:35 -0800346/******************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800347 * Lisbon Features
348 ******************************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700349#if (BTM_SSR_INCLUDED == TRUE)
Myles Watson911d1ae2016-11-28 16:44:40 -0800350/* Sniff Subrating */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700351extern void btsnd_hcic_sniff_sub_rate(uint16_t handle, uint16_t max_lat,
Myles Watson911d1ae2016-11-28 16:44:40 -0800352 uint16_t min_remote_lat,
353 uint16_t min_local_lat);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800354
Myles Watson911d1ae2016-11-28 16:44:40 -0800355#define HCIC_PARAM_SIZE_SNIFF_SUB_RATE 8
The Android Open Source Project5738f832012-12-12 16:00:35 -0800356
Myles Watson911d1ae2016-11-28 16:44:40 -0800357#define HCI_SNIFF_SUB_RATE_HANDLE_OFF 0
358#define HCI_SNIFF_SUB_RATE_MAX_LAT_OFF 2
359#define HCI_SNIFF_SUB_RATE_MIN_REM_LAT_OFF 4
360#define HCI_SNIFF_SUB_RATE_MIN_LOC_LAT_OFF 6
361/* Sniff Subrating */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800362
Myles Watson911d1ae2016-11-28 16:44:40 -0800363#else /* BTM_SSR_INCLUDED == FALSE */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800364
Myles Watson911d1ae2016-11-28 16:44:40 -0800365#define btsnd_hcic_sniff_sub_rate(handle, max_lat, min_remote_lat, \
366 min_local_lat) \
367 false
The Android Open Source Project5738f832012-12-12 16:00:35 -0800368
Myles Watson911d1ae2016-11-28 16:44:40 -0800369#endif /* BTM_SSR_INCLUDED */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800370
Myles Watson911d1ae2016-11-28 16:44:40 -0800371/* Extended Inquiry Response */
372extern void btsnd_hcic_write_ext_inquiry_response(void* buffer,
373 uint8_t fec_req);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800374
Myles Watson911d1ae2016-11-28 16:44:40 -0800375#define HCIC_PARAM_SIZE_EXT_INQ_RESP 241
The Android Open Source Project5738f832012-12-12 16:00:35 -0800376
Myles Watson911d1ae2016-11-28 16:44:40 -0800377#define HCIC_EXT_INQ_RESP_FEC_OFF 0
378#define HCIC_EXT_INQ_RESP_RESPONSE 1
379/* IO Capabilities Response */
380extern void btsnd_hcic_io_cap_req_reply(BD_ADDR bd_addr, uint8_t capability,
381 uint8_t oob_present, uint8_t auth_req);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800382
Myles Watson911d1ae2016-11-28 16:44:40 -0800383#define HCIC_PARAM_SIZE_IO_CAP_RESP 9
The Android Open Source Project5738f832012-12-12 16:00:35 -0800384
Myles Watson911d1ae2016-11-28 16:44:40 -0800385#define HCI_IO_CAP_BD_ADDR_OFF 0
386#define HCI_IO_CAPABILITY_OFF 6
387#define HCI_IO_CAP_OOB_DATA_OFF 7
388#define HCI_IO_CAP_AUTH_REQ_OFF 8
The Android Open Source Project5738f832012-12-12 16:00:35 -0800389
Myles Watson911d1ae2016-11-28 16:44:40 -0800390/* IO Capabilities Req Neg Reply */
391extern void btsnd_hcic_io_cap_req_neg_reply(BD_ADDR bd_addr, uint8_t err_code);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800392
393#define HCIC_PARAM_SIZE_IO_CAP_NEG_REPLY 7
394
Myles Watson911d1ae2016-11-28 16:44:40 -0800395#define HCI_IO_CAP_NR_BD_ADDR_OFF 0
396#define HCI_IO_CAP_NR_ERR_CODE 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800397
Myles Watson911d1ae2016-11-28 16:44:40 -0800398/* Read Local OOB Data */
399extern void btsnd_hcic_read_local_oob_data(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800400
Myles Watson911d1ae2016-11-28 16:44:40 -0800401#define HCIC_PARAM_SIZE_R_LOCAL_OOB 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800402
Myles Watson911d1ae2016-11-28 16:44:40 -0800403extern void btsnd_hcic_user_conf_reply(BD_ADDR bd_addr, bool is_yes);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800404
Myles Watson911d1ae2016-11-28 16:44:40 -0800405#define HCIC_PARAM_SIZE_UCONF_REPLY 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800406
Myles Watson911d1ae2016-11-28 16:44:40 -0800407#define HCI_USER_CONF_BD_ADDR_OFF 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800408
Myles Watson911d1ae2016-11-28 16:44:40 -0800409extern void btsnd_hcic_user_passkey_reply(BD_ADDR bd_addr, uint32_t value);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800410
Myles Watson911d1ae2016-11-28 16:44:40 -0800411#define HCIC_PARAM_SIZE_U_PKEY_REPLY 10
The Android Open Source Project5738f832012-12-12 16:00:35 -0800412
Myles Watson911d1ae2016-11-28 16:44:40 -0800413#define HCI_USER_PASSKEY_BD_ADDR_OFF 0
414#define HCI_USER_PASSKEY_VALUE_OFF 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800415
Myles Watson911d1ae2016-11-28 16:44:40 -0800416extern void btsnd_hcic_user_passkey_neg_reply(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800417
418#define HCIC_PARAM_SIZE_U_PKEY_NEG_REPLY 6
419
420#define HCI_USER_PASSKEY_NEG_BD_ADDR_OFF 0
421
Myles Watson911d1ae2016-11-28 16:44:40 -0800422/* Remote OOB Data Request Reply */
423extern void btsnd_hcic_rem_oob_reply(BD_ADDR bd_addr, uint8_t* p_c,
424 uint8_t* p_r);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800425
Myles Watson911d1ae2016-11-28 16:44:40 -0800426#define HCIC_PARAM_SIZE_REM_OOB_REPLY 38
The Android Open Source Project5738f832012-12-12 16:00:35 -0800427
Myles Watson911d1ae2016-11-28 16:44:40 -0800428#define HCI_REM_OOB_DATA_BD_ADDR_OFF 0
429#define HCI_REM_OOB_DATA_C_OFF 6
430#define HCI_REM_OOB_DATA_R_OFF 22
The Android Open Source Project5738f832012-12-12 16:00:35 -0800431
Myles Watson911d1ae2016-11-28 16:44:40 -0800432/* Remote OOB Data Request Negative Reply */
433extern void btsnd_hcic_rem_oob_neg_reply(BD_ADDR bd_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800434
Myles Watson911d1ae2016-11-28 16:44:40 -0800435#define HCIC_PARAM_SIZE_REM_OOB_NEG_REPLY 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800436
Myles Watson911d1ae2016-11-28 16:44:40 -0800437#define HCI_REM_OOB_DATA_NEG_BD_ADDR_OFF 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800438
Myles Watson911d1ae2016-11-28 16:44:40 -0800439/* Read Tx Power Level */
440extern void btsnd_hcic_read_inq_tx_power(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800441
Myles Watson911d1ae2016-11-28 16:44:40 -0800442#define HCIC_PARAM_SIZE_R_TX_POWER 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800443
Myles Watson911d1ae2016-11-28 16:44:40 -0800444/* Read Default Erroneous Data Reporting */
445extern void btsnd_hcic_read_default_erroneous_data_rpt(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800446
Myles Watson911d1ae2016-11-28 16:44:40 -0800447#define HCIC_PARAM_SIZE_R_ERR_DATA_RPT 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800448
Marie Janssend19e0782016-07-15 12:48:27 -0700449#if (L2CAP_NON_FLUSHABLE_PB_INCLUDED == TRUE)
Myles Watson911d1ae2016-11-28 16:44:40 -0800450extern void btsnd_hcic_enhanced_flush(uint16_t handle, uint8_t packet_type);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800451
Myles Watson911d1ae2016-11-28 16:44:40 -0800452#define HCIC_PARAM_SIZE_ENHANCED_FLUSH 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800453#endif
454
Myles Watson911d1ae2016-11-28 16:44:40 -0800455extern void btsnd_hcic_send_keypress_notif(BD_ADDR bd_addr, uint8_t notif);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800456
Myles Watson911d1ae2016-11-28 16:44:40 -0800457#define HCIC_PARAM_SIZE_SEND_KEYPRESS_NOTIF 7
The Android Open Source Project5738f832012-12-12 16:00:35 -0800458
Myles Watson911d1ae2016-11-28 16:44:40 -0800459#define HCI_SEND_KEYPRESS_NOTIF_BD_ADDR_OFF 0
460#define HCI_SEND_KEYPRESS_NOTIF_NOTIF_OFF 6
The Android Open Source Project5738f832012-12-12 16:00:35 -0800461
The Android Open Source Project5738f832012-12-12 16:00:35 -0800462/**** end of Simple Pairing Commands ****/
463
Myles Watson911d1ae2016-11-28 16:44:40 -0800464/* Store Current Settings */
465#define MAX_FILT_COND (sizeof(BD_ADDR) + 1)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800466
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700467extern void btsnd_hcic_set_event_filter(uint8_t filt_type,
Myles Watson911d1ae2016-11-28 16:44:40 -0800468 uint8_t filt_cond_type,
469 uint8_t* filt_cond,
470 uint8_t filt_cond_len);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800471
Myles Watson911d1ae2016-11-28 16:44:40 -0800472#define HCIC_PARAM_SIZE_SET_EVT_FILTER 9
The Android Open Source Project5738f832012-12-12 16:00:35 -0800473
Myles Watson911d1ae2016-11-28 16:44:40 -0800474#define HCI_FILT_COND_FILT_TYPE_OFF 0
475#define HCI_FILT_COND_COND_TYPE_OFF 1
476#define HCI_FILT_COND_FILT_OFF 2
477/* Set Event Filter */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800478
Myles Watson911d1ae2016-11-28 16:44:40 -0800479/* Delete Stored Key */
480extern void btsnd_hcic_delete_stored_key(BD_ADDR bd_addr, bool delete_all_flag);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800481
Myles Watson911d1ae2016-11-28 16:44:40 -0800482#define HCIC_PARAM_SIZE_DELETE_STORED_KEY 7
The Android Open Source Project5738f832012-12-12 16:00:35 -0800483
Myles Watson911d1ae2016-11-28 16:44:40 -0800484#define HCI_DELETE_KEY_BD_ADDR_OFF 0
485#define HCI_DELETE_KEY_ALL_FLAG_OFF 6
486/* Delete Stored Key */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800487
Venkata Jagadeesh Garagaaabe70e2017-05-30 15:33:40 +0530488extern void btsnd_hcic_reset(uint8_t local_controller_id); /* Reset */
489
490#define HCIC_PARAM_SIZE_RESET 0 /* Reset */
491
Myles Watson911d1ae2016-11-28 16:44:40 -0800492/* Change Local Name */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700493extern void btsnd_hcic_change_name(BD_NAME name);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800494
Myles Watson911d1ae2016-11-28 16:44:40 -0800495#define HCIC_PARAM_SIZE_CHANGE_NAME BD_NAME_LEN
The Android Open Source Project5738f832012-12-12 16:00:35 -0800496
Myles Watson911d1ae2016-11-28 16:44:40 -0800497#define HCI_CHANGE_NAME_NAME_OFF 0
498/* Change Local Name */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800499
Myles Watson911d1ae2016-11-28 16:44:40 -0800500#define HCIC_PARAM_SIZE_READ_CMD 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800501
Myles Watson911d1ae2016-11-28 16:44:40 -0800502#define HCIC_PARAM_SIZE_WRITE_PARAM1 1
The Android Open Source Project5738f832012-12-12 16:00:35 -0800503
Myles Watson911d1ae2016-11-28 16:44:40 -0800504#define HCIC_WRITE_PARAM1_PARAM_OFF 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800505
Myles Watson911d1ae2016-11-28 16:44:40 -0800506#define HCIC_PARAM_SIZE_WRITE_PARAM2 2
The Android Open Source Project5738f832012-12-12 16:00:35 -0800507
Myles Watson911d1ae2016-11-28 16:44:40 -0800508#define HCIC_WRITE_PARAM2_PARAM_OFF 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800509
Myles Watson911d1ae2016-11-28 16:44:40 -0800510#define HCIC_PARAM_SIZE_WRITE_PARAM3 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800511
Myles Watson911d1ae2016-11-28 16:44:40 -0800512#define HCIC_WRITE_PARAM3_PARAM_OFF 0
The Android Open Source Project5738f832012-12-12 16:00:35 -0800513
Myles Watson911d1ae2016-11-28 16:44:40 -0800514#define HCIC_PARAM_SIZE_SET_AFH_CHANNELS 10
The Android Open Source Project5738f832012-12-12 16:00:35 -0800515
Myles Watson911d1ae2016-11-28 16:44:40 -0800516extern void btsnd_hcic_write_pin_type(uint8_t type); /* Write PIN Type */
517extern void btsnd_hcic_write_auto_accept(uint8_t flag); /* Write Auto Accept */
518extern void btsnd_hcic_read_name(void); /* Read Local Name */
519extern void btsnd_hcic_write_page_tout(
520 uint16_t timeout); /* Write Page Timout */
521extern void btsnd_hcic_write_scan_enable(uint8_t flag); /* Write Scan Enable */
522extern void btsnd_hcic_write_pagescan_cfg(
523 uint16_t interval, uint16_t window); /* Write Page Scan Activity */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800524
Mudumba Ananth181863e2017-02-09 09:05:48 -0800525#define HCIC_PARAM_SIZE_ENH_SET_ESCO_CONN 59
526#define HCIC_PARAM_SIZE_ENH_ACC_ESCO_CONN 63
527
Myles Watson911d1ae2016-11-28 16:44:40 -0800528#define HCIC_PARAM_SIZE_WRITE_PAGESCAN_CFG 4
The Android Open Source Project5738f832012-12-12 16:00:35 -0800529
Myles Watson911d1ae2016-11-28 16:44:40 -0800530#define HCI_SCAN_CFG_INTERVAL_OFF 0
531#define HCI_SCAN_CFG_WINDOW_OFF 2
532/* Write Page Scan Activity */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800533
Myles Watson911d1ae2016-11-28 16:44:40 -0800534/* Write Inquiry Scan Activity */
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700535extern void btsnd_hcic_write_inqscan_cfg(uint16_t interval, uint16_t window);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800536
Myles Watson911d1ae2016-11-28 16:44:40 -0800537#define HCIC_PARAM_SIZE_WRITE_INQSCAN_CFG 4
The Android Open Source Project5738f832012-12-12 16:00:35 -0800538
Myles Watson911d1ae2016-11-28 16:44:40 -0800539#define HCI_SCAN_CFG_INTERVAL_OFF 0
540#define HCI_SCAN_CFG_WINDOW_OFF 2
541/* Write Inquiry Scan Activity */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800542
Myles Watson911d1ae2016-11-28 16:44:40 -0800543extern void btsnd_hcic_write_auth_enable(
544 uint8_t flag); /* Write Authentication Enable */
545extern void btsnd_hcic_write_dev_class(
546 DEV_CLASS dev); /* Write Class of Device */
547extern void btsnd_hcic_write_voice_settings(
548 uint16_t flags); /* Write Voice Settings */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800549
550/* Host Controller to Host flow control */
Myles Watson911d1ae2016-11-28 16:44:40 -0800551#define HCI_HOST_FLOW_CTRL_OFF 0
552#define HCI_HOST_FLOW_CTRL_ACL_ON 1
553#define HCI_HOST_FLOW_CTRL_SCO_ON 2
554#define HCI_HOST_FLOW_CTRL_BOTH_ON 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800555
Myles Watson911d1ae2016-11-28 16:44:40 -0800556extern void btsnd_hcic_write_auto_flush_tout(
557 uint16_t handle, uint16_t timeout); /* Write Retransmit Timout */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800558
Myles Watson911d1ae2016-11-28 16:44:40 -0800559#define HCIC_PARAM_SIZE_WRITE_AUTO_FLUSH_TOUT 4
The Android Open Source Project5738f832012-12-12 16:00:35 -0800560
Myles Watson911d1ae2016-11-28 16:44:40 -0800561#define HCI_FLUSH_TOUT_HANDLE_OFF 0
562#define HCI_FLUSH_TOUT_TOUT_OFF 2
The Android Open Source Project5738f832012-12-12 16:00:35 -0800563
Myles Watson911d1ae2016-11-28 16:44:40 -0800564extern void btsnd_hcic_read_tx_power(uint16_t handle,
565 uint8_t type); /* Read Tx Power */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800566
Myles Watson911d1ae2016-11-28 16:44:40 -0800567#define HCIC_PARAM_SIZE_READ_TX_POWER 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800568
Myles Watson911d1ae2016-11-28 16:44:40 -0800569#define HCI_READ_TX_POWER_HANDLE_OFF 0
570#define HCI_READ_TX_POWER_TYPE_OFF 2
The Android Open Source Project5738f832012-12-12 16:00:35 -0800571
572/* Read transmit power level parameter */
Myles Watson911d1ae2016-11-28 16:44:40 -0800573#define HCI_READ_CURRENT 0x00
574#define HCI_READ_MAXIMUM 0x01
The Android Open Source Project5738f832012-12-12 16:00:35 -0800575
Myles Watson911d1ae2016-11-28 16:44:40 -0800576extern void btsnd_hcic_host_num_xmitted_pkts(
577 uint8_t num_handles, uint16_t* handle,
578 uint16_t* num_pkts); /* Set Host Buffer Size */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800579
Myles Watson911d1ae2016-11-28 16:44:40 -0800580#define HCIC_PARAM_SIZE_NUM_PKTS_DONE_SIZE sizeof(btmsg_hcic_num_pkts_done_t)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800581
Myles Watson911d1ae2016-11-28 16:44:40 -0800582#define MAX_DATA_HANDLES 10
The Android Open Source Project5738f832012-12-12 16:00:35 -0800583
Myles Watson911d1ae2016-11-28 16:44:40 -0800584#define HCI_PKTS_DONE_NUM_HANDLES_OFF 0
585#define HCI_PKTS_DONE_HANDLE_OFF 1
586#define HCI_PKTS_DONE_NUM_PKTS_OFF 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800587
Myles Watson911d1ae2016-11-28 16:44:40 -0800588/* Write Link Supervision Timeout */
589extern void btsnd_hcic_write_link_super_tout(uint8_t local_controller_id,
590 uint16_t handle, uint16_t timeout);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800591
Myles Watson911d1ae2016-11-28 16:44:40 -0800592#define HCIC_PARAM_SIZE_WRITE_LINK_SUPER_TOUT 4
The Android Open Source Project5738f832012-12-12 16:00:35 -0800593
Myles Watson911d1ae2016-11-28 16:44:40 -0800594#define HCI_LINK_SUPER_TOUT_HANDLE_OFF 0
595#define HCI_LINK_SUPER_TOUT_TOUT_OFF 2
596/* Write Link Supervision Timeout */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800597
Myles Watson911d1ae2016-11-28 16:44:40 -0800598extern void btsnd_hcic_write_cur_iac_lap(
599 uint8_t num_cur_iac, LAP* const iac_lap); /* Write Current IAC LAP */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800600
Myles Watson911d1ae2016-11-28 16:44:40 -0800601#define MAX_IAC_LAPS 0x40
The Android Open Source Project5738f832012-12-12 16:00:35 -0800602
Myles Watson911d1ae2016-11-28 16:44:40 -0800603#define HCI_WRITE_IAC_LAP_NUM_OFF 0
604#define HCI_WRITE_IAC_LAP_LAP_OFF 1
605/* Write Current IAC LAP */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800606
Myles Watson911d1ae2016-11-28 16:44:40 -0800607extern void btsnd_hcic_get_link_quality(uint16_t handle); /* Get Link Quality */
608extern void btsnd_hcic_read_rssi(uint16_t handle); /* Read RSSI */
609extern void btsnd_hcic_enable_test_mode(
610 void); /* Enable Device Under Test Mode */
611extern void btsnd_hcic_write_pagescan_type(
612 uint8_t type); /* Write Page Scan Type */
613extern void btsnd_hcic_write_inqscan_type(
614 uint8_t type); /* Write Inquiry Scan Type */
615extern void btsnd_hcic_write_inquiry_mode(
616 uint8_t type); /* Write Inquiry Mode */
The Android Open Source Project5738f832012-12-12 16:00:35 -0800617
Mudumba Ananth181863e2017-02-09 09:05:48 -0800618/* Enhanced setup SCO connection (CSA2) */
619extern void btsnd_hcic_enhanced_set_up_synchronous_connection(
620 uint16_t conn_handle, enh_esco_params_t* p_parms);
621
622/* Enhanced accept SCO connection request (CSA2) */
623extern void btsnd_hcic_enhanced_accept_synchronous_connection(
624 BD_ADDR bd_addr, enh_esco_params_t* p_parms);
625
The Android Open Source Project5738f832012-12-12 16:00:35 -0800626#define HCI_DATA_HANDLE_MASK 0x0FFF
627
Myles Watson911d1ae2016-11-28 16:44:40 -0800628#define HCID_GET_HANDLE_EVENT(p) \
629 (uint16_t)((*((uint8_t*)((p) + 1) + (p)->offset) + \
630 (*((uint8_t*)((p) + 1) + (p)->offset + 1) << 8)))
The Android Open Source Project5738f832012-12-12 16:00:35 -0800631
Myles Watson911d1ae2016-11-28 16:44:40 -0800632#define HCID_GET_HANDLE(u16) (uint16_t)((u16)&HCI_DATA_HANDLE_MASK)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800633
Myles Watson911d1ae2016-11-28 16:44:40 -0800634#define HCI_DATA_EVENT_MASK 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800635#define HCI_DATA_EVENT_OFFSET 12
Myles Watson911d1ae2016-11-28 16:44:40 -0800636#define HCID_GET_EVENT(u16) \
637 (uint8_t)(((u16) >> HCI_DATA_EVENT_OFFSET) & HCI_DATA_EVENT_MASK)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800638
Myles Watson911d1ae2016-11-28 16:44:40 -0800639#define HCI_DATA_BCAST_MASK 3
The Android Open Source Project5738f832012-12-12 16:00:35 -0800640#define HCI_DATA_BCAST_OFFSET 10
Myles Watson911d1ae2016-11-28 16:44:40 -0800641#define HCID_GET_BCAST(u16) \
642 (uint8_t)(((u16) >> HCI_DATA_BCAST_OFFSET) & HCI_DATA_BCAST_MASK)
The Android Open Source Project5738f832012-12-12 16:00:35 -0800643
Myles Watson911d1ae2016-11-28 16:44:40 -0800644#define HCID_GET_ACL_LEN(p) \
645 (uint16_t)((*((uint8_t*)((p) + 1) + (p)->offset + 2) + \
646 (*((uint8_t*)((p) + 1) + (p)->offset + 3) << 8)))
The Android Open Source Project5738f832012-12-12 16:00:35 -0800647
Myles Watson911d1ae2016-11-28 16:44:40 -0800648#define HCID_HEADER_SIZE 4
The Android Open Source Project5738f832012-12-12 16:00:35 -0800649
Myles Watson911d1ae2016-11-28 16:44:40 -0800650#define HCID_GET_SCO_LEN(p) (*((uint8_t*)((p) + 1) + (p)->offset + 2))
RAJATH R9d59e3f2017-06-07 14:45:28 +0530651extern void btsnd_hcic_raw_cmd (void *buffer, uint16_t opcode, uint8_t len,
652 uint8_t *p_data, void *p_cmd_cplt_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800653
Myles Watson911d1ae2016-11-28 16:44:40 -0800654extern void btsnd_hcic_vendor_spec_cmd(void* buffer, uint16_t opcode,
655 uint8_t len, uint8_t* p_data,
656 void* p_cmd_cplt_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800657
Myles Watsonee96a3c2016-11-23 14:49:54 -0800658/*******************************************************************************
659 * BLE Commands
Myles Watson9ca07092016-11-28 16:41:53 -0800660 * Note: "local_controller_id" is for transport, not counted in HCI
661 * message size
Myles Watsonee96a3c2016-11-23 14:49:54 -0800662 ******************************************************************************/
Myles Watson911d1ae2016-11-28 16:44:40 -0800663#define HCIC_BLE_RAND_DI_SIZE 8
664#define HCIC_BLE_ENCRYT_KEY_SIZE 16
665#define HCIC_BLE_IRK_SIZE 16
Satya Calloji444a8da2015-03-06 10:38:22 -0800666
Myles Watson911d1ae2016-11-28 16:44:40 -0800667#define HCIC_PARAM_SIZE_SET_USED_FEAT_CMD 8
668#define HCIC_PARAM_SIZE_WRITE_RANDOM_ADDR_CMD 6
669#define HCIC_PARAM_SIZE_BLE_WRITE_ADV_PARAMS 15
670#define HCIC_PARAM_SIZE_BLE_WRITE_SCAN_RSP 31
671#define HCIC_PARAM_SIZE_WRITE_ADV_ENABLE 1
672#define HCIC_PARAM_SIZE_BLE_WRITE_SCAN_PARAM 7
673#define HCIC_PARAM_SIZE_BLE_WRITE_SCAN_ENABLE 2
674#define HCIC_PARAM_SIZE_BLE_CREATE_LL_CONN 25
675#define HCIC_PARAM_SIZE_BLE_CREATE_CONN_CANCEL 0
676#define HCIC_PARAM_SIZE_CLEAR_WHITE_LIST 0
677#define HCIC_PARAM_SIZE_ADD_WHITE_LIST 7
678#define HCIC_PARAM_SIZE_REMOVE_WHITE_LIST 7
679#define HCIC_PARAM_SIZE_BLE_UPD_LL_CONN_PARAMS 14
680#define HCIC_PARAM_SIZE_SET_HOST_CHNL_CLASS 5
681#define HCIC_PARAM_SIZE_READ_CHNL_MAP 2
682#define HCIC_PARAM_SIZE_BLE_READ_REMOTE_FEAT 2
683#define HCIC_PARAM_SIZE_BLE_ENCRYPT 32
Priti Aghera636d6712014-12-18 13:55:48 -0800684#define HCIC_PARAM_SIZE_WRITE_LE_HOST_SUPPORTED 2
The Android Open Source Project5738f832012-12-12 16:00:35 -0800685
Myles Watson911d1ae2016-11-28 16:44:40 -0800686#define HCIC_BLE_RAND_DI_SIZE 8
687#define HCIC_BLE_ENCRYT_KEY_SIZE 16
688#define HCIC_PARAM_SIZE_BLE_START_ENC \
689 (4 + HCIC_BLE_RAND_DI_SIZE + HCIC_BLE_ENCRYT_KEY_SIZE)
690#define HCIC_PARAM_SIZE_LTK_REQ_REPLY (2 + HCIC_BLE_ENCRYT_KEY_SIZE)
691#define HCIC_PARAM_SIZE_LTK_REQ_NEG_REPLY 2
692#define HCIC_BLE_CHNL_MAP_SIZE 5
693#define HCIC_PARAM_SIZE_BLE_WRITE_ADV_DATA 31
The Android Open Source Project5738f832012-12-12 16:00:35 -0800694
Myles Watson911d1ae2016-11-28 16:44:40 -0800695#define HCIC_PARAM_SIZE_BLE_ADD_DEV_RESOLVING_LIST (7 + HCIC_BLE_IRK_SIZE * 2)
696#define HCIC_PARAM_SIZE_BLE_RM_DEV_RESOLVING_LIST 7
Jakub Pawlowski56aed812017-04-07 06:19:50 -0700697#define HCIC_PARAM_SIZE_BLE_SET_PRIVACY_MODE 8
Myles Watson911d1ae2016-11-28 16:44:40 -0800698#define HCIC_PARAM_SIZE_BLE_CLEAR_RESOLVING_LIST 0
699#define HCIC_PARAM_SIZE_BLE_READ_RESOLVING_LIST_SIZE 0
700#define HCIC_PARAM_SIZE_BLE_READ_RESOLVABLE_ADDR_PEER 7
701#define HCIC_PARAM_SIZE_BLE_READ_RESOLVABLE_ADDR_LOCAL 7
702#define HCIC_PARAM_SIZE_BLE_SET_ADDR_RESOLUTION_ENABLE 1
703#define HCIC_PARAM_SIZE_BLE_SET_RAND_PRIV_ADDR_TIMOUT 2
704#define HCIC_PARAM_SIZE_BLE_SET_DATA_LENGTH 6
705#define HCIC_PARAM_SIZE_BLE_WRITE_EXTENDED_SCAN_PARAM 11
Satya Calloji444a8da2015-03-06 10:38:22 -0800706
The Android Open Source Project5738f832012-12-12 16:00:35 -0800707/* ULP HCI command */
Myles Watson911d1ae2016-11-28 16:44:40 -0800708extern void btsnd_hcic_ble_set_evt_mask(BT_EVENT_MASK event_mask);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800709
Myles Watson911d1ae2016-11-28 16:44:40 -0800710extern void btsnd_hcic_ble_read_buffer_size(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800711
Myles Watson911d1ae2016-11-28 16:44:40 -0800712extern void btsnd_hcic_ble_read_local_spt_feat(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800713
Myles Watson911d1ae2016-11-28 16:44:40 -0800714extern void btsnd_hcic_ble_set_local_used_feat(uint8_t feat_set[8]);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800715
Myles Watson911d1ae2016-11-28 16:44:40 -0800716extern void btsnd_hcic_ble_set_random_addr(BD_ADDR random_addr);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800717
Myles Watson911d1ae2016-11-28 16:44:40 -0800718extern void btsnd_hcic_ble_write_adv_params(
719 uint16_t adv_int_min, uint16_t adv_int_max, uint8_t adv_type,
720 uint8_t addr_type_own, uint8_t addr_type_dir, BD_ADDR direct_bda,
721 uint8_t channel_map, uint8_t adv_filter_policy);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800722
Myles Watson911d1ae2016-11-28 16:44:40 -0800723extern void btsnd_hcic_ble_read_adv_chnl_tx_power(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800724
Myles Watson911d1ae2016-11-28 16:44:40 -0800725extern void btsnd_hcic_ble_set_adv_data(uint8_t data_len, uint8_t* p_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800726
Myles Watson911d1ae2016-11-28 16:44:40 -0800727extern void btsnd_hcic_ble_set_scan_rsp_data(uint8_t data_len,
728 uint8_t* p_scan_rsp);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800729
Myles Watson911d1ae2016-11-28 16:44:40 -0800730extern void btsnd_hcic_ble_set_adv_enable(uint8_t adv_enable);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800731
Myles Watson911d1ae2016-11-28 16:44:40 -0800732extern void btsnd_hcic_ble_set_scan_params(uint8_t scan_type, uint16_t scan_int,
733 uint16_t scan_win, uint8_t addr_type,
734 uint8_t scan_filter_policy);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800735
Myles Watson911d1ae2016-11-28 16:44:40 -0800736extern void btsnd_hcic_ble_set_scan_enable(uint8_t scan_enable,
737 uint8_t duplicate);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800738
Myles Watson911d1ae2016-11-28 16:44:40 -0800739extern void btsnd_hcic_ble_create_ll_conn(
740 uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
741 uint8_t addr_type_peer, BD_ADDR bda_peer, uint8_t addr_type_own,
742 uint16_t conn_int_min, uint16_t conn_int_max, uint16_t conn_latency,
743 uint16_t conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800744
Myles Watson911d1ae2016-11-28 16:44:40 -0800745extern void btsnd_hcic_ble_create_conn_cancel(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800746
Myles Watson911d1ae2016-11-28 16:44:40 -0800747extern void btsnd_hcic_ble_read_white_list_size(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800748
Myles Watson911d1ae2016-11-28 16:44:40 -0800749extern void btsnd_hcic_ble_clear_white_list(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800750
Myles Watson911d1ae2016-11-28 16:44:40 -0800751extern void btsnd_hcic_ble_add_white_list(uint8_t addr_type, BD_ADDR bda);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800752
Myles Watson911d1ae2016-11-28 16:44:40 -0800753extern void btsnd_hcic_ble_remove_from_white_list(uint8_t addr_type,
754 BD_ADDR bda);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800755
Myles Watson911d1ae2016-11-28 16:44:40 -0800756extern void btsnd_hcic_ble_upd_ll_conn_params(
757 uint16_t handle, uint16_t conn_int_min, uint16_t conn_int_max,
758 uint16_t conn_latency, uint16_t conn_timeout, uint16_t min_len,
759 uint16_t max_len);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800760
Myles Watson911d1ae2016-11-28 16:44:40 -0800761extern void btsnd_hcic_ble_set_host_chnl_class(
762 uint8_t chnl_map[HCIC_BLE_CHNL_MAP_SIZE]);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800763
Myles Watson911d1ae2016-11-28 16:44:40 -0800764extern void btsnd_hcic_ble_read_chnl_map(uint16_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800765
Myles Watson911d1ae2016-11-28 16:44:40 -0800766extern void btsnd_hcic_ble_read_remote_feat(uint16_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800767
Myles Watson911d1ae2016-11-28 16:44:40 -0800768extern void btsnd_hcic_ble_encrypt(uint8_t* key, uint8_t key_len,
769 uint8_t* plain_text, uint8_t pt_len,
770 void* p_cmd_cplt_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800771
Jakub Pawlowski0c683232017-02-24 09:49:59 -0800772extern void btsnd_hcic_ble_rand(base::Callback<void(BT_OCTET8)> cb);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800773
Myles Watson911d1ae2016-11-28 16:44:40 -0800774extern void btsnd_hcic_ble_start_enc(uint16_t handle,
775 uint8_t rand[HCIC_BLE_RAND_DI_SIZE],
776 uint16_t ediv,
777 uint8_t ltk[HCIC_BLE_ENCRYT_KEY_SIZE]);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800778
Myles Watson911d1ae2016-11-28 16:44:40 -0800779extern void btsnd_hcic_ble_ltk_req_reply(uint16_t handle,
780 uint8_t ltk[HCIC_BLE_ENCRYT_KEY_SIZE]);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800781
Myles Watson911d1ae2016-11-28 16:44:40 -0800782extern void btsnd_hcic_ble_ltk_req_neg_reply(uint16_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800783
Myles Watson911d1ae2016-11-28 16:44:40 -0800784extern void btsnd_hcic_ble_read_supported_states(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800785
Myles Watson911d1ae2016-11-28 16:44:40 -0800786extern void btsnd_hcic_ble_write_host_supported(uint8_t le_host_spt,
787 uint8_t simul_le_host_spt);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800788
Myles Watson911d1ae2016-11-28 16:44:40 -0800789extern void btsnd_hcic_ble_read_host_supported(void);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800790
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700791extern void btsnd_hcic_ble_receiver_test(uint8_t rx_freq);
Ganesh Ganapathi Battaead3cde2013-02-05 15:22:31 -0800792
Myles Watson911d1ae2016-11-28 16:44:40 -0800793extern void btsnd_hcic_ble_transmitter_test(uint8_t tx_freq,
794 uint8_t test_data_len,
795 uint8_t payload);
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700796extern void btsnd_hcic_ble_test_end(void);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800797
Marie Janssend19e0782016-07-15 12:48:27 -0700798#if (BLE_LLT_INCLUDED == TRUE)
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700799
Myles Watson911d1ae2016-11-28 16:44:40 -0800800#define HCIC_PARAM_SIZE_BLE_RC_PARAM_REQ_REPLY 14
801extern void btsnd_hcic_ble_rc_param_req_reply(
802 uint16_t handle, uint16_t conn_int_min, uint16_t conn_int_max,
803 uint16_t conn_latency, uint16_t conn_timeout, uint16_t min_ce_len,
804 uint16_t max_ce_len);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700805
Myles Watson911d1ae2016-11-28 16:44:40 -0800806#define HCIC_PARAM_SIZE_BLE_RC_PARAM_REQ_NEG_REPLY 3
807extern void btsnd_hcic_ble_rc_param_req_neg_reply(uint16_t handle,
808 uint8_t reason);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700809
810#endif /* BLE_LLT_INCLUDED */
811
Myles Watson911d1ae2016-11-28 16:44:40 -0800812extern void btsnd_hcic_ble_set_data_length(uint16_t conn_handle,
813 uint16_t tx_octets,
814 uint16_t tx_time);
Ganesh Ganapathi Batta7fa4fba2014-04-16 16:50:09 -0700815
Myles Watson911d1ae2016-11-28 16:44:40 -0800816extern void btsnd_hcic_ble_add_device_resolving_list(
817 uint8_t addr_type_peer, BD_ADDR bda_peer,
818 uint8_t irk_peer[HCIC_BLE_IRK_SIZE], uint8_t irk_local[HCIC_BLE_IRK_SIZE]);
Satya Calloji444a8da2015-03-06 10:38:22 -0800819
Jakub Pawlowski9df2a552016-12-02 11:34:06 -0800820struct scanning_phy_cfg {
821 uint8_t scan_type;
822 uint16_t scan_int;
823 uint16_t scan_win;
824};
825
826extern void btsnd_hcic_ble_set_extended_scan_params(
827 uint8_t own_address_type, uint8_t scanning_filter_policy,
828 uint8_t scanning_phys, scanning_phy_cfg* phy_cfg);
829
830extern void btsnd_hcic_ble_set_extended_scan_enable(uint8_t enable,
831 uint8_t filter_duplicates,
832 uint16_t duration,
833 uint16_t period);
834
Jakub Pawlowski93df8602017-02-15 08:35:30 -0800835struct EXT_CONN_PHY_CFG {
836 uint16_t scan_int;
837 uint16_t scan_win;
838 uint16_t conn_int_min;
839 uint16_t conn_int_max;
840 uint16_t conn_latency;
841 uint16_t sup_timeout;
842 uint16_t min_ce_len;
843 uint16_t max_ce_len;
844};
845
846extern void btsnd_hcic_ble_ext_create_conn(
847 uint8_t init_filter_policy, uint8_t addr_type_own, uint8_t addr_type_peer,
848 BD_ADDR bda_peer, uint8_t initiating_phys, EXT_CONN_PHY_CFG* phy_cfg);
849
Jakub Pawlowski9df2a552016-12-02 11:34:06 -0800850extern void btsnd_hcic_ble_add_device_resolving_list(
851 uint8_t addr_type_peer, BD_ADDR bda_peer,
852 uint8_t irk_peer[HCIC_BLE_IRK_SIZE], uint8_t irk_local[HCIC_BLE_IRK_SIZE]);
853
Myles Watson911d1ae2016-11-28 16:44:40 -0800854extern void btsnd_hcic_ble_rm_device_resolving_list(uint8_t addr_type_peer,
855 BD_ADDR bda_peer);
Satya Calloji444a8da2015-03-06 10:38:22 -0800856
Jakub Pawlowski56aed812017-04-07 06:19:50 -0700857extern void btsnd_hcic_ble_set_privacy_mode(uint8_t addr_type_peer,
858 BD_ADDR bda_peer,
859 uint8_t privacy_type);
860
Myles Watson911d1ae2016-11-28 16:44:40 -0800861extern void btsnd_hcic_ble_clear_resolving_list(void);
Satya Calloji444a8da2015-03-06 10:38:22 -0800862
Myles Watson911d1ae2016-11-28 16:44:40 -0800863extern void btsnd_hcic_ble_read_resolvable_addr_peer(uint8_t addr_type_peer,
864 BD_ADDR bda_peer);
Satya Calloji444a8da2015-03-06 10:38:22 -0800865
Myles Watson911d1ae2016-11-28 16:44:40 -0800866extern void btsnd_hcic_ble_read_resolvable_addr_local(uint8_t addr_type_peer,
867 BD_ADDR bda_peer);
Satya Calloji444a8da2015-03-06 10:38:22 -0800868
Myles Watson911d1ae2016-11-28 16:44:40 -0800869extern void btsnd_hcic_ble_set_addr_resolution_enable(
870 uint8_t addr_resolution_enable);
Satya Calloji444a8da2015-03-06 10:38:22 -0800871
Myles Watson911d1ae2016-11-28 16:44:40 -0800872extern void btsnd_hcic_ble_set_rand_priv_addr_timeout(uint16_t rpa_timout);
Satya Calloji444a8da2015-03-06 10:38:22 -0800873
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700874extern void btsnd_hcic_read_authenticated_payload_tout(uint16_t handle);
Satya Calloji444a8da2015-03-06 10:38:22 -0800875
Jakub Pawlowski763abdf2016-10-10 11:39:39 -0700876extern void btsnd_hcic_write_authenticated_payload_tout(uint16_t handle,
Myles Watson911d1ae2016-11-28 16:44:40 -0800877 uint16_t timeout);
Satya Calloji444a8da2015-03-06 10:38:22 -0800878
Myles Watson911d1ae2016-11-28 16:44:40 -0800879#define HCIC_PARAM_SIZE_WRITE_AUTHENT_PAYLOAD_TOUT 4
Satya Calloji444a8da2015-03-06 10:38:22 -0800880
Myles Watson911d1ae2016-11-28 16:44:40 -0800881#define HCI__WRITE_AUTHENT_PAYLOAD_TOUT_HANDLE_OFF 0
882#define HCI__WRITE_AUTHENT_PAYLOAD_TOUT_TOUT_OFF 2
Satya Calloji444a8da2015-03-06 10:38:22 -0800883
The Android Open Source Project5738f832012-12-12 16:00:35 -0800884#endif