ORTP-L_WiiRemoteTest

Dependencies:   Motordriver mbed FatFileSystem

Fork of WallbotTypeN by Junichi Katsu

Committer:
passionvirus
Date:
Fri Mar 29 09:05:28 2013 +0000
Revision:
1:df4118878dc4
Parent:
0:425791fe4b42
init

Who changed what in which revision?

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