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 Summary
Constructors Constructor Description BluetoothBattery(Battery1 _battery, 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()
GetBluetoothDevice
object where thisBluetoothBattery
object belongs to.protected Class<? extends org.freedesktop.dbus.interfaces.DBusInterface>
getInterfaceClass()
DBus-Interface class used in this wrapper object.Byte
getPercentage()
From bluez Documentation:Battery1
getRawBattery()
Get the rawBattery1
object wrapped by thisBluetoothBattery
object.String
toString()
-
Methods inherited from class com.github.hypfvieh.bluetooth.wrapper.AbstractBluetoothObject
byteListToByteArray, getBluetoothType, getDbusConnection, getDbusPath, getRemoteObjects, getTyped, optionsToVariantMap, setTyped, toPrimitives
-
-
-
-
Constructor Detail
-
BluetoothBattery
public BluetoothBattery(Battery1 _battery, 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
-
getDevice
public BluetoothDevice getDevice()
GetBluetoothDevice
object where thisBluetoothBattery
object belongs to.- Returns:
- device
-
getRawBattery
public Battery1 getRawBattery()
Get the rawBattery1
object wrapped by thisBluetoothBattery
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
-
-