public interface ClientCallbacks
ClientCallbacks
interface provides callbacks related to GATT client events.
After discovering the services
of a device, the application may
set the client callbacks
of a service in order to be notified of the
events related to this service.
This library provides a default implementation of this interface: DefaultClientCallbacks
.
Modifier and Type | Method and Description |
---|---|
void |
onNotificationReceived(BluetoothCharacteristic characteristic,
byte[] value)
Called when a characteristic notification is received.
|
void |
onReadCompleted(BluetoothCharacteristic characteristic,
int status,
byte[] value)
Called when a response to a read characteristic request is received.
|
void |
onReadCompleted(BluetoothDescriptor descriptor,
int status,
byte[] value)
Called when a response to a read descriptor request is received.
|
void |
onWriteCompleted(BluetoothCharacteristic characteristic,
int status)
Called when a response to a write characteristic request is received.
|
void |
onWriteCompleted(BluetoothDescriptor descriptor,
int status)
Called when a response to a write descriptor request is received.
|
void onReadCompleted(BluetoothCharacteristic characteristic, int status, byte[] value)
characteristic
- the characteristic which was read.status
- the response status (see BluetoothStatus
).value
- the value of the characteristic.BluetoothAttribute.sendReadRequest()
void onWriteCompleted(BluetoothCharacteristic characteristic, int status)
characteristic
- the characteristic which was written.status
- the response status (see BluetoothStatus
).BluetoothAttribute.sendWriteRequest(byte[])
void onNotificationReceived(BluetoothCharacteristic characteristic, byte[] value)
characteristic
- the characteristic which has changed.value
- the value of the characteristic.void onReadCompleted(BluetoothDescriptor descriptor, int status, byte[] value)
descriptor
- the descriptor which was read.status
- the response status (see BluetoothStatus
).value
- the value of the descriptor.BluetoothAttribute.sendReadRequest()
void onWriteCompleted(BluetoothDescriptor descriptor, int status)
descriptor
- the descriptor which was written.status
- the response status (see BluetoothStatus
).BluetoothAttribute.sendWriteRequest(byte[])