# Class GattLocalCharacteristic

java.lang.Object
com.codename1.bluetooth.le.server.GattLocalCharacteristic

public class GattLocalCharacteristic extends Object

A characteristic definition of a local `GattLocalService` served by this device's `GattServer`. Properties use the

invalid reference

    GattCharacteristic

`.PROPERTY_*` bits; access permissions use the

`PERMISSION_*` bits defined here.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `PERMISSION_READ`
  The characteristic may be read (bit `0x01`).
  `static final int`
  `PERMISSION_READ_ENCRYPTED`
  The characteristic may be read over an encrypted link only (bit `0x02`).
  `static final int`
  `PERMISSION_WRITE`
  The characteristic may be written (bit `0x10`).
  `static final int`
  `PERMISSION_WRITE_ENCRYPTED`
  The characteristic may be written over an encrypted link only (bit `0x20`).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GattLocalCharacteristic(BluetoothUuid uuid, int properties, int permissions)`
  Creates a characteristic definition.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `GattLocalCharacteristic`
  `addDescriptor(GattLocalDescriptor d)`
  Adds a descriptor definition.
  `List<GattLocalDescriptor>`
  `getDescriptors()`
  The descriptor definitions added via `addDescriptor(GattLocalDescriptor)`.
  `int`
  `getPermissions()`
  The `PERMISSION_*` bitmask.
  `int`
  `getProperties()`

  The

  invalid reference

      GattCharacteristic

  `.PROPERTY_*` bitmask.
  `BluetoothUuid`
  `getUuid()`
  The UUID identifying this characteristic.
  `byte[]`
  `getValue()`
  The static value, or `null` when reads are served via the `GattServerListener`.
  `GattLocalCharacteristic`
  `setValue(byte[] staticValue)`
  Serves a static value without routing read requests to the `GattServerListener`.
  `String`
  `toString()`
  Returns a string representation of the object.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### PERMISSION_READ

    public static final int PERMISSION_READ
    The characteristic may be read (bit `0x01`).
    See Also:
      - Constant Field Values

  - ### PERMISSION_READ_ENCRYPTED

    public static final int PERMISSION_READ_ENCRYPTED
    The characteristic may be read over an encrypted link only (bit `0x02`).
    See Also:
      - Constant Field Values

  - ### PERMISSION_WRITE

    public static final int PERMISSION_WRITE
    The characteristic may be written (bit `0x10`).
    See Also:
      - Constant Field Values

  - ### PERMISSION_WRITE_ENCRYPTED

    public static final int PERMISSION_WRITE_ENCRYPTED
    The characteristic may be written over an encrypted link only (bit `0x20`).
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### GattLocalCharacteristic

    public GattLocalCharacteristic(BluetoothUuid uuid, int properties, int permissions)

    Creates a characteristic definition. `properties` uses

    invalid reference

        GattCharacteristic

    `.PROPERTY_*` bits; `permissions` uses the

    `PERMISSION_*` bits of this class.

- ## Method Details

  - ### setValue

    public GattLocalCharacteristic setValue(byte[] staticValue)
    Serves a static value without routing read requests to the `GattServerListener`. Without a static value, every read arrives as a `GattReadRequest`.

  - ### addDescriptor

    public GattLocalCharacteristic addDescriptor(GattLocalDescriptor d)
    Adds a descriptor definition.

  - ### getUuid

    public BluetoothUuid getUuid()
    The UUID identifying this characteristic.

  - ### getProperties

    public int getProperties()

    The

    invalid reference

        GattCharacteristic

    `.PROPERTY_*` bitmask.

  - ### getPermissions

    public int getPermissions()
    The `PERMISSION_*` bitmask.

  - ### getValue

    public byte[] getValue()
    The static value, or `null` when reads are served via the `GattServerListener`.

  - ### getDescriptors

    public List<GattLocalDescriptor> getDescriptors()
    The descriptor definitions added via `addDescriptor(GattLocalDescriptor)`.

  - ### toString

    public String toString()
    Description copied from class: `Object`
    Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
    Overrides:
      `toString` in class `Object`