onDisconnect

abstract fun onDisconnect(isPermanent: Boolean, errorMessage: String? = null)(source)

Called when the transport has disconnected.

Parameters

isPermanent

true if the device is definitely gone (e.g. USB unplugged, max retries exhausted), false if it may come back (e.g. BLE range, TCP transient).

errorMessage

optional user-facing error message describing the disconnect reason.