Package ej.bluetooth.listeners
Interface RemoteServiceListener
-
- All Known Implementing Classes:
DefaultRemoteServiceListener
public interface RemoteServiceListenerTheRemoteServiceListenerinterface provides callbacks related to remote services.After
discovering the servicesof a device, the application mayset the remote listenerof a service in order to be notified of the events related to this service.This library provides a default implementation of this interface:
DefaultRemoteServiceListener.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonNotificationReceived(BluetoothConnection connection, BluetoothCharacteristic characteristic, byte[] value)Called when a characteristic notification or indication is received.voidonReadCompleted(BluetoothConnection connection, BluetoothAttribute attribute, byte status, byte[] value)Called when a response to a read request is received.voidonWriteCompleted(BluetoothConnection connection, BluetoothAttribute attribute, byte status)Called when a response to a write request is received.
-
-
-
Method Detail
-
onReadCompleted
void onReadCompleted(BluetoothConnection connection, BluetoothAttribute attribute, byte status, byte[] value)
Called when a response to a read request is received.- Parameters:
connection- the connection with the device which has sent the response.attribute- the attribute which was read.status- the response status (seeBluetoothStatus).value- the value of the attribute.- See Also:
BluetoothConnection.sendReadRequest(BluetoothAttribute)
-
onWriteCompleted
void onWriteCompleted(BluetoothConnection connection, BluetoothAttribute attribute, byte status)
Called when a response to a write request is received.- Parameters:
connection- the connection with the device which has sent the response.attribute- the attribute which was written.status- the response status (seeBluetoothStatus).- See Also:
BluetoothConnection.sendWriteRequest(BluetoothAttribute, byte[])
-
onNotificationReceived
void onNotificationReceived(BluetoothConnection connection, BluetoothCharacteristic characteristic, byte[] value)
Called when a characteristic notification or indication is received.- Parameters:
connection- the connection with the device which has sent the notification.characteristic- the characteristic which has changed.value- the value of the characteristic.
-
-