JvmUsbScanner

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Whether discovering a device this scanner hasn't already found requires an explicit, gesture-driven request action (e.g. Web Serial's requestPort() picker) rather than passive/ambient enumeration. false on every platform except web: JVM/Android can already enumerate every attached serial device without prompting.

Link copied to clipboard
open suspend fun requestNewDevice(showAll: Boolean = false): DeviceListEntry.Usb?

Triggers the platform's explicit device-request flow (a no-op where needsExplicitDeviceRequest is false) and returns the device picked, or null when none was. On web this shows the browser's serial-port picker, limited to known Meshtastic USB IDs unless showAll, so it must be called from a coroutine started directly inside a user-gesture event handler (e.g. a button's onClick) with no earlier suspension — the same "transient activation" constraint Web Bluetooth's device picker has.

Link copied to clipboard
open override fun scanUsbDevices(): Flow<List<DeviceListEntry.Usb>>