Maxim Integrated Bluetooth LE Library

Dependents:   BLE_Thermometer MAXWSNENV_demo

Committer:
enginerd
Date:
Thu Oct 06 22:02:31 2016 +0000
Revision:
5:5b87f64ce81e
Parent:
0:b562096246b3
Added new required method.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
enginerd 0:b562096246b3 1 /*************************************************************************************************/
enginerd 0:b562096246b3 2 /*!
enginerd 0:b562096246b3 3 * \file hci_defs.h
enginerd 0:b562096246b3 4 *
enginerd 0:b562096246b3 5 * \brief HCI constants and definitions from the Bluetooth specification.
enginerd 0:b562096246b3 6 *
enginerd 0:b562096246b3 7 * $Date: 2012-06-26 21:53:53 -0700 (Tue, 26 Jun 2012) $
enginerd 0:b562096246b3 8 * $Revision: 337 $
enginerd 0:b562096246b3 9 *
enginerd 0:b562096246b3 10 * Copyright (c) 2009-2016 ARM Limited. All rights reserved.
enginerd 0:b562096246b3 11 *
enginerd 0:b562096246b3 12 * SPDX-License-Identifier: LicenseRef-PBL
enginerd 0:b562096246b3 13 *
enginerd 0:b562096246b3 14 * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use
enginerd 0:b562096246b3 15 * this file except in compliance with the License. You may obtain a copy of the License at
enginerd 0:b562096246b3 16 *
enginerd 0:b562096246b3 17 * https://www.mbed.com/licenses/PBL-1.0
enginerd 0:b562096246b3 18 *
enginerd 0:b562096246b3 19 * See the License for the specific language governing permissions and limitations under the License.
enginerd 0:b562096246b3 20 */
enginerd 0:b562096246b3 21 /*************************************************************************************************/
enginerd 0:b562096246b3 22 #ifndef HCI_DEFS_H
enginerd 0:b562096246b3 23 #define HCI_DEFS_H
enginerd 0:b562096246b3 24
enginerd 0:b562096246b3 25 #ifdef __cplusplus
enginerd 0:b562096246b3 26 extern "C" {
enginerd 0:b562096246b3 27 #endif
enginerd 0:b562096246b3 28
enginerd 0:b562096246b3 29 /*! Packet definitions */
enginerd 0:b562096246b3 30 #define HCI_CMD_HDR_LEN 3 /*! Command packet header length */
enginerd 0:b562096246b3 31 #define HCI_ACL_HDR_LEN 4 /*! ACL packet header length */
enginerd 0:b562096246b3 32 #define HCI_EVT_HDR_LEN 2 /*! Event packet header length */
enginerd 0:b562096246b3 33 #define HCI_EVT_PARAM_MAX_LEN 255 /*! Maximum length of event packet parameters */
enginerd 0:b562096246b3 34 #define HCI_PB_FLAG_MASK 0x1000 /*! ACL packet boundary flag mask */
enginerd 0:b562096246b3 35 #define HCI_PB_START 0x0000 /*! Packet boundary flag, start */
enginerd 0:b562096246b3 36 #define HCI_PB_CONTINUE 0x1000 /*! Packet boundary flag, continue */
enginerd 0:b562096246b3 37 #define HCI_HANDLE_MASK 0x0FFF /*! Mask for handle bits in ACL packet */
enginerd 0:b562096246b3 38 #define HCI_HANDLE_NONE 0xFFFF /*! Value for invalid handle */
enginerd 0:b562096246b3 39
enginerd 0:b562096246b3 40 /*! Packet types */
enginerd 0:b562096246b3 41 #define HCI_CMD_TYPE 1 /*! HCI command packet */
enginerd 0:b562096246b3 42 #define HCI_ACL_TYPE 2 /*! HCI ACL data packet */
enginerd 0:b562096246b3 43 #define HCI_EVT_TYPE 4 /*! HCI event packet */
enginerd 0:b562096246b3 44
enginerd 0:b562096246b3 45 /*! Error codes */
enginerd 0:b562096246b3 46 #define HCI_SUCCESS 0x00 /*! Success */
enginerd 0:b562096246b3 47 #define HCI_ERR_UNKNOWN_CMD 0x01 /*! Unknown HCI command */
enginerd 0:b562096246b3 48 #define HCI_ERR_UNKNOWN_HANDLE 0x02 /*! Unknown connection identifier */
enginerd 0:b562096246b3 49 #define HCI_ERR_HARDWARE_FAILURE 0x03 /*! Hardware failure */
enginerd 0:b562096246b3 50 #define HCI_ERR_PAGE_TIMEOUT 0x04 /*! Page timeout */
enginerd 0:b562096246b3 51 #define HCI_ERR_AUTH_FAILURE 0x05 /*! Authentication failure */
enginerd 0:b562096246b3 52 #define HCI_ERR_KEY_MISSING 0x06 /*! PIN or key missing */
enginerd 0:b562096246b3 53 #define HCI_ERR_MEMORY_EXCEEDED 0x07 /*! Memory capacity exceeded */
enginerd 0:b562096246b3 54 #define HCI_ERR_CONN_TIMEOUT 0x08 /*! Connection timeout */
enginerd 0:b562096246b3 55 #define HCI_ERR_CONN_LIMIT 0x09 /*! Connection limit exceeded */
enginerd 0:b562096246b3 56 #define HCI_ERR_SYNCH_CONN_LIMIT 0x0A /*! Synchronous connection limit exceeded */
enginerd 0:b562096246b3 57 #define HCI_ERR_ACL_CONN_EXISTS 0x0B /*! ACL connection already exists */
enginerd 0:b562096246b3 58 #define HCI_ERR_CMD_DISALLOWED 0x0C /*! Command disallowed */
enginerd 0:b562096246b3 59 #define HCI_ERR_REJ_RESOURCES 0x0D /*! Connection rejected limited resources */
enginerd 0:b562096246b3 60 #define HCI_ERR_REJ_SECURITY 0x0E /*! Connection rejected security reasons */
enginerd 0:b562096246b3 61 #define HCI_ERR_REJ_BD_ADDR 0x0F /*! Connection rejected unacceptable BD_ADDR */
enginerd 0:b562096246b3 62 #define HCI_ERR_ACCEPT_TIMEOUT 0x10 /*! Connection accept timeout exceeded */
enginerd 0:b562096246b3 63 #define HCI_ERR_UNSUP_FEAT 0x11 /*! Unsupported feature or parameter value */
enginerd 0:b562096246b3 64 #define HCI_ERR_INVALID_PARAM 0x12 /*! Invalid HCI command parameters */
enginerd 0:b562096246b3 65 #define HCI_ERR_REMOTE_TERMINATED 0x13 /*! Remote user terminated connection */
enginerd 0:b562096246b3 66 #define HCI_ERR_REMOTE_RESOURCES 0x14 /*! Remote device low resources */
enginerd 0:b562096246b3 67 #define HCI_ERR_REMOTE_POWER_OFF 0x15 /*! Remote device power off */
enginerd 0:b562096246b3 68 #define HCI_ERR_LOCAL_TERMINATED 0x16 /*! Connection terminated by local host */
enginerd 0:b562096246b3 69 #define HCI_ERR_REPEATED_ATTEMPTS 0x17 /*! Repeated attempts */
enginerd 0:b562096246b3 70 #define HCI_ERR_PAIRING_NOT_ALLOWED 0x18 /*! Pairing not allowed */
enginerd 0:b562096246b3 71 #define HCI_ERR_UNKNOWN_LMP_PDU 0x19 /*! Unknown LMP PDU */
enginerd 0:b562096246b3 72 #define HCI_ERR_UNSUP_REMOTE_FEAT 0x1A /*! Unsupported remote feature */
enginerd 0:b562096246b3 73 #define HCI_ERR_SCO_OFFSET 0x1B /*! SCO offset rejected */
enginerd 0:b562096246b3 74 #define HCI_ERR_SCO_INTERVAL 0x1C /*! SCO interval rejected */
enginerd 0:b562096246b3 75 #define HCI_ERR_SCO_MODE 0x1D /*! SCO air mode rejected */
enginerd 0:b562096246b3 76 #define HCI_ERR_LMP_PARAM 0x1E /*! Invalid LMP parameters */
enginerd 0:b562096246b3 77 #define HCI_ERR_UNSPECIFIED 0x1F /*! Unspecified error */
enginerd 0:b562096246b3 78 #define HCI_ERR_UNSUP_LMP_PARAM 0x20 /*! Unsupported LMP parameter value */
enginerd 0:b562096246b3 79 #define HCI_ERR_ROLE_CHANGE 0x21 /*! Role change not allowed */
enginerd 0:b562096246b3 80 #define HCI_ERR_LL_RESP_TIMEOUT 0x22 /*! LL response timeout */
enginerd 0:b562096246b3 81 #define HCI_ERR_LMP_COLLISION 0x23 /*! LMP error transaction collision */
enginerd 0:b562096246b3 82 #define HCI_ERR_LMP_PDU 0x24 /*! LMP pdu not allowed */
enginerd 0:b562096246b3 83 #define HCI_ERR_ENCRYPT_MODE 0x25 /*! Encryption mode not acceptable */
enginerd 0:b562096246b3 84 #define HCI_ERR_LINK_KEY 0x26 /*! Link key can not be changed */
enginerd 0:b562096246b3 85 #define HCI_ERR_UNSUP_QOS 0x27 /*! Requested qos not supported */
enginerd 0:b562096246b3 86 #define HCI_ERR_INSTANT_PASSED 0x28 /*! Instant passed */
enginerd 0:b562096246b3 87 #define HCI_ERR_UNSUP_UNIT_KEY 0x29 /*! Pairing with unit key not supported */
enginerd 0:b562096246b3 88 #define HCI_ERR_TRANSACT_COLLISION 0x2A /*! Different transaction collision */
enginerd 0:b562096246b3 89 #define HCI_ERR_CHANNEL_CLASS 0x2E /*! Channel classification not supported */
enginerd 0:b562096246b3 90 #define HCI_ERR_MEMORY 0x2F /*! Insufficient security */
enginerd 0:b562096246b3 91 #define HCI_ERR_PARAMETER_RANGE 0x30 /*! Parameter out of mandatory range */
enginerd 0:b562096246b3 92 #define HCI_ERR_ROLE_SWITCH_PEND 0x32 /*! Role switch pending */
enginerd 0:b562096246b3 93 #define HCI_ERR_RESERVED_SLOT 0x34 /*! Reserved slot violation */
enginerd 0:b562096246b3 94 #define HCI_ERR_ROLE_SWITCH 0x35 /*! Role switch failed */
enginerd 0:b562096246b3 95 #define HCI_ERR_INQ_TOO_LARGE 0x36 /*! Extended inquiry response too large */
enginerd 0:b562096246b3 96 #define HCI_ERR_UNSUP_SSP 0x37 /*! Secure simple pairing not supported by host */
enginerd 0:b562096246b3 97 #define HCI_ERR_HOST_BUSY_PAIRING 0x38 /*! Host busy - pairing */
enginerd 0:b562096246b3 98 #define HCI_ERR_NO_CHANNEL 0x39 /*! Connection rejected no suitable channel */
enginerd 0:b562096246b3 99 #define HCI_ERR_CONTROLLER_BUSY 0x3A /*! Controller busy */
enginerd 0:b562096246b3 100 #define HCI_ERR_CONN_INTERVAL 0x3B /*! Unacceptable connection interval */
enginerd 0:b562096246b3 101 #define HCI_ERR_ADV_TIMEOUT 0x3C /*! Directed advertising timeout */
enginerd 0:b562096246b3 102 #define HCI_ERR_MIC_FAILURE 0x3D /*! Connection terminated due to MIC failure */
enginerd 0:b562096246b3 103 #define HCI_ERR_CONN_FAIL 0x3E /*! Connection failed to be established */
enginerd 0:b562096246b3 104 #define HCI_ERR_MAC_CONN_FAIL 0x3F /*! MAC connection failed */
enginerd 0:b562096246b3 105
enginerd 0:b562096246b3 106 /*! Command groups */
enginerd 0:b562096246b3 107 #define HCI_OGF_NOP 0x00 /*! No operation */
enginerd 0:b562096246b3 108 #define HCI_OGF_LINK_CONTROL 0x01 /*! Link control */
enginerd 0:b562096246b3 109 #define HCI_OGF_LINK_POLICY 0x02 /*! Link policy */
enginerd 0:b562096246b3 110 #define HCI_OGF_CONTROLLER 0x03 /*! Controller and baseband */
enginerd 0:b562096246b3 111 #define HCI_OGF_INFORMATIONAL 0x04 /*! Informational parameters */
enginerd 0:b562096246b3 112 #define HCI_OGF_STATUS 0x05 /*! Status parameters */
enginerd 0:b562096246b3 113 #define HCI_OGF_TESTING 0x06 /*! Testing */
enginerd 0:b562096246b3 114 #define HCI_OGF_LE_CONTROLLER 0x08 /*! LE controller */
enginerd 0:b562096246b3 115 #define HCI_OGF_VENDOR_SPEC 0x3F /*! Vendor specific */
enginerd 0:b562096246b3 116
enginerd 0:b562096246b3 117 /*! NOP command */
enginerd 0:b562096246b3 118 #define HCI_OCF_NOP 0x00
enginerd 0:b562096246b3 119
enginerd 0:b562096246b3 120 /*! Link control commands */
enginerd 0:b562096246b3 121 #define HCI_OCF_DISCONNECT 0x06
enginerd 0:b562096246b3 122 #define HCI_OCF_READ_REMOTE_VER_INFO 0x1D
enginerd 0:b562096246b3 123
enginerd 0:b562096246b3 124 /*! Link policy commands (none used for LE) */
enginerd 0:b562096246b3 125
enginerd 0:b562096246b3 126 /*! Controller and baseband commands */
enginerd 0:b562096246b3 127 #define HCI_OCF_SET_EVENT_MASK 0x01
enginerd 0:b562096246b3 128 #define HCI_OCF_RESET 0x03
enginerd 0:b562096246b3 129 #define HCI_OCF_READ_TX_PWR_LVL 0x2D
enginerd 0:b562096246b3 130 #define HCI_OCF_SET_CONTROLLER_TO_HOST_FC 0x31
enginerd 0:b562096246b3 131 #define HCI_OCF_HOST_BUFFER_SIZE 0x33
enginerd 0:b562096246b3 132 #define HCI_OCF_HOST_NUM_CMPL_PKTS 0x35
enginerd 0:b562096246b3 133
enginerd 0:b562096246b3 134 /*! Informational commands */
enginerd 0:b562096246b3 135 #define HCI_OCF_READ_LOCAL_VER_INFO 0x01
enginerd 0:b562096246b3 136 #define HCI_OCF_READ_LOCAL_SUP_CMDS 0x02
enginerd 0:b562096246b3 137 #define HCI_OCF_READ_LOCAL_SUP_FEAT 0x03
enginerd 0:b562096246b3 138 #define HCI_OCF_READ_BUF_SIZE 0x05
enginerd 0:b562096246b3 139 #define HCI_OCF_READ_BD_ADDR 0x09
enginerd 0:b562096246b3 140
enginerd 0:b562096246b3 141 /*! Status commands */
enginerd 0:b562096246b3 142 #define HCI_OCF_READ_RSSI 0x05
enginerd 0:b562096246b3 143
enginerd 0:b562096246b3 144 /*! LE controller commands */
enginerd 0:b562096246b3 145 #define HCI_OCF_LE_SET_EVENT_MASK 0x01
enginerd 0:b562096246b3 146 #define HCI_OCF_LE_READ_BUF_SIZE 0x02
enginerd 0:b562096246b3 147 #define HCI_OCF_LE_READ_LOCAL_SUP_FEAT 0x03
enginerd 0:b562096246b3 148 #define HCI_OCF_LE_SET_RAND_ADDR 0x05
enginerd 0:b562096246b3 149 #define HCI_OCF_LE_SET_ADV_PARAM 0x06
enginerd 0:b562096246b3 150 #define HCI_OCF_LE_READ_ADV_TX_POWER 0x07
enginerd 0:b562096246b3 151 #define HCI_OCF_LE_SET_ADV_DATA 0x08
enginerd 0:b562096246b3 152 #define HCI_OCF_LE_SET_SCAN_RESP_DATA 0x09
enginerd 0:b562096246b3 153 #define HCI_OCF_LE_SET_ADV_ENABLE 0x0A
enginerd 0:b562096246b3 154 #define HCI_OCF_LE_SET_SCAN_PARAM 0x0B
enginerd 0:b562096246b3 155 #define HCI_OCF_LE_SET_SCAN_ENABLE 0x0C
enginerd 0:b562096246b3 156 #define HCI_OCF_LE_CREATE_CONN 0x0D
enginerd 0:b562096246b3 157 #define HCI_OCF_LE_CREATE_CONN_CANCEL 0x0E
enginerd 0:b562096246b3 158 #define HCI_OCF_LE_READ_WHITE_LIST_SIZE 0x0F
enginerd 0:b562096246b3 159 #define HCI_OCF_LE_CLEAR_WHITE_LIST 0x10
enginerd 0:b562096246b3 160 #define HCI_OCF_LE_ADD_DEV_WHITE_LIST 0x11
enginerd 0:b562096246b3 161 #define HCI_OCF_LE_REMOVE_DEV_WHITE_LIST 0x12
enginerd 0:b562096246b3 162 #define HCI_OCF_LE_CONN_UPDATE 0x13
enginerd 0:b562096246b3 163 #define HCI_OCF_LE_SET_HOST_CHAN_CLASS 0x14
enginerd 0:b562096246b3 164 #define HCI_OCF_LE_READ_CHAN_MAP 0x15
enginerd 0:b562096246b3 165 #define HCI_OCF_LE_READ_REMOTE_FEAT 0x16
enginerd 0:b562096246b3 166 #define HCI_OCF_LE_ENCRYPT 0x17
enginerd 0:b562096246b3 167 #define HCI_OCF_LE_RAND 0x18
enginerd 0:b562096246b3 168 #define HCI_OCF_LE_START_ENCRYPTION 0x19
enginerd 0:b562096246b3 169 #define HCI_OCF_LE_LTK_REQ_REPL 0x1A
enginerd 0:b562096246b3 170 #define HCI_OCF_LE_LTK_REQ_NEG_REPL 0x1B
enginerd 0:b562096246b3 171 #define HCI_OCF_LE_READ_SUP_STATES 0x1C
enginerd 0:b562096246b3 172 #define HCI_OCF_LE_RECEIVER_TEST 0x1D
enginerd 0:b562096246b3 173 #define HCI_OCF_LE_TRANSMITTER_TEST 0x1E
enginerd 0:b562096246b3 174 #define HCI_OCF_LE_TEST_END 0x1F
enginerd 0:b562096246b3 175
enginerd 0:b562096246b3 176 /*! Opcode manipulation macros */
enginerd 0:b562096246b3 177 #define HCI_OPCODE(ogf, ocf) (((ogf) << 10) + (ocf))
enginerd 0:b562096246b3 178 #define HCI_OGF(opcode) ((opcode) >> 10)
enginerd 0:b562096246b3 179 #define HCI_OCF(opcode) ((opcode) & 0x03FF)
enginerd 0:b562096246b3 180
enginerd 0:b562096246b3 181 /*! Command opcodes */
enginerd 0:b562096246b3 182 #define HCI_OPCODE_NOP HCI_OPCODE(HCI_OGF_NOP, HCI_OCF_NOP)
enginerd 0:b562096246b3 183
enginerd 0:b562096246b3 184 #define HCI_OPCODE_DISCONNECT HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_DISCONNECT)
enginerd 0:b562096246b3 185 #define HCI_OPCODE_READ_REMOTE_VER_INFO HCI_OPCODE(HCI_OGF_LINK_CONTROL, HCI_OCF_READ_REMOTE_VER_INFO)
enginerd 0:b562096246b3 186
enginerd 0:b562096246b3 187 #define HCI_OPCODE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_EVENT_MASK)
enginerd 0:b562096246b3 188 #define HCI_OPCODE_RESET HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_RESET)
enginerd 0:b562096246b3 189 #define HCI_OPCODE_READ_TX_PWR_LVL HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_READ_TX_PWR_LVL)
enginerd 0:b562096246b3 190 #define HCI_OPCODE_SET_CONTROLLER_TO_HOST_FC HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_SET_CONTROLLER_TO_HOST_FC)
enginerd 0:b562096246b3 191 #define HCI_OPCODE_HOST_BUFFER_SIZE HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_HOST_BUFFER_SIZE)
enginerd 0:b562096246b3 192 #define HCI_OPCODE_HOST_NUM_CMPL_PKTS HCI_OPCODE(HCI_OGF_CONTROLLER, HCI_OCF_HOST_NUM_CMPL_PKTS)
enginerd 0:b562096246b3 193
enginerd 0:b562096246b3 194 #define HCI_OPCODE_READ_LOCAL_VER_INFO HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_VER_INFO)
enginerd 0:b562096246b3 195 #define HCI_OPCODE_READ_LOCAL_SUP_CMDS HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_CMDS)
enginerd 0:b562096246b3 196 #define HCI_OPCODE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_LOCAL_SUP_FEAT)
enginerd 0:b562096246b3 197 #define HCI_OPCODE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BUF_SIZE)
enginerd 0:b562096246b3 198 #define HCI_OPCODE_READ_BD_ADDR HCI_OPCODE(HCI_OGF_INFORMATIONAL, HCI_OCF_READ_BD_ADDR)
enginerd 0:b562096246b3 199
enginerd 0:b562096246b3 200 #define HCI_OPCODE_READ_RSSI HCI_OPCODE(HCI_OGF_STATUS, HCI_OCF_READ_RSSI)
enginerd 0:b562096246b3 201
enginerd 0:b562096246b3 202 #define HCI_OPCODE_LE_SET_EVENT_MASK HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_EVENT_MASK)
enginerd 0:b562096246b3 203 #define HCI_OPCODE_LE_READ_BUF_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_BUF_SIZE)
enginerd 0:b562096246b3 204 #define HCI_OPCODE_LE_READ_LOCAL_SUP_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_LOCAL_SUP_FEAT)
enginerd 0:b562096246b3 205 #define HCI_OPCODE_LE_SET_RAND_ADDR HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_RAND_ADDR)
enginerd 0:b562096246b3 206 #define HCI_OPCODE_LE_SET_ADV_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_PARAM)
enginerd 0:b562096246b3 207 #define HCI_OPCODE_LE_READ_ADV_TX_POWER HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_ADV_TX_POWER)
enginerd 0:b562096246b3 208 #define HCI_OPCODE_LE_SET_ADV_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_DATA)
enginerd 0:b562096246b3 209 #define HCI_OPCODE_LE_SET_SCAN_RESP_DATA HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_RESP_DATA)
enginerd 0:b562096246b3 210 #define HCI_OPCODE_LE_SET_ADV_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_ADV_ENABLE)
enginerd 0:b562096246b3 211 #define HCI_OPCODE_LE_SET_SCAN_PARAM HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_PARAM)
enginerd 0:b562096246b3 212 #define HCI_OPCODE_LE_SET_SCAN_ENABLE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_SCAN_ENABLE)
enginerd 0:b562096246b3 213 #define HCI_OPCODE_LE_CREATE_CONN HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN)
enginerd 0:b562096246b3 214 #define HCI_OPCODE_LE_CREATE_CONN_CANCEL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CREATE_CONN_CANCEL)
enginerd 0:b562096246b3 215 #define HCI_OPCODE_LE_READ_WHITE_LIST_SIZE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_WHITE_LIST_SIZE)
enginerd 0:b562096246b3 216 #define HCI_OPCODE_LE_CLEAR_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CLEAR_WHITE_LIST)
enginerd 0:b562096246b3 217 #define HCI_OPCODE_LE_ADD_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ADD_DEV_WHITE_LIST)
enginerd 0:b562096246b3 218 #define HCI_OPCODE_LE_REMOVE_DEV_WHITE_LIST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_REMOVE_DEV_WHITE_LIST)
enginerd 0:b562096246b3 219 #define HCI_OPCODE_LE_CONN_UPDATE HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_CONN_UPDATE)
enginerd 0:b562096246b3 220 #define HCI_OPCODE_LE_SET_HOST_CHAN_CLASS HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_SET_HOST_CHAN_CLASS)
enginerd 0:b562096246b3 221 #define HCI_OPCODE_LE_READ_CHAN_MAP HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_CHAN_MAP)
enginerd 0:b562096246b3 222 #define HCI_OPCODE_LE_READ_REMOTE_FEAT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_REMOTE_FEAT)
enginerd 0:b562096246b3 223 #define HCI_OPCODE_LE_ENCRYPT HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_ENCRYPT)
enginerd 0:b562096246b3 224 #define HCI_OPCODE_LE_RAND HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RAND)
enginerd 0:b562096246b3 225 #define HCI_OPCODE_LE_START_ENCRYPTION HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_START_ENCRYPTION)
enginerd 0:b562096246b3 226 #define HCI_OPCODE_LE_LTK_REQ_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_REPL)
enginerd 0:b562096246b3 227 #define HCI_OPCODE_LE_LTK_REQ_NEG_REPL HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_LTK_REQ_NEG_REPL)
enginerd 0:b562096246b3 228 #define HCI_OPCODE_LE_READ_SUP_STATES HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_READ_SUP_STATES)
enginerd 0:b562096246b3 229 #define HCI_OPCODE_LE_RECEIVER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_RECEIVER_TEST)
enginerd 0:b562096246b3 230 #define HCI_OPCODE_LE_TRANSMITTER_TEST HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TRANSMITTER_TEST)
enginerd 0:b562096246b3 231 #define HCI_OPCODE_LE_TEST_END HCI_OPCODE(HCI_OGF_LE_CONTROLLER, HCI_OCF_LE_TEST_END)
enginerd 0:b562096246b3 232
enginerd 0:b562096246b3 233 /*! Command parameter lengths */
enginerd 0:b562096246b3 234 #define HCI_LEN_NOP 0
enginerd 0:b562096246b3 235
enginerd 0:b562096246b3 236 #define HCI_LEN_DISCONNECT 3
enginerd 0:b562096246b3 237 #define HCI_LEN_READ_REMOTE_VER_INFO 2
enginerd 0:b562096246b3 238
enginerd 0:b562096246b3 239 #define HCI_LEN_SET_EVENT_MASK 8
enginerd 0:b562096246b3 240 #define HCI_LEN_RESET 0
enginerd 0:b562096246b3 241 #define HCI_LEN_READ_TX_PWR_LVL 3
enginerd 0:b562096246b3 242 #define HCI_LEN_SET_CONTROLLER_TO_HOST_FC 1
enginerd 0:b562096246b3 243 #define HCI_LEN_HOST_BUFFER_SIZE 8
enginerd 0:b562096246b3 244 #define HCI_LEN_HOST_NUM_CMPL_PKTS 1
enginerd 0:b562096246b3 245
enginerd 0:b562096246b3 246 #define HCI_LEN_READ_LOCAL_VER_INFO 0
enginerd 0:b562096246b3 247 #define HCI_LEN_READ_LOCAL_SUP_CMDS 0
enginerd 0:b562096246b3 248 #define HCI_LEN_READ_LOCAL_SUP_FEAT 0
enginerd 0:b562096246b3 249 #define HCI_LEN_READ_BUF_SIZE 0
enginerd 0:b562096246b3 250 #define HCI_LEN_READ_BD_ADDR 0
enginerd 0:b562096246b3 251
enginerd 0:b562096246b3 252 #define HCI_LEN_READ_RSSI 2
enginerd 0:b562096246b3 253
enginerd 0:b562096246b3 254 #define HCI_LEN_LE_SET_EVENT_MASK 8
enginerd 0:b562096246b3 255 #define HCI_LEN_LE_READ_BUF_SIZE 0
enginerd 0:b562096246b3 256 #define HCI_LEN_LE_READ_LOCAL_SUP_FEAT 0
enginerd 0:b562096246b3 257 #define HCI_LEN_LE_SET_RAND_ADDR 6
enginerd 0:b562096246b3 258 #define HCI_LEN_LE_SET_ADV_PARAM 15
enginerd 0:b562096246b3 259 #define HCI_LEN_LE_READ_ADV_TX_POWER 0
enginerd 0:b562096246b3 260 #define HCI_LEN_LE_SET_ADV_DATA 32
enginerd 0:b562096246b3 261 #define HCI_LEN_LE_SET_SCAN_RESP_DATA 32
enginerd 0:b562096246b3 262 #define HCI_LEN_LE_SET_ADV_ENABLE 1
enginerd 0:b562096246b3 263 #define HCI_LEN_LE_SET_SCAN_PARAM 7
enginerd 0:b562096246b3 264 #define HCI_LEN_LE_SET_SCAN_ENABLE 2
enginerd 0:b562096246b3 265 #define HCI_LEN_LE_CREATE_CONN 25
enginerd 0:b562096246b3 266 #define HCI_LEN_LE_CREATE_CONN_CANCEL 0
enginerd 0:b562096246b3 267 #define HCI_LEN_LE_READ_WHITE_LIST_SIZE 0
enginerd 0:b562096246b3 268 #define HCI_LEN_LE_CLEAR_WHITE_LIST 0
enginerd 0:b562096246b3 269 #define HCI_LEN_LE_ADD_DEV_WHITE_LIST 7
enginerd 0:b562096246b3 270 #define HCI_LEN_LE_REMOVE_DEV_WHITE_LIST 7
enginerd 0:b562096246b3 271 #define HCI_LEN_LE_CONN_UPDATE 14
enginerd 0:b562096246b3 272 #define HCI_LEN_LE_SET_HOST_CHAN_CLASS 5
enginerd 0:b562096246b3 273 #define HCI_LEN_LE_READ_CHAN_MAP 2
enginerd 0:b562096246b3 274 #define HCI_LEN_LE_READ_REMOTE_FEAT 2
enginerd 0:b562096246b3 275 #define HCI_LEN_LE_ENCRYPT 32
enginerd 0:b562096246b3 276 #define HCI_LEN_LE_RAND 0
enginerd 0:b562096246b3 277 #define HCI_LEN_LE_START_ENCRYPTION 28
enginerd 0:b562096246b3 278 #define HCI_LEN_LE_LTK_REQ_REPL 18
enginerd 0:b562096246b3 279 #define HCI_LEN_LE_LTK_REQ_NEG_REPL 2
enginerd 0:b562096246b3 280 #define HCI_LEN_LE_READ_SUP_STATES 0
enginerd 0:b562096246b3 281 #define HCI_LEN_LE_RECEIVER_TEST 1
enginerd 0:b562096246b3 282 #define HCI_LEN_LE_TRANSMITTER_TEST 3
enginerd 0:b562096246b3 283 #define HCI_LEN_LE_TEST_END 0
enginerd 0:b562096246b3 284
enginerd 0:b562096246b3 285 /*! Events */
enginerd 0:b562096246b3 286 #define HCI_DISCONNECT_CMPL_EVT 0x05
enginerd 0:b562096246b3 287 #define HCI_ENC_CHANGE_EVT 0x08
enginerd 0:b562096246b3 288 #define HCI_READ_REMOTE_VER_INFO_CMPL_EVT 0x0C
enginerd 0:b562096246b3 289 #define HCI_CMD_CMPL_EVT 0x0E
enginerd 0:b562096246b3 290 #define HCI_CMD_STATUS_EVT 0x0F
enginerd 0:b562096246b3 291 #define HCI_HW_ERROR_EVT 0x10
enginerd 0:b562096246b3 292 #define HCI_NUM_CMPL_PKTS_EVT 0x13
enginerd 0:b562096246b3 293 #define HCI_DATA_BUF_OVERFLOW_EVT 0x1A
enginerd 0:b562096246b3 294 #define HCI_ENC_KEY_REFRESH_CMPL_EVT 0x30
enginerd 0:b562096246b3 295 #define HCI_LE_META_EVT 0x3E
enginerd 0:b562096246b3 296 #define HCI_VENDOR_SPEC_EVT 0xFF
enginerd 0:b562096246b3 297
enginerd 0:b562096246b3 298 /*! LE Subevents */
enginerd 0:b562096246b3 299 #define HCI_LE_CONN_CMPL_EVT 0x01
enginerd 0:b562096246b3 300 #define HCI_LE_ADV_REPORT_EVT 0x02
enginerd 0:b562096246b3 301 #define HCI_LE_CONN_UPDATE_CMPL_EVT 0x03
enginerd 0:b562096246b3 302 #define HCI_LE_READ_REMOTE_FEAT_CMPL_EVT 0x04
enginerd 0:b562096246b3 303 #define HCI_LE_LTK_REQ_EVT 0x05
enginerd 0:b562096246b3 304
enginerd 0:b562096246b3 305 /*! Event parameter lengths */
enginerd 0:b562096246b3 306 #define HCI_LEN_DISCONNECT_CMPL 4
enginerd 0:b562096246b3 307 #define HCI_LEN_ENC_CHANGE 5
enginerd 0:b562096246b3 308 #define HCI_LEN_LE_CONN_CMPL 19
enginerd 0:b562096246b3 309 #define HCI_LEN_LE_CONN_UPDATE_CMPL 9
enginerd 0:b562096246b3 310 #define HCI_LEN_LE_READ_REMOTE_FEAT_CMPL 12
enginerd 0:b562096246b3 311 #define HCI_LEN_LE_LTK_REQ 13
enginerd 0:b562096246b3 312
enginerd 0:b562096246b3 313 /*! Supported commands */
enginerd 0:b562096246b3 314 #define HCI_SUP_DISCONNECT 0x20 /*! Byte 0 */
enginerd 0:b562096246b3 315 #define HCI_SUP_READ_REMOTE_VER_INFO 0x80 /*! Byte 2 */
enginerd 0:b562096246b3 316 #define HCI_SUP_SET_EVENT_MASK 0x40 /*! Byte 5 */
enginerd 0:b562096246b3 317 #define HCI_SUP_RESET 0x80 /*! Byte 5 */
enginerd 0:b562096246b3 318 #define HCI_SUP_READ_TX_PWR_LVL 0x04 /*! Byte 10 */
enginerd 0:b562096246b3 319 #define HCI_SUP_SET_CONTROLLER_TO_HOST_FC 0x20 /*! Byte 10 */
enginerd 0:b562096246b3 320 #define HCI_SUP_HOST_BUFFER_SIZE 0x40 /*! Byte 10 */
enginerd 0:b562096246b3 321 #define HCI_SUP_HOST_NUM_CMPL_PKTS 0x80 /*! Byte 10 */
enginerd 0:b562096246b3 322 #define HCI_SUP_READ_LOCAL_VER_INFO 0x08 /*! Byte 14 */
enginerd 0:b562096246b3 323 #define HCI_SUP_READ_LOCAL_SUP_FEAT 0x20 /*! Byte 14 */
enginerd 0:b562096246b3 324 #define HCI_SUP_READ_BD_ADDR 0x02 /*! Byte 15 */
enginerd 0:b562096246b3 325 #define HCI_SUP_READ_RSSI 0x20 /*! Byte 15 */
enginerd 0:b562096246b3 326 #define HCI_SUP_LE_SET_EVENT_MASK 0x01 /*! Byte 25 */
enginerd 0:b562096246b3 327 #define HCI_SUP_LE_READ_BUF_SIZE 0x02 /*! Byte 25 */
enginerd 0:b562096246b3 328 #define HCI_SUP_LE_READ_LOCAL_SUP_FEAT 0x04 /*! Byte 25 */
enginerd 0:b562096246b3 329 #define HCI_SUP_LE_SET_RAND_ADDR 0x10 /*! Byte 25 */
enginerd 0:b562096246b3 330 #define HCI_SUP_LE_SET_ADV_PARAM 0x20 /*! Byte 25 */
enginerd 0:b562096246b3 331 #define HCI_SUP_LE_READ_ADV_TX_POWER 0x40 /*! Byte 25 */
enginerd 0:b562096246b3 332 #define HCI_SUP_LE_SET_ADV_DATA 0x80 /*! Byte 25 */
enginerd 0:b562096246b3 333 #define HCI_SUP_LE_SET_SCAN_RESP_DATA 0x01 /*! Byte 26 */
enginerd 0:b562096246b3 334 #define HCI_SUP_LE_SET_ADV_ENABLE 0x02 /*! Byte 26 */
enginerd 0:b562096246b3 335 #define HCI_SUP_LE_SET_SCAN_PARAM 0x04 /*! Byte 26 */
enginerd 0:b562096246b3 336 #define HCI_SUP_LE_SET_SCAN_ENABLE 0x08 /*! Byte 26 */
enginerd 0:b562096246b3 337 #define HCI_SUP_LE_CREATE_CONN 0x10 /*! Byte 26 */
enginerd 0:b562096246b3 338 #define HCI_SUP_LE_CREATE_CONN_CANCEL 0x20 /*! Byte 26 */
enginerd 0:b562096246b3 339 #define HCI_SUP_LE_READ_WHITE_LIST_SIZE 0x40 /*! Byte 26 */
enginerd 0:b562096246b3 340 #define HCI_SUP_LE_CLEAR_WHITE_LIST 0x80 /*! Byte 26 */
enginerd 0:b562096246b3 341 #define HCI_SUP_LE_ADD_DEV_WHITE_LIST 0x01 /*! Byte 27 */
enginerd 0:b562096246b3 342 #define HCI_SUP_LE_REMOVE_DEV_WHITE_LIST 0x02 /*! Byte 27 */
enginerd 0:b562096246b3 343 #define HCI_SUP_LE_CONN_UPDATE 0x04 /*! Byte 27 */
enginerd 0:b562096246b3 344 #define HCI_SUP_LE_SET_HOST_CHAN_CLASS 0x08 /*! Byte 27 */
enginerd 0:b562096246b3 345 #define HCI_SUP_LE_READ_CHAN_MAP 0x10 /*! Byte 27 */
enginerd 0:b562096246b3 346 #define HCI_SUP_LE_READ_REMOTE_FEAT 0x20 /*! Byte 27 */
enginerd 0:b562096246b3 347 #define HCI_SUP_LE_ENCRYPT 0x40 /*! Byte 27 */
enginerd 0:b562096246b3 348 #define HCI_SUP_LE_RAND 0x80 /*! Byte 27 */
enginerd 0:b562096246b3 349 #define HCI_SUP_LE_START_ENCRYPTION 0x01 /*! Byte 28 */
enginerd 0:b562096246b3 350 #define HCI_SUP_LE_LTK_REQ_REPL 0x02 /*! Byte 28 */
enginerd 0:b562096246b3 351 #define HCI_SUP_LE_LTK_REQ_NEG_REPL 0x04 /*! Byte 28 */
enginerd 0:b562096246b3 352 #define HCI_SUP_LE_READ_SUP_STATES 0x08 /*! Byte 28 */
enginerd 0:b562096246b3 353 #define HCI_SUP_LE_RECEIVER_TEST 0x10 /*! Byte 28 */
enginerd 0:b562096246b3 354 #define HCI_SUP_LE_TRANSMITTER_TEST 0x20 /*! Byte 28 */
enginerd 0:b562096246b3 355 #define HCI_SUP_LE_TEST_END 0x40 /*! Byte 28 */
enginerd 0:b562096246b3 356
enginerd 0:b562096246b3 357 /*! Event mask */
enginerd 0:b562096246b3 358 #define HCI_EVT_MASK_DISCONNECT_CMPL 0x10 /*! Byte 0 */
enginerd 0:b562096246b3 359 #define HCI_EVT_MASK_ENC_CHANGE 0x80 /*! Byte 0 */
enginerd 0:b562096246b3 360 #define HCI_EVT_MASK_READ_REMOTE_VER_INFO_CMPL 0x08 /*! Byte 1 */
enginerd 0:b562096246b3 361 #define HCI_EVT_MASK_HW_ERROR 0x80 /*! Byte 1 */
enginerd 0:b562096246b3 362 #define HCI_EVT_MASK_DATA_BUF_OVERFLOW 0x02 /*! Byte 3 */
enginerd 0:b562096246b3 363 #define HCI_EVT_MASK_ENC_KEY_REFRESH_CMPL 0x80 /*! Byte 5 */
enginerd 0:b562096246b3 364 #define HCI_EVT_MASK_LE_META 0x20 /*! Byte 7 */
enginerd 0:b562096246b3 365
enginerd 0:b562096246b3 366 /*! LE event mask */
enginerd 0:b562096246b3 367 #define HCI_EVT_MASK_LE_CONN_CMPL_EVT 0x01 /*! Byte 0 */
enginerd 0:b562096246b3 368 #define HCI_EVT_MASK_LE_ADV_REPORT_EVT 0x02 /*! Byte 0 */
enginerd 0:b562096246b3 369 #define HCI_EVT_MASK_LE_CONN_UPDATE_CMPL_EVT 0x04 /*! Byte 0 */
enginerd 0:b562096246b3 370 #define HCI_EVT_MASK_LE_READ_REMOTE_FEAT_CMPL_EVT 0x08 /*! Byte 0 */
enginerd 0:b562096246b3 371 #define HCI_EVT_MASK_LE_LTK_REQ_EVT 0x10 /*! Byte 0 */
enginerd 0:b562096246b3 372
enginerd 0:b562096246b3 373 /*! LE supported features */
enginerd 0:b562096246b3 374 #define HCI_LE_SUP_FEAT_ENCRYPTION 0x01
enginerd 0:b562096246b3 375
enginerd 0:b562096246b3 376 /*! Advertising command parameters */
enginerd 0:b562096246b3 377 #define HCI_ADV_MIN_INTERVAL 0x0020 /*! Minimum advertising interval */
enginerd 0:b562096246b3 378 #define HCI_ADV_NONCONN_MIN_INTERVAL 0x00A0 /*! Minimum nonconnectable adv. interval */
enginerd 0:b562096246b3 379 #define HCI_ADV_MAX_INTERVAL 0x4000 /*! Maximum advertising interval */
enginerd 0:b562096246b3 380 #define HCI_ADV_TYPE_CONN_UNDIRECT 0x00 /*! Connectable undirected advertising */
enginerd 0:b562096246b3 381 #define HCI_ADV_TYPE_CONN_DIRECT 0x01 /*! Connectable directed advertising */
enginerd 0:b562096246b3 382 #define HCI_ADV_TYPE_DISC_UNDIRECT 0x02 /*! Discoverable undirected advertising */
enginerd 0:b562096246b3 383 #define HCI_ADV_TYPE_NONCONN_UNDIRECT 0x03 /*! Nonconnectable undirected advertising */
enginerd 0:b562096246b3 384 #define HCI_ADV_CHAN_37 0x01 /*! Advertising channel 37 */
enginerd 0:b562096246b3 385 #define HCI_ADV_CHAN_38 0x02 /*! Advertising channel 38 */
enginerd 0:b562096246b3 386 #define HCI_ADV_CHAN_39 0x04 /*! Advertising channel 39 */
enginerd 0:b562096246b3 387 #define HCI_ADV_FILT_NONE 0x00 /*! No scan request or connection filtering */
enginerd 0:b562096246b3 388 #define HCI_ADV_FILT_SCAN 0x01 /*! White list filters scan requests */
enginerd 0:b562096246b3 389 #define HCI_ADV_FILT_CONN 0x02 /*! White list filters connections */
enginerd 0:b562096246b3 390 #define HCI_ADV_FILT_ALL 0x03 /*! White list filters scan req. and conn. */
enginerd 0:b562096246b3 391
enginerd 0:b562096246b3 392 /*! Scan command parameters */
enginerd 0:b562096246b3 393 #define HCI_SCAN_TYPE_PASSIVE 0 /*! Passive scan */
enginerd 0:b562096246b3 394 #define HCI_SCAN_TYPE_ACTIVE 1 /*! Active scan */
enginerd 0:b562096246b3 395 #define HCI_SCAN_INTERVAL_MIN 0x0004 /*! Minimum scan interval */
enginerd 0:b562096246b3 396 #define HCI_SCAN_INTERVAL_MAX 0x4000 /*! Maximum scan interval */
enginerd 0:b562096246b3 397 #define HCI_SCAN_INTERVAL_DEFAULT 0x0010 /*! Default scan interval */
enginerd 0:b562096246b3 398 #define HCI_SCAN_WINDOW_MIN 0x0004 /*! Minimum scan window */
enginerd 0:b562096246b3 399 #define HCI_SCAN_WINDOW_MAX 0x4000 /*! Maximum scan window */
enginerd 0:b562096246b3 400 #define HCI_SCAN_WINDOW_DEFAULT 0x0010 /*! Default scan window */
enginerd 0:b562096246b3 401
enginerd 0:b562096246b3 402 /*! Connection command parameters */
enginerd 0:b562096246b3 403 #define HCI_CONN_INTERVAL_MIN 0x0006 /*! Minimum connection interval */
enginerd 0:b562096246b3 404 #define HCI_CONN_INTERVAL_MAX 0x0C80 /*! Maximum connection interval */
enginerd 0:b562096246b3 405 #define HCI_CONN_LATENCY_MAX 0x01F3 /*! Maximum connection latency */
enginerd 0:b562096246b3 406 #define HCI_SUP_TIMEOUT_MIN 0x000A /*! Minimum supervision timeout */
enginerd 0:b562096246b3 407 #define HCI_SUP_TIMEOUT_MAX 0x0C80 /*! Maximum supervision timeout */
enginerd 0:b562096246b3 408
enginerd 0:b562096246b3 409 /*! Connection event parameters */
enginerd 0:b562096246b3 410 #define HCI_ROLE_MASTER 0 /*! Role is master */
enginerd 0:b562096246b3 411 #define HCI_ROLE_SLAVE 1 /*! Role is slave */
enginerd 0:b562096246b3 412 #define HCI_CLOCK_500PPM 0x00 /*! 500 ppm clock accuracy */
enginerd 0:b562096246b3 413 #define HCI_CLOCK_250PPM 0x01 /*! 250 ppm clock accuracy */
enginerd 0:b562096246b3 414 #define HCI_CLOCK_150PPM 0x02 /*! 150 ppm clock accuracy */
enginerd 0:b562096246b3 415 #define HCI_CLOCK_100PPM 0x03 /*! 100 ppm clock accuracy */
enginerd 0:b562096246b3 416 #define HCI_CLOCK_75PPM 0x04 /*! 75 ppm clock accuracy */
enginerd 0:b562096246b3 417 #define HCI_CLOCK_50PPM 0x05 /*! 50 ppm clock accuracy */
enginerd 0:b562096246b3 418 #define HCI_CLOCK_30PPM 0x06 /*! 30 ppm clock accuracy */
enginerd 0:b562096246b3 419 #define HCI_CLOCK_20PPM 0x07 /*! 20 ppm clock accuracy */
enginerd 0:b562096246b3 420
enginerd 0:b562096246b3 421 /*! Advertising report event parameters */
enginerd 0:b562096246b3 422 #define HCI_ADV_CONN_UNDIRECT 0x00 /*! Connectable undirected advertising */
enginerd 0:b562096246b3 423 #define HCI_ADV_CONN_DIRECT 0x01 /*! Connectable directed advertising */
enginerd 0:b562096246b3 424 #define HCI_ADV_DISC_UNDIRECT 0x02 /*! Discoverable undirected advertising */
enginerd 0:b562096246b3 425 #define HCI_ADV_NONCONN_UNDIRECT 0x03 /*! Non-connectable undirected advertising */
enginerd 0:b562096246b3 426 #define HCI_ADV_SCAN_RESPONSE 0x04 /*! Scan response */
enginerd 0:b562096246b3 427
enginerd 0:b562096246b3 428 /*! Misc command parameters */
enginerd 0:b562096246b3 429 #define HCI_READ_TX_PWR_CURRENT 0 /*! Read current tx power */
enginerd 0:b562096246b3 430 #define HCI_READ_TX_PWR_MAX 1 /*! Read maximum tx power */
enginerd 0:b562096246b3 431 #define HCI_TX_PWR_MIN -30 /*! Minimum tx power dBm */
enginerd 0:b562096246b3 432 #define HCI_TX_PWR_MAX 20 /*! Maximum tx power dBm */
enginerd 0:b562096246b3 433 #define HCI_VERSION 6 /*! HCI specification version */
enginerd 0:b562096246b3 434 #define HCI_RSSI_MIN -127 /*! Minimum RSSI dBm */
enginerd 0:b562096246b3 435 #define HCI_RSSI_MAX 20 /*! Maximum RSSI dBm */
enginerd 0:b562096246b3 436 #define HCI_ADDR_TYPE_PUBLIC 0 /*! Public device address */
enginerd 0:b562096246b3 437 #define HCI_ADDR_TYPE_RANDOM 1 /*! Random device address */
enginerd 0:b562096246b3 438 #define HCI_FILT_NONE 0 /*! No white list filtering */
enginerd 0:b562096246b3 439 #define HCI_FILT_WHITE_LIST 1 /*! White list filtering */
enginerd 0:b562096246b3 440 #define HCI_ROLE_MASTER 0 /*! Role is master */
enginerd 0:b562096246b3 441 #define HCI_ROLE_SLAVE 1 /*! Role is slave */
enginerd 0:b562096246b3 442
enginerd 0:b562096246b3 443 /*! Parameter lengths */
enginerd 0:b562096246b3 444 #define HCI_EVT_MASK_LEN 8 /*! Length of event mask byte array */
enginerd 0:b562096246b3 445 #define HCI_LE_EVT_MASK_LEN 8 /*! Length of LE event mask byte array */
enginerd 0:b562096246b3 446 #define HCI_FEAT_LEN 8 /*! Length of features byte array */
enginerd 0:b562096246b3 447 #define HCI_ADV_DATA_LEN 31 /*! Length of advertising data */
enginerd 0:b562096246b3 448 #define HCI_SCAN_DATA_LEN 31 /*! Length of scan response data */
enginerd 0:b562096246b3 449 #define HCI_CHAN_MAP_LEN 5 /*! Length of channel map byte array */
enginerd 0:b562096246b3 450 #define HCI_KEY_LEN 16 /*! Length of encryption key */
enginerd 0:b562096246b3 451 #define HCI_ENCRYPT_DATA_LEN 16 /*! Length of data used in encryption */
enginerd 0:b562096246b3 452 #define HCI_RAND_LEN 8 /*! Length of random number */
enginerd 0:b562096246b3 453 #define HCI_LE_STATES_LEN 8 /*! Length of LE states byte array */
enginerd 0:b562096246b3 454
enginerd 0:b562096246b3 455 /*! Wicentric company ID */
enginerd 0:b562096246b3 456 #define HCI_ID_WICENTRIC 0x005F
enginerd 0:b562096246b3 457
enginerd 0:b562096246b3 458 #ifdef __cplusplus
enginerd 0:b562096246b3 459 };
enginerd 0:b562096246b3 460 #endif
enginerd 0:b562096246b3 461
enginerd 0:b562096246b3 462 #endif /* HCI_DEFS_H */