Skip to content
com.iristick.smartglass.core

Class PocketUnit


public abstract class PocketUnit
extends Object
This class provides access to information about a connected pocket unit.

Most users will not need this class as the pocket unit is mostly transparent. Refer to the Headset class to do useful work with Iristick smart glasses.

Since:
1.1

Nested Class Summary

Modifier and Type Class and Description
static class  PocketUnit.BatteryCallback
Callback interface for battery events.

Constructor Summary

Constructor and Description
PocketUnit() 

Method Summary

Modifier and Type Method and Description
abstract float getBatteryLevel()
Get the battery level of this pocket unit.
abstract String getSerialNumber()
Get the serial number of this pocket unit.
abstract void registerBatteryCallback(PocketUnit.BatteryCallback callback, Handler handler)
Register a callback for battery events.
abstract void unregisterBatteryCallback(PocketUnit.BatteryCallback callback)
Unregister a callback for battery events.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

PocketUnit

public PocketUnit()

Method Detail

getSerialNumber

@CheckResult
 @NonNull
public abstract String getSerialNumber()
Get the serial number of this pocket unit.
Returns:
The serial number.
Since:
1.1

getBatteryLevel

@CheckResult
public abstract float getBatteryLevel()
Get the battery level of this pocket unit.
Returns:
The energy level left in the battery (between 0.0 and 100.0 inclusive), or -1 if the information is not available.
Since:
1.1

registerBatteryCallback

public abstract void registerBatteryCallback(@NonNull
                                             PocketUnit.BatteryCallback callback,
                                             @Nullable
                                             Handler handler)
Register a callback for battery events.
Parameters:
callback - Callback object to be called.
handler - The handler on which the callback methods should be invoked, or null to use the current thread's looper.
Since:
1.1

unregisterBatteryCallback

public abstract void unregisterBatteryCallback(@NonNull
                                               PocketUnit.BatteryCallback callback)
Unregister a callback for battery events.
Parameters:
callback - The callback object to unregister.
Since:
1.1