Enum GattStatus

java.lang.Object
java.lang.Enum<GattStatus>
com.codename1.bluetooth.gatt.GattStatus
All Implemented Interfaces:
Comparable<GattStatus>

public enum GattStatus extends Enum<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 Details

    • SUCCESS

      public static final GattStatus SUCCESS
      The operation completed successfully.
    • INVALID_HANDLE

      public static final GattStatus INVALID_HANDLE
      The attribute handle is invalid on this server.
    • READ_NOT_PERMITTED

      public static final GattStatus READ_NOT_PERMITTED
      The attribute cannot be read.
    • WRITE_NOT_PERMITTED

      public static final GattStatus WRITE_NOT_PERMITTED
      The attribute cannot be written.
    • INSUFFICIENT_AUTHENTICATION

      public static final GattStatus INSUFFICIENT_AUTHENTICATION
      The request requires authentication (bonding/pairing) first.
    • REQUEST_NOT_SUPPORTED

      public static final GattStatus REQUEST_NOT_SUPPORTED
      The server does not support the request.
    • INVALID_OFFSET

      public static final GattStatus INVALID_OFFSET
      The offset of a long read/write is past the end of the attribute.
    • INSUFFICIENT_ENCRYPTION

      public static final GattStatus INSUFFICIENT_ENCRYPTION
      The request requires an encrypted link.
    • INVALID_ATTRIBUTE_VALUE_LENGTH

      public static final GattStatus INVALID_ATTRIBUTE_VALUE_LENGTH
      The value length is invalid for this attribute.
    • UNLIKELY_ERROR

      public static final GattStatus UNLIKELY_ERROR
      Unlikely, unclassified error.
  • Method Details

    • values

      public static GattStatus[] 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

      public static GattStatus valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • 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.