143 public static HCIStatusCode get(
final String name)
throws IllegalArgumentException {
144 return valueOf(name);
154 public static HCIStatusCode get(
final byte value)
throws IllegalArgumentException {
156 case (
byte) 0x00:
return SUCCESS;
157 case (
byte) 0x01:
return UNKNOWN_COMMAND;
158 case (
byte) 0x02:
return UNKNOWN_CONNECTION_IDENTIFIER;
159 case (
byte) 0x03:
return HARDWARE_FAILURE;
160 case (
byte) 0x04:
return PAGE_TIMEOUT;
161 case (
byte) 0x05:
return AUTHENTICATION_FAILURE;
162 case (
byte) 0x06:
return PIN_OR_KEY_MISSING;
163 case (
byte) 0x07:
return MEMORY_CAPACITY_EXCEEDED;
164 case (
byte) 0x08:
return CONNECTION_TIMEOUT;
165 case (
byte) 0x09:
return CONNECTION_LIMIT_EXCEEDED;
166 case (
byte) 0x0a:
return SYNC_DEVICE_CONNECTION_LIMIT_EXCEEDED;
167 case (
byte) 0x0b:
return CONNECTION_ALREADY_EXISTS;
168 case (
byte) 0x0c:
return COMMAND_DISALLOWED;
169 case (
byte) 0x0d:
return CONNECTION_REJECTED_LIMITED_RESOURCES;
170 case (
byte) 0x0e:
return CONNECTION_REJECTED_SECURITY;
171 case (
byte) 0x0f:
return CONNECTION_REJECTED_UNACCEPTABLE_BD_ADDR;
172 case (
byte) 0x10:
return CONNECTION_ACCEPT_TIMEOUT_EXCEEDED;
173 case (
byte) 0x11:
return UNSUPPORTED_FEATURE_OR_PARAM_VALUE;
174 case (
byte) 0x12:
return INVALID_HCI_COMMAND_PARAMETERS;
175 case (
byte) 0x13:
return REMOTE_USER_TERMINATED_CONNECTION;
176 case (
byte) 0x14:
return REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES;
177 case (
byte) 0x15:
return REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF;
178 case (
byte) 0x16:
return CONNECTION_TERMINATED_BY_LOCAL_HOST;
179 case (
byte) 0x17:
return REPEATED_ATTEMPTS;
180 case (
byte) 0x18:
return PAIRING_NOT_ALLOWED;
181 case (
byte) 0x19:
return UNKNOWN_LMP_PDU;
182 case (
byte) 0x1a:
return UNSUPPORTED_REMOTE_OR_LMP_FEATURE;
183 case (
byte) 0x1b:
return SCO_OFFSET_REJECTED;
184 case (
byte) 0x1c:
return SCO_INTERVAL_REJECTED;
185 case (
byte) 0x1d:
return SCO_AIR_MODE_REJECTED;
186 case (
byte) 0x1e:
return INVALID_LMP_OR_LL_PARAMETERS;
187 case (
byte) 0x1f:
return UNSPECIFIED_ERROR;
188 case (
byte) 0x20:
return UNSUPPORTED_LMP_OR_LL_PARAMETER_VALUE;
189 case (
byte) 0x21:
return ROLE_CHANGE_NOT_ALLOWED;
190 case (
byte) 0x22:
return LMP_OR_LL_RESPONSE_TIMEOUT;
191 case (
byte) 0x23:
return LMP_OR_LL_COLLISION;
192 case (
byte) 0x24:
return LMP_PDU_NOT_ALLOWED;
193 case (
byte) 0x25:
return ENCRYPTION_MODE_NOT_ACCEPTED;
194 case (
byte) 0x26:
return LINK_KEY_CANNOT_BE_CHANGED;
195 case (
byte) 0x27:
return REQUESTED_QOS_NOT_SUPPORTED;
196 case (
byte) 0x28:
return INSTANT_PASSED;
197 case (
byte) 0x29:
return PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED;
198 case (
byte) 0x2a:
return DIFFERENT_TRANSACTION_COLLISION;
199 case (
byte) 0x2c:
return QOS_UNACCEPTABLE_PARAMETER;
200 case (
byte) 0x2d:
return QOS_REJECTED;
201 case (
byte) 0x2e:
return CHANNEL_ASSESSMENT_NOT_SUPPORTED;
202 case (
byte) 0x2f:
return INSUFFICIENT_SECURITY;
203 case (
byte) 0x30:
return PARAMETER_OUT_OF_RANGE;
204 case (
byte) 0x32:
return ROLE_SWITCH_PENDING;
205 case (
byte) 0x34:
return RESERVED_SLOT_VIOLATION;
206 case (
byte) 0x35:
return ROLE_SWITCH_FAILED;
207 case (
byte) 0x36:
return EIR_TOO_LARGE;
208 case (
byte) 0x37:
return SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST;
209 case (
byte) 0x38:
return HOST_BUSY_PAIRING;
210 case (
byte) 0x39:
return CONNECTION_REJECTED_NO_SUITABLE_CHANNEL;
211 case (
byte) 0x3a:
return CONTROLLER_BUSY;
212 case (
byte) 0x3b:
return UNACCEPTABLE_CONNECTION_PARAM;
213 case (
byte) 0x3c:
return ADVERTISING_TIMEOUT;
214 case (
byte) 0x3d:
return CONNECTION_TERMINATED_MIC_FAILURE;
215 case (
byte) 0x3e:
return CONNECTION_EST_FAILED_OR_SYNC_TIMEOUT;
216 case (
byte) 0x3f:
return MAX_CONNECTION_FAILED;
217 case (
byte) 0x40:
return COARSE_CLOCK_ADJ_REJECTED;
218 case (
byte) 0x41:
return TYPE0_SUBMAP_NOT_DEFINED;
219 case (
byte) 0x42:
return UNKNOWN_ADVERTISING_IDENTIFIER;
220 case (
byte) 0x43:
return LIMIT_REACHED;
221 case (
byte) 0x44:
return OPERATION_CANCELLED_BY_HOST;
222 case (
byte) 0x45:
return PACKET_TOO_LONG;
224 case (
byte) 0xc3:
return FAILED;
225 case (
byte) 0xc4:
return CONNECT_FAILED;
226 case (
byte) 0xc5:
return AUTH_FAILED;
227 case (
byte) 0xc6:
return NOT_PAIRED;
228 case (
byte) 0xc7:
return NO_RESOURCES;
229 case (
byte) 0xc8:
return TIMEOUT;
230 case (
byte) 0xc9:
return ALREADY_CONNECTED;
231 case (
byte) 0xca:
return BUSY;
232 case (
byte) 0xcb:
return REJECTED;
233 case (
byte) 0xcc:
return NOT_SUPPORTED;
234 case (
byte) 0xcd:
return INVALID_PARAMS;
235 case (
byte) 0xce:
return DISCONNECTED;
236 case (
byte) 0xcf:
return NOT_POWERED;
237 case (
byte) 0xd0:
return CANCELLED;
238 case (
byte) 0xd1:
return INVALID_INDEX;
239 case (
byte) 0xd2:
return RFKILLED;
240 case (
byte) 0xd3:
return ALREADY_PAIRED;
241 case (
byte) 0xd4:
return PERMISSION_DENIED;
243 case (
byte) 0xfd:
return INTERNAL_TIMEOUT;
244 case (
byte) 0xfe:
return INTERNAL_FAILURE;
245 case (
byte) 0xff:
return UNKNOWN;
247 throw new IllegalArgumentException(
"Unsupported value "+value);
BT Core Spec v5.2: Vol 1, Part F Controller Error Codes: 1.3 List of Error Codes.
REMOTE_USER_TERMINATED_CONNECTION
UNACCEPTABLE_CONNECTION_PARAM
DIFFERENT_TRANSACTION_COLLISION
CONNECTION_REJECTED_UNACCEPTABLE_BD_ADDR
LINK_KEY_CANNOT_BE_CHANGED
UNSUPPORTED_LMP_OR_LL_PARAMETER_VALUE
CONNECTION_LIMIT_EXCEEDED
SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST
REMOTE_DEVICE_TERMINATED_CONNECTION_POWER_OFF
INVALID_HCI_COMMAND_PARAMETERS
ENCRYPTION_MODE_NOT_ACCEPTED
REQUESTED_QOS_NOT_SUPPORTED
INVALID_LMP_OR_LL_PARAMETERS
CHANNEL_ASSESSMENT_NOT_SUPPORTED
OPERATION_CANCELLED_BY_HOST
UNKNOWN_CONNECTION_IDENTIFIER
CONNECTION_TERMINATED_BY_LOCAL_HOST
CONNECTION_TERMINATED_MIC_FAILURE
QOS_UNACCEPTABLE_PARAMETER
CONNECTION_ACCEPT_TIMEOUT_EXCEEDED
REMOTE_DEVICE_TERMINATED_CONNECTION_LOW_RESOURCES
UNSUPPORTED_FEATURE_OR_PARAM_VALUE
LMP_OR_LL_RESPONSE_TIMEOUT
UNSUPPORTED_REMOTE_OR_LMP_FEATURE
CONNECTION_REJECTED_NO_SUITABLE_CHANNEL
CONNECTION_EST_FAILED_OR_SYNC_TIMEOUT
SYNC_DEVICE_CONNECTION_LIMIT_EXCEEDED
HCIStatusCode(final byte v)
CONNECTION_REJECTED_SECURITY
PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED
CONNECTION_ALREADY_EXISTS
CONNECTION_REJECTED_LIMITED_RESOURCES
UNKNOWN_ADVERTISING_IDENTIFIER
COARSE_CLOCK_ADJ_REJECTED