# OnDeviceStateChangeListener

public interface OnDeviceStateChangeListener

Definition for a callback from an IDeviceCompat instance on a connection state change, battery state change, or external power state change.

## Functions

onBatteryStateChanged
Link copied to clipboard
public Unit onBatteryStateChanged(IDeviceCompat sender, Integer newState)

Called when the Nix device has updated its battery level measurement.

onConnected
Link copied to clipboard
public abstract Unit onConnected(IDeviceCompat sender)

Called when the Nix device has completed the connection process and is now idle.

onDisconnected
Link copied to clipboard
public abstract Unit onDisconnected(IDeviceCompat sender, DeviceStatus status)

Called when the Nix device has disconnected from the host.

onExtPowerStateChanged
Link copied to clipboard
public Unit onExtPowerStateChanged(IDeviceCompat sender, Boolean newState)

Called when the Nix device has been connected or disconnected from an external power source.