Package ej.bluetooth

Class BluetoothCharacteristic


  • public class BluetoothCharacteristic
    extends BluetoothAttribute
    The BluetoothCharacteristic class represents a remote or a local GATT characteristic.

    Remote characteristics may be retrieved by getting the characteristics of a remote service.

    Local characteristics may be retrieved by adding a local service to the adapter.

    This class provides methods to get the properties of the characteristic and to get its descriptors.

    • Constructor Detail

      • BluetoothCharacteristic

        public BluetoothCharacteristic()
    • Method Detail

      • getProperties

        public byte getProperties()
        Returns the properties of this characteristic.
        Returns:
        the properties of this characteristic (see BluetoothProperties).
      • getNumDescriptors

        public int getNumDescriptors()
        Returns the number of descriptors in this characteristic.
        Returns:
        the number of descriptors in this characteristic.
      • getDescriptor

        public BluetoothDescriptor getDescriptor​(int index)
        Returns the descriptor at the given index in this characteristic.
        Parameters:
        index - the index of the descriptor.
        Returns:
        the descriptor at the given index.
        Throws:
        IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getNumDescriptors()).