public class BasicBluetoothServerService
extends ej.bluetooth.BluetoothService
implements ej.bluetooth.callbacks.ServerCallbacks
BluetoothService that can be notified and can forward read and write request to its characteritics.| Constructor and Description |
|---|
BasicBluetoothServerService(ej.bluetooth.BluetoothUuid uuid,
ej.bluetooth.BluetoothService.Type type)
instantiates a
BasicBluetoothServerService. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacteristic(BasicServerCharacteristic characteristic)
Add a characteristic that can received write and read request.
|
void |
onNotificationSent(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothDevice device,
boolean success) |
void |
onReadRequest(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothDevice device) |
void |
onReadRequest(ej.bluetooth.BluetoothDescriptor descriptor,
ej.bluetooth.BluetoothDevice device) |
void |
onWriteRequest(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothDevice device,
byte[] value) |
void |
onWriteRequest(ej.bluetooth.BluetoothDescriptor descriptor,
ej.bluetooth.BluetoothDevice device,
byte[] value) |
public BasicBluetoothServerService(ej.bluetooth.BluetoothUuid uuid,
ej.bluetooth.BluetoothService.Type type)
BasicBluetoothServerService.uuid - the uuid of the service.type - the type of service.public void addCharacteristic(BasicServerCharacteristic characteristic)
characteristic - the characteristic to add.public void onReadRequest(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothDevice device)
onReadRequest in interface ej.bluetooth.callbacks.ServerCallbackspublic void onWriteRequest(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothDevice device,
byte[] value)
onWriteRequest in interface ej.bluetooth.callbacks.ServerCallbackspublic void onNotificationSent(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothDevice device,
boolean success)
onNotificationSent in interface ej.bluetooth.callbacks.ServerCallbackspublic void onReadRequest(ej.bluetooth.BluetoothDescriptor descriptor,
ej.bluetooth.BluetoothDevice device)
onReadRequest in interface ej.bluetooth.callbacks.ServerCallbackspublic void onWriteRequest(ej.bluetooth.BluetoothDescriptor descriptor,
ej.bluetooth.BluetoothDevice device,
byte[] value)
onWriteRequest in interface ej.bluetooth.callbacks.ServerCallbacks