@ProviderType
public interface BluetoothLeGattCharacteristic
Modifier and Type | Method and Description |
---|---|
void |
disableValueNotifications()
Disables notifications of the value and unregisters the consumer object
passed through the corresponding enable method.
|
void |
enableValueNotifications(java.util.function.Consumer<byte[]> callback)
Enables notifications for the value and calls accept function of the Consumer
object.
|
BluetoothLeGattDescriptor |
findDescriptor(java.util.UUID uuid)
Find a BluetoothLeGattDescriptor specifying the UUID of the descriptor.
|
BluetoothLeGattDescriptor |
findDescriptor(java.util.UUID uuid,
long timeout)
Find a BluetoothLeGattDescriptor specifying the UUID of the descriptor and the timeout in seconds.
|
java.util.List<BluetoothLeGattDescriptor> |
findDescriptors()
Returns a list of BluetoothLeGattDescriptors available on this characteristic.
|
java.util.List<BluetoothLeGattCharacteristicProperties> |
getProperties()
Returns the list of BluetoothLeGattCharacteristicProperties this characteristic has.
|
BluetoothLeGattService |
getService()
Returns the service to which this characteristic belongs to.
|
java.util.UUID |
getUUID()
Get the UUID of this characteristic.
|
byte[] |
getValue()
Returns the cached value of this characteristic, if any.
|
boolean |
isNotifying()
Returns true if notification for changes of this characteristic are
activated.
|
byte[] |
readValue()
Reads the value of this characteristic.
|
void |
writeValue(byte[] value)
Writes the value of this characteristic.
|
BluetoothLeGattDescriptor findDescriptor(java.util.UUID uuid) throws KuraBluetoothResourceNotFoundException
uuid
- The UUID of the GATT descriptorKuraBluetoothResourceNotFoundException
BluetoothLeGattDescriptor findDescriptor(java.util.UUID uuid, long timeout) throws KuraBluetoothResourceNotFoundException
uuid
- The UUID of the GATT descriptortimeout
- The timeout for retrieving the characteristicKuraBluetoothResourceNotFoundException
java.util.List<BluetoothLeGattDescriptor> findDescriptors() throws KuraBluetoothResourceNotFoundException
KuraBluetoothResourceNotFoundException
byte[] readValue() throws KuraBluetoothIOException
KuraBluetoothIOException
void enableValueNotifications(java.util.function.Consumer<byte[]> callback) throws KuraBluetoothNotificationException
callback
- A ConsumerKuraBluetoothNotificationException
void disableValueNotifications() throws KuraBluetoothNotificationException
void writeValue(byte[] value) throws KuraBluetoothIOException
value
- The data as byte[] to be writtenKuraBluetoothIOException
java.util.UUID getUUID()
BluetoothLeGattService getService()
byte[] getValue()
boolean isNotifying()
java.util.List<BluetoothLeGattCharacteristicProperties> getProperties()