# OnDeviceStateChangeListener

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
open fun onBatteryStateChanged(sender: IDeviceCompat, newState: Int)

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

onConnected
Link copied to clipboard
abstract fun onConnected(sender: IDeviceCompat)

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

onDisconnected
Link copied to clipboard
abstract fun onDisconnected(sender: IDeviceCompat, status: DeviceStatus)

Called when the Nix device has disconnected from the host.

onExtPowerStateChanged
Link copied to clipboard
open fun onExtPowerStateChanged(sender: IDeviceCompat, newState: Boolean)

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