Package ej.bluetooth
Class BluetoothCharacteristic
- java.lang.Object
-
- ej.bluetooth.BluetoothAttribute
-
- ej.bluetooth.BluetoothCharacteristic
-
public class BluetoothCharacteristic extends BluetoothAttribute
TheBluetoothCharacteristicclass represents a remote or a local GATT characteristic.Remote characteristics may be retrieved by
getting the characteristicsof a remote service.Local characteristics may be retrieved by
adding a local serviceto the adapter.This class provides methods to get the properties of the characteristic and to get its descriptors.
-
-
Constructor Summary
Constructors Constructor Description BluetoothCharacteristic()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BluetoothDescriptorgetDescriptor(int index)Returns the descriptor at the given index in this characteristic.intgetNumDescriptors()Returns the number of descriptors in this characteristic.bytegetProperties()Returns the properties of this characteristic.-
Methods inherited from class ej.bluetooth.BluetoothAttribute
getService, getUuid
-
-
-
-
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()).
-
-