Test version of BlueUSB stack. Includes SDP and RFCOMM. As Client it allows to connect to my fischertechnik TX Controller. As Server it echo\\\\\\\'s characters to Putty. PIN=1234

Dependencies:   mbed myUSBHost AvailableMemory

Dependents:   mbed_TANK_Kinect myBlueUSB_ros ftusbClass

Committer:
networker
Date:
Sun Jun 19 12:43:19 2011 +0000
Revision:
7:99068afea04d

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
networker 7:99068afea04d 1 /*
networker 7:99068afea04d 2 Copyright (c) 2010 Peter Barrett
networker 7:99068afea04d 3
networker 7:99068afea04d 4 Permission is hereby granted, free of charge, to any person obtaining a copy
networker 7:99068afea04d 5 of this software and associated documentation files (the "Software"), to deal
networker 7:99068afea04d 6 in the Software without restriction, including without limitation the rights
networker 7:99068afea04d 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
networker 7:99068afea04d 8 copies of the Software, and to permit persons to whom the Software is
networker 7:99068afea04d 9 furnished to do so, subject to the following conditions:
networker 7:99068afea04d 10
networker 7:99068afea04d 11 The above copyright notice and this permission notice shall be included in
networker 7:99068afea04d 12 all copies or substantial portions of the Software.
networker 7:99068afea04d 13
networker 7:99068afea04d 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
networker 7:99068afea04d 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
networker 7:99068afea04d 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
networker 7:99068afea04d 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
networker 7:99068afea04d 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
networker 7:99068afea04d 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
networker 7:99068afea04d 20 THE SOFTWARE.
networker 7:99068afea04d 21 */
networker 7:99068afea04d 22
networker 7:99068afea04d 23 #ifndef HCI_PRIVATE_H_INCLUDED
networker 7:99068afea04d 24 #define HCI_PRIVATE_H_INCLUDED
networker 7:99068afea04d 25
networker 7:99068afea04d 26 #define HCI_OP_INQUIRY 0x0401
networker 7:99068afea04d 27 #define HCI_OP_INQUIRY_CANCEL 0x0402
networker 7:99068afea04d 28 #define HCI_OP_EXIT_PERIODIC_INQ 0x0404
networker 7:99068afea04d 29 #define HCI_OP_CREATE_CONN 0x0405
networker 7:99068afea04d 30 #define HCI_OP_DISCONNECT 0x0406
networker 7:99068afea04d 31 #define HCI_OP_ADD_SCO 0x0407
networker 7:99068afea04d 32 #define HCI_OP_CREATE_CONN_CANCEL 0x0408
networker 7:99068afea04d 33 #define HCI_OP_ACCEPT_CONN_REQ 0x0409
networker 7:99068afea04d 34 #define HCI_OP_REJECT_CONN_REQ 0x040a
networker 7:99068afea04d 35 #define HCI_OP_LINK_KEY_REPLY 0x040b
networker 7:99068afea04d 36 #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c
networker 7:99068afea04d 37 #define HCI_OP_PIN_CODE_REPLY 0x040d
networker 7:99068afea04d 38 #define HCI_OP_PIN_CODE_NEG_REPLY 0x040e
networker 7:99068afea04d 39 #define HCI_OP_CHANGE_CONN_PTYPE 0x040f
networker 7:99068afea04d 40 #define HCI_OP_AUTH_REQUESTED 0x0411
networker 7:99068afea04d 41 #define HCI_OP_SET_CONN_ENCRYPT 0x0413
networker 7:99068afea04d 42 #define HCI_OP_CHANGE_CONN_LINK_KEY 0x0415
networker 7:99068afea04d 43 #define HCI_OP_REMOTE_NAME_REQ 0x0419
networker 7:99068afea04d 44 #define HCI_OP_REMOTE_NAME_REQ_CANCEL 0x041a
networker 7:99068afea04d 45 #define HCI_OP_READ_REMOTE_FEATURES 0x041b
networker 7:99068afea04d 46 #define HCI_OP_READ_REMOTE_EXT_FEATURES 0x041c
networker 7:99068afea04d 47 #define HCI_OP_READ_REMOTE_VERSION 0x041d
networker 7:99068afea04d 48 #define HCI_OP_SETUP_SYNC_CONN 0x0428
networker 7:99068afea04d 49 #define HCI_OP_ACCEPT_SYNC_CONN_REQ 0x0429
networker 7:99068afea04d 50 #define HCI_OP_REJECT_SYNC_CONN_REQ 0x042a
networker 7:99068afea04d 51
networker 7:99068afea04d 52 #define HCI_OP_SNIFF_MODE 0x0803
networker 7:99068afea04d 53 #define HCI_OP_EXIT_SNIFF_MODE 0x0804
networker 7:99068afea04d 54 #define HCI_OP_ROLE_DISCOVERY 0x0809
networker 7:99068afea04d 55 #define HCI_OP_SWITCH_ROLE 0x080b
networker 7:99068afea04d 56 #define HCI_OP_READ_LINK_POLICY 0x080c
networker 7:99068afea04d 57 #define HCI_OP_WRITE_LINK_POLICY 0x080d
networker 7:99068afea04d 58 #define HCI_OP_READ_DEF_LINK_POLICY 0x080e
networker 7:99068afea04d 59 #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f
networker 7:99068afea04d 60 #define HCI_OP_SNIFF_SUBRATE 0x0811
networker 7:99068afea04d 61
networker 7:99068afea04d 62
networker 7:99068afea04d 63 #define HCI_OP_SET_EVENT_MASK 0x0c01
networker 7:99068afea04d 64 #define HCI_OP_RESET 0x0c03
networker 7:99068afea04d 65 #define HCI_OP_SET_EVENT_FLT 0x0c05
networker 7:99068afea04d 66 #define HCI_OP_WRITE_LOCAL_NAME 0x0c13
networker 7:99068afea04d 67 #define HCI_OP_READ_LOCAL_NAME 0x0c14
networker 7:99068afea04d 68 #define HCI_OP_WRITE_CA_TIMEOUT 0x0c16
networker 7:99068afea04d 69 #define HCI_OP_WRITE_PG_TIMEOUT 0x0c18
networker 7:99068afea04d 70 #define HCI_OP_WRITE_SCAN_ENABLE 0x0c1a
networker 7:99068afea04d 71 #define HCI_OP_READ_AUTH_ENABLE 0x0c1f
networker 7:99068afea04d 72 #define HCI_OP_WRITE_AUTH_ENABLE 0x0c20
networker 7:99068afea04d 73 #define HCI_OP_READ_ENCRYPT_MODE 0x0c21
networker 7:99068afea04d 74 #define HCI_OP_WRITE_ENCRYPT_MODE 0x0c22
networker 7:99068afea04d 75 #define ENCRYPT_DISABLED 0x00
networker 7:99068afea04d 76 #define ENCRYPT_P2P 0x01
networker 7:99068afea04d 77 #define ENCRYPT_BOTH 0x02
networker 7:99068afea04d 78 #define HCI_OP_READ_CLASS_OF_DEV 0x0c23
networker 7:99068afea04d 79 #define HCI_OP_WRITE_CLASS_OF_DEV 0x0c24
networker 7:99068afea04d 80 #define HCI_OP_READ_VOICE_SETTING 0x0c25
networker 7:99068afea04d 81 #define HCI_OP_WRITE_VOICE_SETTING 0x0c26
networker 7:99068afea04d 82 #define HCI_OP_CONTR_TO_HOST_FLOW 0x0c31
networker 7:99068afea04d 83 #define HCI_OP_HOST_BUFFER_SIZE 0x0c33
networker 7:99068afea04d 84 #define HCI_OP_NUM_COMP_PKTS 0x0c35
networker 7:99068afea04d 85 #define HCI_OP_READ_SSP_MODE 0x0c55
networker 7:99068afea04d 86 #define HCI_OP_WRITE_SSP_MODE 0x0c56
networker 7:99068afea04d 87
networker 7:99068afea04d 88 #define HCI_OP_READ_LOCAL_VERSION 0x1001
networker 7:99068afea04d 89 #define HCI_OP_READ_LOCAL_COMMANDS 0x1002
networker 7:99068afea04d 90 #define HCI_OP_READ_LOCAL_FEATURES 0x1003
networker 7:99068afea04d 91 #define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004
networker 7:99068afea04d 92 #define HCI_OP_READ_BUFFER_SIZE 0x1005
networker 7:99068afea04d 93 #define HCI_OP_READ_BD_ADDR 0x1009
networker 7:99068afea04d 94
networker 7:99068afea04d 95 // events
networker 7:99068afea04d 96 #define HCI_EV_INQUIRY_COMPLETE 0x01
networker 7:99068afea04d 97 #define HCI_EV_INQUIRY_RESULT 0x02
networker 7:99068afea04d 98 #define HCI_EV_CONN_COMPLETE 0x03
networker 7:99068afea04d 99 #define HCI_EV_CONN_REQUEST 0x04
networker 7:99068afea04d 100 #define HCI_EV_DISCONN_COMPLETE 0x05
networker 7:99068afea04d 101 #define HCI_EV_AUTH_COMPLETE 0x06
networker 7:99068afea04d 102 #define HCI_EV_REMOTE_NAME 0x07
networker 7:99068afea04d 103 #define HCI_EV_ENCRYPT_CHANGE 0x08
networker 7:99068afea04d 104 #define HCI_EV_CHANGE_LINK_KEY_COMPLETE 0x09
networker 7:99068afea04d 105 #define HCI_EV_REMOTE_FEATURES 0x0b
networker 7:99068afea04d 106 #define HCI_EV_REMOTE_VERSION 0x0c
networker 7:99068afea04d 107 #define HCI_EV_QOS_SETUP_COMPLETE 0x0d
networker 7:99068afea04d 108 #define HCI_EV_CMD_COMPLETE 0x0e
networker 7:99068afea04d 109 #define HCI_EV_CMD_STATUS 0x0f
networker 7:99068afea04d 110 #define HCI_EV_ROLE_CHANGE 0x12
networker 7:99068afea04d 111 #define HCI_EV_NUM_COMP_PKTS 0x13
networker 7:99068afea04d 112 #define HCI_EV_MODE_CHANGE 0x14
networker 7:99068afea04d 113 #define HCI_EV_RETURN_LINK_KEYS 0x15
networker 7:99068afea04d 114 #define HCI_EV_PIN_CODE_REQ 0x16
networker 7:99068afea04d 115 #define HCI_EV_LINK_KEY_REQ 0x17
networker 7:99068afea04d 116 #define HCI_EV_LINK_KEY_NOTIFY 0x18
networker 7:99068afea04d 117 #define HCI_EV_CLOCK_OFFSET 0x1c
networker 7:99068afea04d 118 #define HCI_EV_PKT_TYPE_CHANGE 0x1d
networker 7:99068afea04d 119 #define HCI_EV_PSCAN_REP_MODE 0x20
networker 7:99068afea04d 120 #define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22
networker 7:99068afea04d 121 #define HCI_EV_REMOTE_EXT_FEATURES 0x23
networker 7:99068afea04d 122 #define HCI_EV_SYNC_CONN_COMPLETE 0x2c
networker 7:99068afea04d 123 #define HCI_EV_SYNC_CONN_CHANGED 0x2d
networker 7:99068afea04d 124 #define HCI_EV_SNIFF_SUBRATE 0x2e
networker 7:99068afea04d 125 #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2f
networker 7:99068afea04d 126 #define HCI_EV_IO_CAPA_REQUEST 0x31
networker 7:99068afea04d 127 #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
networker 7:99068afea04d 128 #define HCI_EV_REMOTE_HOST_FEATURES 0x3d
networker 7:99068afea04d 129 #define HCI_EV_VENDOR 0xff
networker 7:99068afea04d 130
networker 7:99068afea04d 131 /* Possible error codes */
networker 7:99068afea04d 132 #define HCI_UNKNOWN_HCI_COMMAND 0x01
networker 7:99068afea04d 133 #define HCI_NO_CONNECTION 0x02
networker 7:99068afea04d 134 #define HCI_HW_FAILURE 0x03
networker 7:99068afea04d 135 #define HCI_PAGE_TIMEOUT 0x04
networker 7:99068afea04d 136 #define HCI_AUTHENTICATION_FAILURE 0x05
networker 7:99068afea04d 137 #define HCI_KEY_MISSING 0x06
networker 7:99068afea04d 138 #define HCI_MEMORY_FULL 0x07
networker 7:99068afea04d 139 #define HCI_CONN_TIMEOUT 0x08
networker 7:99068afea04d 140 #define HCI_MAX_NUMBER_OF_CONNECTIONS 0x09
networker 7:99068afea04d 141 #define HCI_MAX_NUMBER_OF_SCO_CONNECTIONS_TO_DEVICE 0x0A
networker 7:99068afea04d 142 #define HCI_ACL_CONNECTION_EXISTS 0x0B
networker 7:99068afea04d 143 #define HCI_COMMAND_DISSALLOWED 0x0C
networker 7:99068afea04d 144 #define HCI_HOST_REJECTED_DUE_TO_LIMITED_RESOURCES 0x0D
networker 7:99068afea04d 145 #define HCI_HOST_REJECTED_DUE_TO_SECURITY_REASONS 0x0E
networker 7:99068afea04d 146 #define HCI_HOST_REJECTED_DUE_TO_REMOTE_DEVICE_ONLY_PERSONAL_SERVICE 0x0F
networker 7:99068afea04d 147 #define HCI_HOST_TIMEOUT 0x10
networker 7:99068afea04d 148 #define HCI_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE 0x11
networker 7:99068afea04d 149 #define HCI_INVALID_HCI_COMMAND_PARAMETERS 0x12
networker 7:99068afea04d 150 #define HCI_OTHER_END_TERMINATED_CONN_USER_ENDED 0x13
networker 7:99068afea04d 151 #define HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES 0x14
networker 7:99068afea04d 152 #define HCI_OTHER_END_TERMINATED_CONN_ABOUT_TO_POWER_OFF 0x15
networker 7:99068afea04d 153 #define HCI_CONN_TERMINATED_BY_LOCAL_HOST 0x16
networker 7:99068afea04d 154 #define HCI_REPETED_ATTEMPTS 0x17
networker 7:99068afea04d 155 #define HCI_PAIRING_NOT_ALLOWED 0x18
networker 7:99068afea04d 156 #define HCI_UNKNOWN_LMP_PDU 0x19
networker 7:99068afea04d 157 #define HCI_UNSUPPORTED_REMOTE_FEATURE 0x1A
networker 7:99068afea04d 158 #define HCI_SCO_OFFSET_REJECTED 0x1B
networker 7:99068afea04d 159 #define HCI_SCO_INTERVAL_REJECTED 0x1C
networker 7:99068afea04d 160 #define HCI_SCO_AIR_MODE_REJECTED 0x1D
networker 7:99068afea04d 161 #define HCI_INVALID_LMP_PARAMETERS 0x1E
networker 7:99068afea04d 162 #define HCI_UNSPECIFIED_ERROR 0x1F
networker 7:99068afea04d 163 #define HCI_UNSUPPORTED_LMP_PARAMETER_VALUE 0x20
networker 7:99068afea04d 164 #define HCI_ROLE_CHANGE_NOT_ALLOWED 0x21
networker 7:99068afea04d 165 #define HCI_LMP_RESPONSE_TIMEOUT 0x22
networker 7:99068afea04d 166 #define HCI_LMP_ERROR_TRANSACTION_COLLISION 0x23
networker 7:99068afea04d 167 #define HCI_LMP_PDU_NOT_ALLOWED 0x24
networker 7:99068afea04d 168 #define HCI_ENCRYPTION_MODE_NOT_ACCEPTABLE 0x25
networker 7:99068afea04d 169 #define HCI_UNIT_KEY_USED 0x26
networker 7:99068afea04d 170 #define HCI_QOS_NOT_SUPPORTED 0x27
networker 7:99068afea04d 171 #define HCI_INSTANT_PASSED 0x28
networker 7:99068afea04d 172 #define HCI_PAIRING_UNIT_KEY_NOT_SUPPORTED 0x29
networker 7:99068afea04d 173
networker 7:99068afea04d 174 const char* EvtStr(int evt)
networker 7:99068afea04d 175 {
networker 7:99068afea04d 176 switch (evt)
networker 7:99068afea04d 177 {
networker 7:99068afea04d 178 case HCI_EV_INQUIRY_COMPLETE: return "HCI_EV_INQUIRY_COMPLETE";
networker 7:99068afea04d 179 case HCI_EV_INQUIRY_RESULT: return "HCI_EV_INQUIRY_RESULT";
networker 7:99068afea04d 180 case HCI_EV_CONN_COMPLETE: return "HCI_EV_CONN_COMPLETE";
networker 7:99068afea04d 181 case HCI_EV_CONN_REQUEST: return "HCI_EV_CONN_REQUEST";
networker 7:99068afea04d 182 case HCI_EV_DISCONN_COMPLETE: return "HCI_EV_DISCONN_COMPLETE";
networker 7:99068afea04d 183 case HCI_EV_AUTH_COMPLETE: return "HCI_EV_AUTH_COMPLETE";
networker 7:99068afea04d 184 case HCI_EV_REMOTE_NAME: return "HCI_EV_REMOTE_NAME";
networker 7:99068afea04d 185 case HCI_EV_ENCRYPT_CHANGE: return "HCI_EV_ENCRYPT_CHANGE";
networker 7:99068afea04d 186 case HCI_EV_CHANGE_LINK_KEY_COMPLETE : return "HCI_EV_CHANGE_LINK_KEY_COMPLETE";
networker 7:99068afea04d 187 case HCI_EV_REMOTE_FEATURES: return "HCI_EV_REMOTE_FEATURES";
networker 7:99068afea04d 188 case HCI_EV_REMOTE_VERSION: return "HCI_EV_REMOTE_VERSION";
networker 7:99068afea04d 189 case HCI_EV_QOS_SETUP_COMPLETE : return "HCI_EV_QOS_SETUP_COMPLETE";
networker 7:99068afea04d 190 case HCI_EV_CMD_COMPLETE: return "HCI_EV_CMD_COMPLETE";
networker 7:99068afea04d 191 case HCI_EV_CMD_STATUS: return "HCI_EV_CMD_STATUS";
networker 7:99068afea04d 192 case HCI_EV_ROLE_CHANGE: return "HCI_EV_ROLE_CHANGE";
networker 7:99068afea04d 193 case HCI_EV_NUM_COMP_PKTS: return "HCI_EV_NUM_COMP_PKTS";
networker 7:99068afea04d 194 case HCI_EV_MODE_CHANGE: return "HCI_EV_MODE_CHANGE";
networker 7:99068afea04d 195 case HCI_EV_PIN_CODE_REQ: return "HCI_EV_PIN_CODE_REQ";
networker 7:99068afea04d 196 case HCI_EV_LINK_KEY_REQ: return "HCI_EV_LINK_KEY_REQ";
networker 7:99068afea04d 197 case HCI_EV_LINK_KEY_NOTIFY: return "HCI_EV_LINK_KEY_NOTIFY";
networker 7:99068afea04d 198 case HCI_EV_CLOCK_OFFSET: return "HCI_EV_CLOCK_OFFSET";
networker 7:99068afea04d 199 case HCI_EV_PKT_TYPE_CHANGE: return "HCI_EV_PKT_TYPE_CHANGE";
networker 7:99068afea04d 200 case HCI_EV_PSCAN_REP_MODE: return "HCI_EV_PSCAN_REP_MODE";
networker 7:99068afea04d 201 case HCI_EV_INQUIRY_RESULT_WITH_RSSI : return "HCI_EV_INQUIRY_RESULT_WITH_RSSI";
networker 7:99068afea04d 202 case HCI_EV_REMOTE_EXT_FEATURES: return "HCI_EV_REMOTE_EXT_FEATURES";
networker 7:99068afea04d 203 case HCI_EV_SYNC_CONN_COMPLETE: return "HCI_EV_SYNC_CONN_COMPLETE";
networker 7:99068afea04d 204 case HCI_EV_SYNC_CONN_CHANGED: return "HCI_EV_SYNC_CONN_CHANGED";
networker 7:99068afea04d 205 case HCI_EV_SNIFF_SUBRATE: return "HCI_EV_SNIFF_SUBRATE";
networker 7:99068afea04d 206 case HCI_EV_EXTENDED_INQUIRY_RESULT: return "HCI_EV_EXTENDED_INQUIRY_RESULT";
networker 7:99068afea04d 207 case HCI_EV_IO_CAPA_REQUEST: return "HCI_EV_IO_CAPA_REQUEST";
networker 7:99068afea04d 208 case HCI_EV_SIMPLE_PAIR_COMPLETE: return "HCI_EV_SIMPLE_PAIR_COMPLETE";
networker 7:99068afea04d 209 case HCI_EV_REMOTE_HOST_FEATURES: return "HCI_EV_REMOTE_HOST_FEATURES";
networker 7:99068afea04d 210 }
networker 7:99068afea04d 211 return "Unknown Event";
networker 7:99068afea04d 212 }
networker 7:99068afea04d 213
networker 7:99068afea04d 214 const char* CmdStr(int cmd)
networker 7:99068afea04d 215 {
networker 7:99068afea04d 216 switch (cmd)
networker 7:99068afea04d 217 {
networker 7:99068afea04d 218 // 0x04XX
networker 7:99068afea04d 219 case HCI_OP_INQUIRY: return "HCI_OP_INQUIRY";
networker 7:99068afea04d 220 case HCI_OP_INQUIRY_CANCEL: return "HCI_OP_INQUIRY_CANCEL";
networker 7:99068afea04d 221 case HCI_OP_EXIT_PERIODIC_INQ: return "HCI_OP_EXIT_PERIODIC_INQ";
networker 7:99068afea04d 222 case HCI_OP_CREATE_CONN: return "HCI_OP_CREATE_CONN";
networker 7:99068afea04d 223 case HCI_OP_DISCONNECT: return "HCI_OP_DISCONNECT";
networker 7:99068afea04d 224 case HCI_OP_ADD_SCO: return "HCI_OP_ADD_SCO";
networker 7:99068afea04d 225 case HCI_OP_CREATE_CONN_CANCEL: return "HCI_OP_CREATE_CONN_CANCEL";
networker 7:99068afea04d 226 case HCI_OP_ACCEPT_CONN_REQ: return "HCI_OP_ACCEPT_CONN_REQ";
networker 7:99068afea04d 227 case HCI_OP_REJECT_CONN_REQ: return "HCI_OP_REJECT_CONN_REQ";
networker 7:99068afea04d 228 case HCI_OP_LINK_KEY_REPLY: return "HCI_OP_LINK_KEY_REPLY";
networker 7:99068afea04d 229 case HCI_OP_LINK_KEY_NEG_REPLY: return "HCI_OP_LINK_KEY_NEG_REPLY";
networker 7:99068afea04d 230 case HCI_OP_PIN_CODE_REPLY: return "HCI_OP_PIN_CODE_REPLY";
networker 7:99068afea04d 231 case HCI_OP_PIN_CODE_NEG_REPLY: return "HCI_OP_PIN_CODE_NEG_REPLY";
networker 7:99068afea04d 232 case HCI_OP_CHANGE_CONN_PTYPE: return "HCI_OP_CHANGE_CONN_PTYPE";
networker 7:99068afea04d 233 case HCI_OP_AUTH_REQUESTED: return "HCI_OP_AUTH_REQUESTED";
networker 7:99068afea04d 234 case HCI_OP_SET_CONN_ENCRYPT: return "HCI_OP_SET_CONN_ENCRYPT";
networker 7:99068afea04d 235 case HCI_OP_CHANGE_CONN_LINK_KEY: return "HCI_OP_CHANGE_CONN_LINK_KEY";
networker 7:99068afea04d 236 case HCI_OP_REMOTE_NAME_REQ: return "HCI_OP_REMOTE_NAME_REQ";
networker 7:99068afea04d 237 case HCI_OP_REMOTE_NAME_REQ_CANCEL: return "HCI_OP_REMOTE_NAME_REQ_CANCEL";
networker 7:99068afea04d 238 case HCI_OP_READ_REMOTE_FEATURES: return "HCI_OP_READ_REMOTE_FEATURES";
networker 7:99068afea04d 239 case HCI_OP_READ_REMOTE_EXT_FEATURES: return "HCI_OP_READ_REMOTE_EXT_FEATURES";
networker 7:99068afea04d 240 case HCI_OP_READ_REMOTE_VERSION: return "HCI_OP_READ_REMOTE_VERSION";
networker 7:99068afea04d 241 case HCI_OP_SETUP_SYNC_CONN: return "HCI_OP_SETUP_SYNC_CONN";
networker 7:99068afea04d 242 case HCI_OP_ACCEPT_SYNC_CONN_REQ: return "HCI_OP_ACCEPT_SYNC_CONN_REQ";
networker 7:99068afea04d 243 case HCI_OP_REJECT_SYNC_CONN_REQ: return "HCI_OP_REJECT_SYNC_CONN_REQ";
networker 7:99068afea04d 244 // 0x0CXX
networker 7:99068afea04d 245 case HCI_OP_SET_EVENT_MASK: return "HCI_OP_SET_EVENT_MASK";
networker 7:99068afea04d 246 case HCI_OP_RESET: return "HCI_OP_RESET";
networker 7:99068afea04d 247 case HCI_OP_SET_EVENT_FLT: return "HCI_OP_SET_EVENT_FLT";
networker 7:99068afea04d 248 case HCI_OP_WRITE_LOCAL_NAME: return "HCI_OP_WRITE_LOCAL_NAME";
networker 7:99068afea04d 249 case HCI_OP_READ_LOCAL_NAME: return "HCI_OP_READ_LOCAL_NAME";
networker 7:99068afea04d 250 case HCI_OP_WRITE_CA_TIMEOUT: return "HCI_OP_WRITE_CA_TIMEOUT";
networker 7:99068afea04d 251 case HCI_OP_WRITE_PG_TIMEOUT: return "HCI_OP_WRITE_PG_TIMEOUT";
networker 7:99068afea04d 252 case HCI_OP_WRITE_SCAN_ENABLE: return "HCI_OP_WRITE_SCAN_ENABLE";
networker 7:99068afea04d 253 case HCI_OP_READ_AUTH_ENABLE: return "HCI_OP_READ_AUTH_ENABLE";
networker 7:99068afea04d 254 case HCI_OP_WRITE_AUTH_ENABLE: return "HCI_OP_WRITE_AUTH_ENABLE";
networker 7:99068afea04d 255 case HCI_OP_READ_ENCRYPT_MODE: return "HCI_OP_READ_ENCRYPT_MODE";
networker 7:99068afea04d 256 case HCI_OP_WRITE_ENCRYPT_MODE: return "HCI_OP_WRITE_ENCRYPT_MODE";
networker 7:99068afea04d 257 case HCI_OP_READ_CLASS_OF_DEV: return "HCI_OP_READ_CLASS_OF_DEV";
networker 7:99068afea04d 258 case HCI_OP_WRITE_CLASS_OF_DEV: return "HCI_OP_WRITE_CLASS_OF_DEV";
networker 7:99068afea04d 259 case HCI_OP_READ_VOICE_SETTING: return "HCI_OP_READ_VOICE_SETTING";
networker 7:99068afea04d 260 case HCI_OP_WRITE_VOICE_SETTING: return "HCI_OP_WRITE_VOICE_SETTING";
networker 7:99068afea04d 261 case HCI_OP_HOST_BUFFER_SIZE: return "HCI_OP_HOST_BUFFER_SIZE";
networker 7:99068afea04d 262 case HCI_OP_READ_SSP_MODE: return "HCI_OP_READ_SSP_MODE";
networker 7:99068afea04d 263 case HCI_OP_WRITE_SSP_MODE: return "HCI_OP_WRITE_SSP_MODE";
networker 7:99068afea04d 264
networker 7:99068afea04d 265 // 10xx
networker 7:99068afea04d 266 case HCI_OP_READ_LOCAL_VERSION: return "HCI_OP_READ_LOCAL_VERSION";
networker 7:99068afea04d 267 case HCI_OP_READ_LOCAL_COMMANDS: return "HCI_OP_READ_LOCAL_COMMANDS";
networker 7:99068afea04d 268 case HCI_OP_READ_LOCAL_FEATURES: return "HCI_OP_READ_LOCAL_FEATURES";
networker 7:99068afea04d 269 case HCI_OP_READ_LOCAL_EXT_FEATURES: return "HCI_OP_READ_LOCAL_EXT_FEATURES";
networker 7:99068afea04d 270 case HCI_OP_READ_BUFFER_SIZE: return "HCI_OP_READ_BUFFER_SIZE";
networker 7:99068afea04d 271 case HCI_OP_READ_BD_ADDR: return "HCI_OP_READ_BD_ADDR";
networker 7:99068afea04d 272 }
networker 7:99068afea04d 273 return "Unknown Cmd";
networker 7:99068afea04d 274 }
networker 7:99068afea04d 275
networker 7:99068afea04d 276 const char* HCIErrStr(int err)
networker 7:99068afea04d 277 {
networker 7:99068afea04d 278 switch (err)
networker 7:99068afea04d 279 {
networker 7:99068afea04d 280 case 0: return "OK";
networker 7:99068afea04d 281 case HCI_UNKNOWN_HCI_COMMAND: return "HCI_UNKNOWN_HCI_COMMAND";
networker 7:99068afea04d 282 case HCI_NO_CONNECTION: return "HCI_NO_CONNECTION";
networker 7:99068afea04d 283 case HCI_HW_FAILURE: return "HCI_HW_FAILURE";
networker 7:99068afea04d 284 case HCI_PAGE_TIMEOUT: return "HCI_PAGE_TIMEOUT";
networker 7:99068afea04d 285 case HCI_AUTHENTICATION_FAILURE: return "HCI_AUTHENTICATION_FAILURE";
networker 7:99068afea04d 286 case HCI_KEY_MISSING: return "HCI_KEY_MISSING";
networker 7:99068afea04d 287 case HCI_MEMORY_FULL: return "HCI_MEMORY_FULL";
networker 7:99068afea04d 288 case HCI_CONN_TIMEOUT: return "HCI_CONN_TIMEOUT";
networker 7:99068afea04d 289 case HCI_MAX_NUMBER_OF_CONNECTIONS: return "HCI_CONN_TIMEOUT";
networker 7:99068afea04d 290 case HCI_MAX_NUMBER_OF_SCO_CONNECTIONS_TO_DEVICE: return "HCI_MAX_NUMBER_OF_SCO_CONNECTIONS_TO_DEVICE";
networker 7:99068afea04d 291 case HCI_ACL_CONNECTION_EXISTS: return "HCI_ACL_CONNECTION_EXISTS";
networker 7:99068afea04d 292 case HCI_COMMAND_DISSALLOWED: return "HCI_COMMAND_DISSALLOWED";
networker 7:99068afea04d 293 case HCI_HOST_REJECTED_DUE_TO_LIMITED_RESOURCES: return "HCI_HOST_REJECTED_DUE_TO_LIMITED_RESOURCES";
networker 7:99068afea04d 294 case HCI_HOST_REJECTED_DUE_TO_SECURITY_REASONS: return "HCI_HOST_REJECTED_DUE_TO_SECURITY_REASONS";
networker 7:99068afea04d 295 case HCI_HOST_REJECTED_DUE_TO_REMOTE_DEVICE_ONLY_PERSONAL_SERVICE: return "HCI_HOST_REJECTED_DUE_TO_REMOTE_DEVICE_ONLY_PERSONAL_SERVICE";
networker 7:99068afea04d 296 case HCI_HOST_TIMEOUT: return "HCI_HOST_TIMEOUT";
networker 7:99068afea04d 297 case HCI_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE: return "HCI_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE";
networker 7:99068afea04d 298 case HCI_INVALID_HCI_COMMAND_PARAMETERS: return "HCI_INVALID_HCI_COMMAND_PARAMETERS";
networker 7:99068afea04d 299 case HCI_OTHER_END_TERMINATED_CONN_USER_ENDED: return "HCI_OTHER_END_TERMINATED_CONN_USER_ENDED";
networker 7:99068afea04d 300 case HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES: return "HCI_OTHER_END_TERMINATED_CONN_LOW_RESOURCES";
networker 7:99068afea04d 301 case HCI_OTHER_END_TERMINATED_CONN_ABOUT_TO_POWER_OFF: return "HCI_OTHER_END_TERMINATED_CONN_ABOUT_TO_POWER_OFF";
networker 7:99068afea04d 302 case HCI_CONN_TERMINATED_BY_LOCAL_HOST: return "HCI_CONN_TERMINATED_BY_LOCAL_HOST";
networker 7:99068afea04d 303 case HCI_REPETED_ATTEMPTS: return "HCI_REPEATED_ATTEMPTS";
networker 7:99068afea04d 304 case HCI_PAIRING_NOT_ALLOWED: return "HCI_PAIRING_NOT_ALLOWED";
networker 7:99068afea04d 305 case HCI_UNKNOWN_LMP_PDU: return "HCI_UNKNOWN_LMP_PDU";
networker 7:99068afea04d 306 case HCI_UNSUPPORTED_REMOTE_FEATURE: return "HCI_UNSUPPORTED_REMOTE_FEATURE";
networker 7:99068afea04d 307 case HCI_SCO_OFFSET_REJECTED: return "HCI_SCO_OFFSET_REJECTED";
networker 7:99068afea04d 308 case HCI_SCO_INTERVAL_REJECTED: return "HCI_SCO_INTERVAL_REJECTED";
networker 7:99068afea04d 309 case HCI_SCO_AIR_MODE_REJECTED: return "HCI_SCO_AIR_MODE_REJECTED";
networker 7:99068afea04d 310 case HCI_INVALID_LMP_PARAMETERS: return "HCI_INVALID_LMP_PARAMETERS";
networker 7:99068afea04d 311 case HCI_UNSPECIFIED_ERROR: return "HCI_UNSPECIFIED_ERROR";
networker 7:99068afea04d 312 case HCI_UNSUPPORTED_LMP_PARAMETER_VALUE: return "HCI_UNSUPPORTED_LMP_PARAMETER_VALUE";
networker 7:99068afea04d 313 case HCI_ROLE_CHANGE_NOT_ALLOWED: return "HCI_ROLE_CHANGE_NOT_ALLOWED";
networker 7:99068afea04d 314 case HCI_LMP_RESPONSE_TIMEOUT: return "HCI_LMP_RESPONSE_TIMEOUT";
networker 7:99068afea04d 315 case HCI_LMP_ERROR_TRANSACTION_COLLISION: return "HCI_LMP_ERROR_TRANSACTION_COLLISION";
networker 7:99068afea04d 316 case HCI_LMP_PDU_NOT_ALLOWED: return "HCI_LMP_PDU_NOT_ALLOWED";
networker 7:99068afea04d 317 case HCI_ENCRYPTION_MODE_NOT_ACCEPTABLE: return "HCI_ENCRYPTION_MODE_NOT_ACCEPTABLE";
networker 7:99068afea04d 318 case HCI_UNIT_KEY_USED: return "HCI_UNIT_KEY_USED";
networker 7:99068afea04d 319 case HCI_QOS_NOT_SUPPORTED: return "HCI_QOS_NOT_SUPPORTED";
networker 7:99068afea04d 320 case HCI_INSTANT_PASSED: return "HCI_INSTANT_PASSED";
networker 7:99068afea04d 321 case HCI_PAIRING_UNIT_KEY_NOT_SUPPORTED: return "HCI_PAIRING_UNIT_KEY_NOT_SUPPORTED";
networker 7:99068afea04d 322 };
networker 7:99068afea04d 323 return "Unknow HCI err";
networker 7:99068afea04d 324 };
networker 7:99068afea04d 325
networker 7:99068afea04d 326
networker 7:99068afea04d 327 #endif // HCI_PRIVATE_H_INCLUDED