UsbRepository

@Singleton
class UsbRepository @Inject constructor(application: Application, dispatchers: CoroutineDispatchers, processLifecycle: Lifecycle, usbBroadcastReceiverLazy: Lazy<UsbBroadcastReceiver>, usbManagerLazy: Lazy<UsbManager?>, usbSerialProberLazy: Lazy<UsbSerialProber>) : Logging

Repository responsible for maintaining and updating the state of USB connectivity.

Constructors

Link copied to clipboard
@Inject
constructor(application: Application, dispatchers: CoroutineDispatchers, processLifecycle: Lifecycle, usbBroadcastReceiverLazy: Lazy<UsbBroadcastReceiver>, usbManagerLazy: Lazy<UsbManager?>, usbSerialProberLazy: Lazy<UsbSerialProber>)

Properties

Link copied to clipboard
val serialDevices: <Error class: unknown class>
Link copied to clipboard
val serialDevicesWithDrivers: <Error class: unknown class>
Link copied to clipboard
val serialDevicesWithPermission: <Error class: unknown class>

Functions

Link copied to clipboard
fun createSerialConnection(device: UsbSerialDriver, listener: SerialConnectionListener): SerialConnection

Creates a USB serial connection to the specified USB device. State changes and data arrival result in async callbacks on the supplied listener.

Link copied to clipboard
Link copied to clipboard
fun requestPermission(device: UsbDevice): Flow<Boolean>