Functions

Link copied to clipboard
abstract fun deviceDetachFlow(): Flow<Unit>
Link copied to clipboard
abstract suspend fun ensureSerialPermission(waitMillis: Long): Boolean

Waits up to waitMillis for a serial device to be present and ensures the app holds USB permission for it, prompting the user when needed.

Link copied to clipboard
abstract suspend fun serialPortKeys(): Set<String>

Records which serial ports are present, so a port that appears after a UF2 write can be told apart from one that was already there.

Link copied to clipboard
abstract suspend fun unblockCdcPort(excluding: Set<String>, waitMillis: Long, holdMillis: Long): Boolean

Opens the port that appeared since excluding was captured and holds DTR asserted, so firmware waiting on a host will run.