Enum GattStatus
- All Implemented Interfaces:
Comparable<GattStatus>
ATT protocol status codes, used both to interpret remote GATT failures
and to respond to requests when acting as a GATT server.
getAttCode()
returns the raw code from the Bluetooth specification.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe request requires authentication (bonding/pairing) first.The request requires an encrypted link.The value length is invalid for this attribute.The attribute handle is invalid on this server.The offset of a long read/write is past the end of the attribute.The attribute cannot be read.The server does not support the request.The operation completed successfully.Unlikely, unclassified error.The attribute cannot be written. -
Method Summary
Modifier and TypeMethodDescriptionstatic GattStatusfromAttCode(int code) Maps a raw ATT status code to its enum constant, falling back toUNLIKELY_ERRORfor codes without a dedicated constant.intThe raw ATT status code from the Bluetooth specification.static GattStatusReturns the enum constant of this type with the specified name.static GattStatus[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
SUCCESS
The operation completed successfully. -
INVALID_HANDLE
The attribute handle is invalid on this server. -
READ_NOT_PERMITTED
The attribute cannot be read. -
WRITE_NOT_PERMITTED
The attribute cannot be written. -
INSUFFICIENT_AUTHENTICATION
The request requires authentication (bonding/pairing) first. -
REQUEST_NOT_SUPPORTED
The server does not support the request. -
INVALID_OFFSET
The offset of a long read/write is past the end of the attribute. -
INSUFFICIENT_ENCRYPTION
The request requires an encrypted link. -
INVALID_ATTRIBUTE_VALUE_LENGTH
The value length is invalid for this attribute. -
UNLIKELY_ERROR
Unlikely, unclassified error.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getAttCode
public int getAttCode()The raw ATT status code from the Bluetooth specification. -
fromAttCode
Maps a raw ATT status code to its enum constant, falling back toUNLIKELY_ERRORfor codes without a dedicated constant.
-