BlackOneとAndroidの連携デモプログラム AndroidAccessoryを改造してBlackOneとAndroidが連携できるようにしました。 サポートしているのは、デモアプリの ”Buttons” B1-SW1, B2-SW2, B3-SW3 ”LED2” RGB-LED のみです。 LCDに表示するイメージをマイクロSDカードに入れてLCDのソケットに挿入しておく必要があります。 イメージは、320X240ドットで”\Image”という名前のフォルダの直下に”10.jpg”という名前で入れてください。

Dependencies:   TextLCD mbed

Committer:
techand
Date:
Fri Dec 23 04:33:33 2011 +0000
Revision:
0:7b556109fd46

        

Who changed what in which revision?

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