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 Details

    • BluetoothGattService

      public BluetoothGattService(GattService1 _service, BluetoothDevice _device, String _dbusPath, org.freedesktop.dbus.connections.impl.DBusConnection _dbusConnection)
  • Method Details

    • getInterfaceClass

      protected Class<? extends org.freedesktop.dbus.interfaces.DBusInterface> getInterfaceClass()
      DBus-Interface class used in this wrapper object.
      Specified by:
      getInterfaceClass in class AbstractBluetoothObject
      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 if refreshGattCharacteristics() wasn't called before.
      Returns:
      List, maybe empty but never null
    • getGattCharacteristicByUuid

      public BluetoothGattCharacteristic getGattCharacteristicByUuid(String _uuid)
      Return the BluetoothGattCharacteristic 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 raw GattService1 object.
      Returns:
      GattService1, maybe null
    • getDevice

      public BluetoothDevice getDevice()
      Get the BluetoothDevice instance which is providing this BluetoothGattService.
      Returns:
      BluetoothDevice, maybe null
    • toString

      public String toString()
      Overrides:
      toString in class Object