test

Dependencies:   mbed KondoServoLibrary Encoder

Committer:
koheim
Date:
Thu Mar 12 07:32:03 2020 +0000
Revision:
21:0f12ee2322e4
Parent:
0:736c76a75def
a;

Who changed what in which revision?

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