Class BluetoothGattService
- java.lang.Object
-
- com.github.hypfvieh.bluetooth.wrapper.AbstractBluetoothObject
-
- com.github.hypfvieh.bluetooth.wrapper.BluetoothGattService
-
public class BluetoothGattService extends AbstractBluetoothObject
Wrapper class which represents a GATT service provided by a remote device.- Author:
- hypfvieh
-
-
Constructor Summary
Constructors Constructor Description BluetoothGattService(GattService1 _service, BluetoothDevice _device, String _dbusPath, org.freedesktop.dbus.connections.impl.DBusConnection _dbusConnection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BluetoothDevice
getDevice()
Get theBluetoothDevice
instance which is providing thisBluetoothGattService
.BluetoothGattCharacteristic
getGattCharacteristicByUuid(String _uuid)
Return theBluetoothGattCharacteristic
object for the given UUID.List<BluetoothGattCharacteristic>
getGattCharacteristics()
Get the currently available GATT characteristics.
Will issue a query ifrefreshGattCharacteristics()
wasn't called before.Object[]
getIncludes()
From bluez Documentation:protected Class<? extends org.freedesktop.dbus.interfaces.DBusInterface>
getInterfaceClass()
DBus-Interface class used in this wrapper object.GattService1
getService()
Get the rawGattService1
object.String
getUuid()
From bluez Documentation:Boolean
isPrimary()
From bluez Documentation:void
refreshGattCharacteristics()
Re-queries the GattCharacteristics from the device.String
toString()
-
Methods inherited from class com.github.hypfvieh.bluetooth.wrapper.AbstractBluetoothObject
byteListToByteArray, getBluetoothType, getDbusConnection, getDbusPath, getRemoteObjects, getTyped, optionsToVariantMap, setTyped, toPrimitives
-
-
-
-
Constructor Detail
-
BluetoothGattService
public BluetoothGattService(GattService1 _service, BluetoothDevice _device, String _dbusPath, org.freedesktop.dbus.connections.impl.DBusConnection _dbusConnection)
-
-
Method Detail
-
getInterfaceClass
protected Class<? extends org.freedesktop.dbus.interfaces.DBusInterface> getInterfaceClass()
DBus-Interface class used in this wrapper object.- Specified by:
getInterfaceClass
in classAbstractBluetoothObject
- Returns:
- class which implements the interface
-
refreshGattCharacteristics
public void refreshGattCharacteristics()
Re-queries the GattCharacteristics from the device.
-
getGattCharacteristics
public List<BluetoothGattCharacteristic> getGattCharacteristics()
Get the currently available GATT characteristics.
Will issue a query ifrefreshGattCharacteristics()
wasn't called before.- Returns:
- List, maybe empty but never null
-
getGattCharacteristicByUuid
public BluetoothGattCharacteristic getGattCharacteristicByUuid(String _uuid)
Return theBluetoothGattCharacteristic
object for the given UUID.- Parameters:
_uuid
- uuid- Returns:
- maybe null if not found
-
getUuid
public String getUuid()
From bluez Documentation:128-bit service UUID.
- Returns:
- uuid, maybe null
-
isPrimary
public Boolean isPrimary()
From bluez Documentation:Indicates whether or not this GATT service is a
primary service. If false, the service is secondary.- Returns:
- maybe null if feature is not supported
-
getIncludes
public Object[] getIncludes() throws BluezNotImplementedException
From bluez Documentation:Not implemented
Array of object paths representing the included
services of this service.- Returns:
- object array, maybe null
- Throws:
BluezNotImplementedException
- always - because currently not supported
-
getService
public GattService1 getService()
Get the rawGattService1
object.- Returns:
GattService1
, maybe null
-
getDevice
public BluetoothDevice getDevice()
Get theBluetoothDevice
instance which is providing thisBluetoothGattService
.- Returns:
BluetoothDevice
, maybe null
-
-