public enum GattStatus

  1. Object
  2. Enum<GattStatus>
  3. GattStatus

ImplementsComparable<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 constants

SUCCESSThe operation completed successfully.
INVALID_HANDLEThe attribute handle is invalid on this server.
READ_NOT_PERMITTEDThe attribute cannot be read.
WRITE_NOT_PERMITTEDThe attribute cannot be written.
INSUFFICIENT_AUTHENTICATIONThe request requires authentication (bonding/pairing) first.
REQUEST_NOT_SUPPORTEDThe server does not support the request.
INVALID_OFFSETThe offset of a long read/write is past the end of the attribute.
INSUFFICIENT_ENCRYPTIONThe request requires an encrypted link.
INVALID_ATTRIBUTE_VALUE_LENGTHThe value length is invalid for this attribute.
UNLIKELY_ERRORUnlikely, unclassified error.

Methods

public static GattStatus[] values()
public static GattStatus valueOf(String name)
public int getAttCode()The raw ATT status code from the Bluetooth specification.
public static GattStatus fromAttCode(int code)Maps a raw ATT status code to its enum constant, falling back to UNLIKELY_ERROR for codes without a dedicated constant.

Inherited methods

Enum constant details

SUCCESS

SUCCESS
The operation completed successfully.

INVALID_HANDLE

INVALID_HANDLE
The attribute handle is invalid on this server.

READ_NOT_PERMITTED

READ_NOT_PERMITTED
The attribute cannot be read.

WRITE_NOT_PERMITTED

WRITE_NOT_PERMITTED
The attribute cannot be written.

INSUFFICIENT_AUTHENTICATION

INSUFFICIENT_AUTHENTICATION
The request requires authentication (bonding/pairing) first.

REQUEST_NOT_SUPPORTED

REQUEST_NOT_SUPPORTED
The server does not support the request.

INVALID_OFFSET

INVALID_OFFSET
The offset of a long read/write is past the end of the attribute.

INSUFFICIENT_ENCRYPTION

INSUFFICIENT_ENCRYPTION
The request requires an encrypted link.

INVALID_ATTRIBUTE_VALUE_LENGTH

INVALID_ATTRIBUTE_VALUE_LENGTH
The value length is invalid for this attribute.

UNLIKELY_ERROR

UNLIKELY_ERROR
Unlikely, unclassified error.

Method details

values

public static GattStatus[] values()

valueOf

public static GattStatus valueOf(String name)

getAttCode

public int getAttCode()
The raw ATT status code from the Bluetooth specification.

fromAttCode

public static GattStatus fromAttCode(int code)
Maps a raw ATT status code to its enum constant, falling back to UNLIKELY_ERROR for codes without a dedicated constant.