public class ServiceHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static ej.bluetooth.BluetoothCharacteristic |
getCharacteristic(ej.bluetooth.BluetoothService service,
ej.bluetooth.BluetoothUuid characteristicUuid)
Returns the characteristic with the given UUID in the given service.
|
static ej.bluetooth.BluetoothDescriptor |
getDescriptor(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothUuid descriptorUuid)
Returns the descriptor with the given UUID in the given characteristic.
|
static void |
printService(ej.bluetooth.BluetoothService service,
java.io.PrintStream printStream)
Prints information on the given service to the given print stream.
|
public static ej.bluetooth.BluetoothCharacteristic getCharacteristic(ej.bluetooth.BluetoothService service,
ej.bluetooth.BluetoothUuid characteristicUuid)
throws AttributeNotFoundException
If multiple characteristics have the same UUID, any of them may be returned.
service - the service to search in.characteristicUuid - the UUID of the characteristic to look for.AttributeNotFoundException - if this service does not provide a characteristic with the given UUID.public static ej.bluetooth.BluetoothDescriptor getDescriptor(ej.bluetooth.BluetoothCharacteristic characteristic,
ej.bluetooth.BluetoothUuid descriptorUuid)
throws AttributeNotFoundException
If multiple descriptors have the same UUID, any of them may be returned.
characteristic - the characteristic to search in.descriptorUuid - the UUID of the descriptor to look for.AttributeNotFoundException - if this characteristic does not provide a descriptor with the given UUID.public static void printService(ej.bluetooth.BluetoothService service,
java.io.PrintStream printStream)
service - the service to inspect.printStream - the print stream to print to.