Maxim Integrated Bluetooth LE Library
Dependents: BLE_Thermometer MAXWSNENV_demo
exactLE/stack/include/hci_api.h@5:5b87f64ce81e, 2016-10-06 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
enginerd | 0:b562096246b3 | 1 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 2 | /*! |
enginerd | 0:b562096246b3 | 3 | * \file hci_api.h |
enginerd | 0:b562096246b3 | 4 | * |
enginerd | 0:b562096246b3 | 5 | * \brief HCI subsystem API. |
enginerd | 0:b562096246b3 | 6 | * |
enginerd | 0:b562096246b3 | 7 | * $Date: 2011-10-14 21:35:03 -0700 (Fri, 14 Oct 2011) $ |
enginerd | 0:b562096246b3 | 8 | * $Revision: 191 $ |
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_API_H |
enginerd | 0:b562096246b3 | 23 | #define HCI_API_H |
enginerd | 0:b562096246b3 | 24 | |
enginerd | 0:b562096246b3 | 25 | #include "wsf_types.h" |
enginerd | 0:b562096246b3 | 26 | #include "hci_defs.h" |
enginerd | 0:b562096246b3 | 27 | #include "wsf_os.h" |
enginerd | 0:b562096246b3 | 28 | #include "bda.h" |
enginerd | 0:b562096246b3 | 29 | |
enginerd | 0:b562096246b3 | 30 | #ifdef __cplusplus |
enginerd | 0:b562096246b3 | 31 | extern "C" { |
enginerd | 0:b562096246b3 | 32 | #endif |
enginerd | 0:b562096246b3 | 33 | |
enginerd | 0:b562096246b3 | 34 | /************************************************************************************************** |
enginerd | 0:b562096246b3 | 35 | Macros |
enginerd | 0:b562096246b3 | 36 | **************************************************************************************************/ |
enginerd | 0:b562096246b3 | 37 | |
enginerd | 0:b562096246b3 | 38 | /*! Internal event values for the HCI event and sec callbacks */ |
enginerd | 0:b562096246b3 | 39 | #define HCI_RESET_SEQ_CMPL_CBACK_EVT 0 /*! Reset sequence complete */ |
enginerd | 0:b562096246b3 | 40 | #define HCI_LE_CONN_CMPL_CBACK_EVT 1 /*! LE connection complete */ |
enginerd | 0:b562096246b3 | 41 | #define HCI_DISCONNECT_CMPL_CBACK_EVT 2 /*! LE disconnect complete */ |
enginerd | 0:b562096246b3 | 42 | #define HCI_LE_CONN_UPDATE_CMPL_CBACK_EVT 3 /*! LE connection update complete */ |
enginerd | 0:b562096246b3 | 43 | #define HCI_LE_CREATE_CONN_CANCEL_CMD_CMPL_CBACK_EVT 4 /*! LE create connection cancel command complete */ |
enginerd | 0:b562096246b3 | 44 | #define HCI_LE_ADV_REPORT_CBACK_EVT 5 /*! LE advertising report */ |
enginerd | 0:b562096246b3 | 45 | #define HCI_READ_RSSI_CMD_CMPL_CBACK_EVT 6 /*! Read RSSI command complete */ |
enginerd | 0:b562096246b3 | 46 | #define HCI_LE_READ_CHAN_MAP_CMD_CMPL_CBACK_EVT 7 /*! LE Read channel map command complete */ |
enginerd | 0:b562096246b3 | 47 | #define HCI_READ_TX_PWR_LVL_CMD_CMPL_CBACK_EVT 8 /*! Read transmit power level command complete */ |
enginerd | 0:b562096246b3 | 48 | #define HCI_READ_REMOTE_VER_INFO_CMPL_CBACK_EVT 9 /*! Read remote version information complete */ |
enginerd | 0:b562096246b3 | 49 | #define HCI_LE_READ_REMOTE_FEAT_CMPL_CBACK_EVT 10 /*! LE read remote features complete */ |
enginerd | 0:b562096246b3 | 50 | #define HCI_LE_LTK_REQ_REPL_CMD_CMPL_CBACK_EVT 11 /*! LE LTK request reply command complete */ |
enginerd | 0:b562096246b3 | 51 | #define HCI_LE_LTK_REQ_NEG_REPL_CMD_CMPL_CBACK_EVT 12 /*! LE LTK request negative reply command complete */ |
enginerd | 0:b562096246b3 | 52 | #define HCI_ENC_KEY_REFRESH_CMPL_CBACK_EVT 13 /*! Encryption key refresh complete */ |
enginerd | 0:b562096246b3 | 53 | #define HCI_ENC_CHANGE_CBACK_EVT 14 /*! Encryption change */ |
enginerd | 0:b562096246b3 | 54 | #define HCI_LE_LTK_REQ_CBACK_EVT 15 /*! LE LTK request */ |
enginerd | 0:b562096246b3 | 55 | #define HCI_VENDOR_SPEC_CMD_STATUS_CBACK_EVT 16 /*! Vendor specific command status */ |
enginerd | 0:b562096246b3 | 56 | #define HCI_VENDOR_SPEC_CMD_CMPL_CBACK_EVT 17 /*! Vendor specific command complete */ |
enginerd | 0:b562096246b3 | 57 | #define HCI_VENDOR_SPEC_CBACK_EVT 18 /*! Vendor specific */ |
enginerd | 0:b562096246b3 | 58 | #define HCI_HW_ERROR_CBACK_EVT 19 /*! Hardware error */ |
enginerd | 0:b562096246b3 | 59 | #define HCI_LE_ENCRYPT_CMD_CMPL_CBACK_EVT 20 /*! LE encrypt command complete */ |
enginerd | 0:b562096246b3 | 60 | #define HCI_LE_RAND_CMD_CMPL_CBACK_EVT 21 /*! LE rand command complete */ |
enginerd | 0:b562096246b3 | 61 | |
enginerd | 0:b562096246b3 | 62 | /************************************************************************************************** |
enginerd | 0:b562096246b3 | 63 | Data Types |
enginerd | 0:b562096246b3 | 64 | **************************************************************************************************/ |
enginerd | 0:b562096246b3 | 65 | |
enginerd | 0:b562096246b3 | 66 | /*! Connection specification type */ |
enginerd | 0:b562096246b3 | 67 | typedef struct |
enginerd | 0:b562096246b3 | 68 | { |
enginerd | 0:b562096246b3 | 69 | uint16_t connIntervalMin; |
enginerd | 0:b562096246b3 | 70 | uint16_t connIntervalMax; |
enginerd | 0:b562096246b3 | 71 | uint16_t connLatency; |
enginerd | 0:b562096246b3 | 72 | uint16_t supTimeout; |
enginerd | 0:b562096246b3 | 73 | uint16_t minCeLen; |
enginerd | 0:b562096246b3 | 74 | uint16_t maxCeLen; |
enginerd | 0:b562096246b3 | 75 | } hciConnSpec_t; |
enginerd | 0:b562096246b3 | 76 | |
enginerd | 0:b562096246b3 | 77 | /*! LE connection complete event */ |
enginerd | 0:b562096246b3 | 78 | typedef struct |
enginerd | 0:b562096246b3 | 79 | { |
enginerd | 0:b562096246b3 | 80 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 81 | uint8_t status; |
enginerd | 0:b562096246b3 | 82 | uint16_t handle; |
enginerd | 0:b562096246b3 | 83 | uint8_t role; |
enginerd | 0:b562096246b3 | 84 | uint8_t addrType; |
enginerd | 0:b562096246b3 | 85 | bdAddr_t peerAddr; |
enginerd | 0:b562096246b3 | 86 | uint16_t connInterval; |
enginerd | 0:b562096246b3 | 87 | uint16_t connLatency; |
enginerd | 0:b562096246b3 | 88 | uint16_t supTimeout; |
enginerd | 0:b562096246b3 | 89 | uint8_t clockAccuracy; |
enginerd | 0:b562096246b3 | 90 | } hciLeConnCmplEvt_t; |
enginerd | 0:b562096246b3 | 91 | |
enginerd | 0:b562096246b3 | 92 | /*! Disconnect complete event */ |
enginerd | 0:b562096246b3 | 93 | typedef struct |
enginerd | 0:b562096246b3 | 94 | { |
enginerd | 0:b562096246b3 | 95 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 96 | uint8_t status; |
enginerd | 0:b562096246b3 | 97 | uint16_t handle; |
enginerd | 0:b562096246b3 | 98 | uint8_t reason; |
enginerd | 0:b562096246b3 | 99 | } hciDisconnectCmplEvt_t; |
enginerd | 0:b562096246b3 | 100 | |
enginerd | 0:b562096246b3 | 101 | /*! LE connection update complete event */ |
enginerd | 0:b562096246b3 | 102 | typedef struct |
enginerd | 0:b562096246b3 | 103 | { |
enginerd | 0:b562096246b3 | 104 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 105 | uint8_t status; |
enginerd | 0:b562096246b3 | 106 | uint16_t handle; |
enginerd | 0:b562096246b3 | 107 | uint16_t connInterval; |
enginerd | 0:b562096246b3 | 108 | uint16_t connLatency; |
enginerd | 0:b562096246b3 | 109 | uint16_t supTimeout; |
enginerd | 0:b562096246b3 | 110 | } hciLeConnUpdateCmplEvt_t; |
enginerd | 0:b562096246b3 | 111 | |
enginerd | 0:b562096246b3 | 112 | /*! LE create connection cancel command complete event */ |
enginerd | 0:b562096246b3 | 113 | typedef struct |
enginerd | 0:b562096246b3 | 114 | { |
enginerd | 0:b562096246b3 | 115 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 116 | uint8_t status; |
enginerd | 0:b562096246b3 | 117 | } hciLeCreateConnCancelCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 118 | |
enginerd | 0:b562096246b3 | 119 | /*! LE advertising report event */ |
enginerd | 0:b562096246b3 | 120 | typedef struct |
enginerd | 0:b562096246b3 | 121 | { |
enginerd | 0:b562096246b3 | 122 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 123 | uint8_t *pData; |
enginerd | 0:b562096246b3 | 124 | uint8_t len; |
enginerd | 0:b562096246b3 | 125 | int8_t rssi; |
enginerd | 0:b562096246b3 | 126 | uint8_t eventType; |
enginerd | 0:b562096246b3 | 127 | uint8_t addrType; |
enginerd | 0:b562096246b3 | 128 | bdAddr_t addr; |
enginerd | 0:b562096246b3 | 129 | } hciLeAdvReportEvt_t; |
enginerd | 0:b562096246b3 | 130 | |
enginerd | 0:b562096246b3 | 131 | /*! Read RSSI command complete event */ |
enginerd | 0:b562096246b3 | 132 | typedef struct |
enginerd | 0:b562096246b3 | 133 | { |
enginerd | 0:b562096246b3 | 134 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 135 | uint8_t status; |
enginerd | 0:b562096246b3 | 136 | uint8_t handle; |
enginerd | 0:b562096246b3 | 137 | int8_t rssi; |
enginerd | 0:b562096246b3 | 138 | } hciReadRssiCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 139 | |
enginerd | 0:b562096246b3 | 140 | /*! LE Read channel map command complete event */ |
enginerd | 0:b562096246b3 | 141 | typedef struct |
enginerd | 0:b562096246b3 | 142 | { |
enginerd | 0:b562096246b3 | 143 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 144 | uint8_t status; |
enginerd | 0:b562096246b3 | 145 | uint16_t handle; |
enginerd | 0:b562096246b3 | 146 | uint8_t chanMap[HCI_CHAN_MAP_LEN]; |
enginerd | 0:b562096246b3 | 147 | } hciReadChanMapCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 148 | |
enginerd | 0:b562096246b3 | 149 | /*! Read transmit power level command complete event */ |
enginerd | 0:b562096246b3 | 150 | typedef struct |
enginerd | 0:b562096246b3 | 151 | { |
enginerd | 0:b562096246b3 | 152 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 153 | uint8_t status; |
enginerd | 0:b562096246b3 | 154 | uint8_t handle; |
enginerd | 0:b562096246b3 | 155 | int8_t pwrLvl; |
enginerd | 0:b562096246b3 | 156 | } hciReadTxPwrLvlCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 157 | |
enginerd | 0:b562096246b3 | 158 | /*! Read remote version information complete event */ |
enginerd | 0:b562096246b3 | 159 | typedef struct |
enginerd | 0:b562096246b3 | 160 | { |
enginerd | 0:b562096246b3 | 161 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 162 | uint8_t status; |
enginerd | 0:b562096246b3 | 163 | uint16_t handle; |
enginerd | 0:b562096246b3 | 164 | uint8_t version; |
enginerd | 0:b562096246b3 | 165 | uint16_t mfrName; |
enginerd | 0:b562096246b3 | 166 | uint16_t subversion; |
enginerd | 0:b562096246b3 | 167 | } hciReadRemoteVerInfoCmplEvt_t; |
enginerd | 0:b562096246b3 | 168 | |
enginerd | 0:b562096246b3 | 169 | /*! LE read remote features complete event */ |
enginerd | 0:b562096246b3 | 170 | typedef struct |
enginerd | 0:b562096246b3 | 171 | { |
enginerd | 0:b562096246b3 | 172 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 173 | uint8_t status; |
enginerd | 0:b562096246b3 | 174 | uint16_t handle; |
enginerd | 0:b562096246b3 | 175 | uint8_t features[HCI_FEAT_LEN]; |
enginerd | 0:b562096246b3 | 176 | } hciLeReadRemoteFeatCmplEvt_t; |
enginerd | 0:b562096246b3 | 177 | |
enginerd | 0:b562096246b3 | 178 | /*! LE LTK request reply command complete event */ |
enginerd | 0:b562096246b3 | 179 | typedef struct |
enginerd | 0:b562096246b3 | 180 | { |
enginerd | 0:b562096246b3 | 181 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 182 | uint8_t status; |
enginerd | 0:b562096246b3 | 183 | uint16_t handle; |
enginerd | 0:b562096246b3 | 184 | } hciLeLtkReqReplCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 185 | |
enginerd | 0:b562096246b3 | 186 | /*! LE LTK request negative reply command complete event */ |
enginerd | 0:b562096246b3 | 187 | typedef struct |
enginerd | 0:b562096246b3 | 188 | { |
enginerd | 0:b562096246b3 | 189 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 190 | uint8_t status; |
enginerd | 0:b562096246b3 | 191 | uint16_t handle; |
enginerd | 0:b562096246b3 | 192 | } hciLeLtkReqNegReplCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 193 | |
enginerd | 0:b562096246b3 | 194 | /*! Encryption key refresh complete event */ |
enginerd | 0:b562096246b3 | 195 | typedef struct |
enginerd | 0:b562096246b3 | 196 | { |
enginerd | 0:b562096246b3 | 197 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 198 | uint8_t status; |
enginerd | 0:b562096246b3 | 199 | uint16_t handle; |
enginerd | 0:b562096246b3 | 200 | } hciEncKeyRefreshCmpl_t; |
enginerd | 0:b562096246b3 | 201 | |
enginerd | 0:b562096246b3 | 202 | /*! Encryption change event */ |
enginerd | 0:b562096246b3 | 203 | typedef struct |
enginerd | 0:b562096246b3 | 204 | { |
enginerd | 0:b562096246b3 | 205 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 206 | uint8_t status; |
enginerd | 0:b562096246b3 | 207 | uint16_t handle; |
enginerd | 0:b562096246b3 | 208 | uint8_t enabled; |
enginerd | 0:b562096246b3 | 209 | } hciEncChangeEvt_t; |
enginerd | 0:b562096246b3 | 210 | |
enginerd | 0:b562096246b3 | 211 | /*! LE LTK request event */ |
enginerd | 0:b562096246b3 | 212 | typedef struct |
enginerd | 0:b562096246b3 | 213 | { |
enginerd | 0:b562096246b3 | 214 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 215 | uint16_t handle; |
enginerd | 0:b562096246b3 | 216 | uint8_t randNum[HCI_RAND_LEN]; |
enginerd | 0:b562096246b3 | 217 | uint16_t encDiversifier; |
enginerd | 0:b562096246b3 | 218 | } hciLeLtkReqEvt_t; |
enginerd | 0:b562096246b3 | 219 | |
enginerd | 0:b562096246b3 | 220 | /*! Vendor specific command status event */ |
enginerd | 0:b562096246b3 | 221 | typedef struct |
enginerd | 0:b562096246b3 | 222 | { |
enginerd | 0:b562096246b3 | 223 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 224 | uint16_t opcode; |
enginerd | 0:b562096246b3 | 225 | } hciVendorSpecCmdStatusEvt_t; |
enginerd | 0:b562096246b3 | 226 | |
enginerd | 0:b562096246b3 | 227 | /*! Vendor specific command complete event */ |
enginerd | 0:b562096246b3 | 228 | typedef struct |
enginerd | 0:b562096246b3 | 229 | { |
enginerd | 0:b562096246b3 | 230 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 231 | uint16_t opcode; |
enginerd | 0:b562096246b3 | 232 | uint8_t param[1]; |
enginerd | 0:b562096246b3 | 233 | } hciVendorSpecCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 234 | |
enginerd | 0:b562096246b3 | 235 | /*! Vendor specific event */ |
enginerd | 0:b562096246b3 | 236 | typedef struct |
enginerd | 0:b562096246b3 | 237 | { |
enginerd | 0:b562096246b3 | 238 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 239 | uint8_t param[1]; |
enginerd | 0:b562096246b3 | 240 | } hciVendorSpecEvt_t; |
enginerd | 0:b562096246b3 | 241 | |
enginerd | 0:b562096246b3 | 242 | /*! Hardware error event */ |
enginerd | 0:b562096246b3 | 243 | typedef struct |
enginerd | 0:b562096246b3 | 244 | { |
enginerd | 0:b562096246b3 | 245 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 246 | uint8_t code; |
enginerd | 0:b562096246b3 | 247 | } hciHwErrorEvt_t; |
enginerd | 0:b562096246b3 | 248 | |
enginerd | 0:b562096246b3 | 249 | /*! LE encrypt command complete event */ |
enginerd | 0:b562096246b3 | 250 | typedef struct |
enginerd | 0:b562096246b3 | 251 | { |
enginerd | 0:b562096246b3 | 252 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 253 | uint8_t status; |
enginerd | 0:b562096246b3 | 254 | uint8_t data[HCI_ENCRYPT_DATA_LEN]; |
enginerd | 0:b562096246b3 | 255 | } hciLeEncryptCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 256 | |
enginerd | 0:b562096246b3 | 257 | /*! LE rand command complete event */ |
enginerd | 0:b562096246b3 | 258 | typedef struct |
enginerd | 0:b562096246b3 | 259 | { |
enginerd | 0:b562096246b3 | 260 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 261 | uint8_t status; |
enginerd | 0:b562096246b3 | 262 | uint8_t randNum[HCI_RAND_LEN]; |
enginerd | 0:b562096246b3 | 263 | } hciLeRandCmdCmplEvt_t; |
enginerd | 0:b562096246b3 | 264 | |
enginerd | 0:b562096246b3 | 265 | |
enginerd | 0:b562096246b3 | 266 | /*! Union of all event types */ |
enginerd | 0:b562096246b3 | 267 | typedef union |
enginerd | 0:b562096246b3 | 268 | { |
enginerd | 0:b562096246b3 | 269 | wsfMsgHdr_t hdr; |
enginerd | 0:b562096246b3 | 270 | wsfMsgHdr_t resetSeqCmpl; |
enginerd | 0:b562096246b3 | 271 | hciLeConnCmplEvt_t leConnCmpl; |
enginerd | 0:b562096246b3 | 272 | hciDisconnectCmplEvt_t disconnectCmpl; |
enginerd | 0:b562096246b3 | 273 | hciLeConnUpdateCmplEvt_t leConnUpdateCmpl; |
enginerd | 0:b562096246b3 | 274 | hciLeCreateConnCancelCmdCmplEvt_t leCreateConnCancelCmdCmpl; |
enginerd | 0:b562096246b3 | 275 | hciLeAdvReportEvt_t leAdvReport; |
enginerd | 0:b562096246b3 | 276 | hciReadRssiCmdCmplEvt_t readRssiCmdCmpl; |
enginerd | 0:b562096246b3 | 277 | hciReadChanMapCmdCmplEvt_t readChanMapCmdCmpl; |
enginerd | 0:b562096246b3 | 278 | hciReadTxPwrLvlCmdCmplEvt_t readTxPwrLvlCmdCmpl; |
enginerd | 0:b562096246b3 | 279 | hciReadRemoteVerInfoCmplEvt_t readRemoteVerInfoCmpl; |
enginerd | 0:b562096246b3 | 280 | hciLeReadRemoteFeatCmplEvt_t leReadRemoteFeatCmpl; |
enginerd | 0:b562096246b3 | 281 | hciLeLtkReqReplCmdCmplEvt_t leLtkReqReplCmdCmpl; |
enginerd | 0:b562096246b3 | 282 | hciLeLtkReqNegReplCmdCmplEvt_t leLtkReqNegReplCmdCmpl; |
enginerd | 0:b562096246b3 | 283 | hciEncKeyRefreshCmpl_t encKeyRefreshCmpl; |
enginerd | 0:b562096246b3 | 284 | hciEncChangeEvt_t encChange; |
enginerd | 0:b562096246b3 | 285 | hciLeLtkReqEvt_t leLtkReq; |
enginerd | 0:b562096246b3 | 286 | hciVendorSpecCmdStatusEvt_t vendorSpecCmdStatus; |
enginerd | 0:b562096246b3 | 287 | hciVendorSpecCmdCmplEvt_t vendorSpecCmdCmpl; |
enginerd | 0:b562096246b3 | 288 | hciVendorSpecEvt_t vendorSpec; |
enginerd | 0:b562096246b3 | 289 | hciHwErrorEvt_t hwError; |
enginerd | 0:b562096246b3 | 290 | hciLeEncryptCmdCmplEvt_t leEncryptCmdCmpl; |
enginerd | 0:b562096246b3 | 291 | hciLeRandCmdCmplEvt_t leRandCmdCmpl; |
enginerd | 0:b562096246b3 | 292 | } hciEvt_t; |
enginerd | 0:b562096246b3 | 293 | |
enginerd | 0:b562096246b3 | 294 | /************************************************************************************************** |
enginerd | 0:b562096246b3 | 295 | Callback Function Types |
enginerd | 0:b562096246b3 | 296 | **************************************************************************************************/ |
enginerd | 0:b562096246b3 | 297 | |
enginerd | 0:b562096246b3 | 298 | typedef void (*hciEvtCback_t)(hciEvt_t *pEvent); |
enginerd | 0:b562096246b3 | 299 | typedef void (*hciSecCback_t)(hciEvt_t *pEvent); |
enginerd | 0:b562096246b3 | 300 | typedef void (*hciAclCback_t)(uint8_t *pData); |
enginerd | 0:b562096246b3 | 301 | typedef void (*hciFlowCback_t)(uint16_t handle, bool_t flowDisabled); |
enginerd | 0:b562096246b3 | 302 | |
enginerd | 0:b562096246b3 | 303 | /************************************************************************************************** |
enginerd | 0:b562096246b3 | 304 | Function Declarations |
enginerd | 0:b562096246b3 | 305 | **************************************************************************************************/ |
enginerd | 0:b562096246b3 | 306 | |
enginerd | 0:b562096246b3 | 307 | /*! Initialization, registration, and reset */ |
enginerd | 0:b562096246b3 | 308 | void HciEvtRegister(hciEvtCback_t evtCback); |
enginerd | 0:b562096246b3 | 309 | void HciSecRegister(hciSecCback_t secCback); |
enginerd | 0:b562096246b3 | 310 | void HciAclRegister(hciAclCback_t aclCback, hciFlowCback_t flowCback); |
enginerd | 0:b562096246b3 | 311 | void HciResetSequence(void); |
enginerd | 0:b562096246b3 | 312 | void HciVsInit(uint8_t param); |
enginerd | 0:b562096246b3 | 313 | |
enginerd | 0:b562096246b3 | 314 | /*! Optimization interface */ |
enginerd | 0:b562096246b3 | 315 | uint8_t *HciGetBdAddr(void); |
enginerd | 0:b562096246b3 | 316 | uint8_t HciGetWhiteListSize(void); |
enginerd | 0:b562096246b3 | 317 | int8_t HciGetAdvTxPwr(void); |
enginerd | 0:b562096246b3 | 318 | uint16_t HciGetBufSize(void); |
enginerd | 0:b562096246b3 | 319 | uint8_t HciGetNumBufs(void); |
enginerd | 0:b562096246b3 | 320 | uint8_t *HciGetSupStates(void); |
enginerd | 0:b562096246b3 | 321 | uint8_t HciGetLeSupFeat(void); |
enginerd | 0:b562096246b3 | 322 | |
enginerd | 0:b562096246b3 | 323 | /*! ACL data interface */ |
enginerd | 0:b562096246b3 | 324 | void HciSendAclData(uint8_t *pAclData); |
enginerd | 0:b562096246b3 | 325 | |
enginerd | 0:b562096246b3 | 326 | /*! Command interface */ |
enginerd | 0:b562096246b3 | 327 | void HciDisconnectCmd(uint16_t handle, uint8_t reason); |
enginerd | 0:b562096246b3 | 328 | void HciLeAddDevWhiteListCmd(uint8_t addrType, uint8_t *pAddr); |
enginerd | 0:b562096246b3 | 329 | void HciLeClearWhiteListCmd(void); |
enginerd | 0:b562096246b3 | 330 | void HciLeConnUpdateCmd(uint16_t handle, hciConnSpec_t *pConnSpec); |
enginerd | 0:b562096246b3 | 331 | void HciLeCreateConnCmd(uint16_t scanInterval, uint16_t scanWindow, uint8_t filterPolicy, |
enginerd | 0:b562096246b3 | 332 | uint8_t peerAddrType, uint8_t *pPeerAddr, uint8_t ownAddrType, |
enginerd | 0:b562096246b3 | 333 | hciConnSpec_t *pConnSpec); |
enginerd | 0:b562096246b3 | 334 | void HciLeCreateConnCancelCmd(void); |
enginerd | 0:b562096246b3 | 335 | void HciLeEncryptCmd(uint8_t *pKey, uint8_t *pData); |
enginerd | 0:b562096246b3 | 336 | void HciLeLtkReqNegReplCmd(uint16_t handle); |
enginerd | 0:b562096246b3 | 337 | void HciLeLtkReqReplCmd(uint16_t handle, uint8_t *pKey); |
enginerd | 0:b562096246b3 | 338 | void HciLeRandCmd(void); |
enginerd | 0:b562096246b3 | 339 | void HciLeReadAdvTXPowerCmd(void); |
enginerd | 0:b562096246b3 | 340 | void HciLeReadBufSizeCmd(void); |
enginerd | 0:b562096246b3 | 341 | void HciLeReadChanMapCmd(uint16_t handle); |
enginerd | 0:b562096246b3 | 342 | void HciLeReadLocalSupFeatCmd(void); |
enginerd | 0:b562096246b3 | 343 | void HciLeReadRemoteFeatCmd(uint16_t handle); |
enginerd | 0:b562096246b3 | 344 | void HciLeReadSupStatesCmd(void); |
enginerd | 0:b562096246b3 | 345 | void HciLeReadWhiteListSizeCmd(void); |
enginerd | 0:b562096246b3 | 346 | void HciLeRemoveDevWhiteListCmd(uint8_t addrType, uint8_t *pAddr); |
enginerd | 0:b562096246b3 | 347 | void HciLeSetAdvEnableCmd(uint8_t enable); |
enginerd | 0:b562096246b3 | 348 | void HciLeSetAdvDataCmd(uint8_t len, uint8_t *pData); |
enginerd | 0:b562096246b3 | 349 | void HciLeSetAdvParamCmd(uint16_t advIntervalMin, uint16_t advIntervalMax, uint8_t advType, |
enginerd | 0:b562096246b3 | 350 | uint8_t ownAddrType, uint8_t directAddrType, uint8_t *pDirectAddr, |
enginerd | 0:b562096246b3 | 351 | uint8_t advChanMap, uint8_t advFiltPolicy); |
enginerd | 0:b562096246b3 | 352 | void HciLeSetEventMaskCmd(uint8_t *pLeEventMask); |
enginerd | 0:b562096246b3 | 353 | void HciLeSetHostChanClassCmd(uint8_t *pChanMap); |
enginerd | 0:b562096246b3 | 354 | void HciLeSetRandAddrCmd(uint8_t *pAddr); |
enginerd | 0:b562096246b3 | 355 | void HciLeSetScanEnableCmd(uint8_t enable, uint8_t filterDup); |
enginerd | 0:b562096246b3 | 356 | void HciLeSetScanParamCmd(uint8_t scanType, uint16_t scanInterval, uint16_t scanWindow, |
enginerd | 0:b562096246b3 | 357 | uint8_t ownAddrType, uint8_t scanFiltPolicy); |
enginerd | 0:b562096246b3 | 358 | void HciLeSetScanRespDataCmd(uint8_t len, uint8_t *pData); |
enginerd | 0:b562096246b3 | 359 | void HciLeStartEncryptionCmd(uint16_t handle, uint8_t *pRand, uint16_t diversifier, uint8_t *pKey); |
enginerd | 0:b562096246b3 | 360 | void HciReadBdAddrCmd(void); |
enginerd | 0:b562096246b3 | 361 | void HciReadBufSizeCmd(void); |
enginerd | 0:b562096246b3 | 362 | void HciReadLocalSupFeatCmd(void); |
enginerd | 0:b562096246b3 | 363 | void HciReadLocalVerInfoCmd(void); |
enginerd | 0:b562096246b3 | 364 | void HciReadRemoteVerInfoCmd(uint16_t handle); |
enginerd | 0:b562096246b3 | 365 | void HciReadRssiCmd(uint16_t handle); |
enginerd | 0:b562096246b3 | 366 | void HciReadTxPwrLvlCmd(uint16_t handle, uint8_t type); |
enginerd | 0:b562096246b3 | 367 | void HciResetCmd(void); |
enginerd | 0:b562096246b3 | 368 | void HciSetEventMaskCmd(uint8_t *pEventMask); |
enginerd | 0:b562096246b3 | 369 | void HciVendorSpecificCmd(uint16_t opcode, uint8_t len, uint8_t *pData); |
enginerd | 0:b562096246b3 | 370 | |
enginerd | 0:b562096246b3 | 371 | #ifdef __cplusplus |
enginerd | 0:b562096246b3 | 372 | }; |
enginerd | 0:b562096246b3 | 373 | #endif |
enginerd | 0:b562096246b3 | 374 | |
enginerd | 0:b562096246b3 | 375 | #endif /* HCI_API_H */ |