public interface LocalServiceListener
LocalServiceListenerinterface provides callbacks related to local services.
This library provides a default implementation of this interface:
|Modifier and Type||Method and Description|
Called when a characteristic notification or indication is sent.
Called when a read request is received.
Called when a write request is received.
void onNotificationSent(BluetoothConnection connection, BluetoothCharacteristic characteristic, boolean success)
If a notification was sent, this method is called as soon as the notification is sent to the device. If an indication was sent, this method is called when the device acknowledges the indication.
connection- the connection with the device to which the notification was sent.
characteristic- the characteristic which has changed.
success- true if the notification was sent successfully, false otherwise.
BluetoothConnection.sendNotification(BluetoothCharacteristic, byte, boolean)
void onReadRequest(BluetoothConnection connection, BluetoothAttribute attribute)
connection- the connection with the device which has sent the request.
attribute- the attribute to read.