Class BluetoothBattery

java.lang.Object
com.github.hypfvieh.bluetooth.wrapper.AbstractBluetoothObject
com.github.hypfvieh.bluetooth.wrapper.BluetoothBattery

public class BluetoothBattery extends AbstractBluetoothObject
Wrapper class which represents the battery of a remote bluetooth device.
  • Constructor Details

    • BluetoothBattery

      public BluetoothBattery(Battery1 _battery, 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
    • getDevice

      public BluetoothDevice getDevice()
      Get BluetoothDevice object where this BluetoothBattery object belongs to.
      Returns:
      device
    • getRawBattery

      public Battery1 getRawBattery()
      Get the raw Battery1 object wrapped by this BluetoothBattery object.
      Returns:
      rawbattery
    • getPercentage

      public Byte getPercentage()
      From bluez Documentation:

      The percentage of battery left as an unsigned 8-bit integer.

      Returns:
      byte, maybe null
    • toString

      public String toString()
      Overrides:
      toString in class Object