DeviceManager

interface DeviceManager

Device Manager can be used to discover bluetooth devices and to connect to a bluetooth or usb device.

Device Manager provides various information about the current connected device as well as ability to disconnect.

It is possible to get a list of all previously connected (paired) devices.

To obtain instance of the Device Manager use AdyenCardReaders.

val cardReadersInstance = AdyenCardReaders.getInstance(applicationContext)
val deviceManager = cardReadersInstance.deviceManager
deviceManager.connectionState.collect {
// Connected device state.
}

Properties

Link copied to clipboard
abstract val activeDeviceInfo: StateFlow<DeviceInfo>

Current connected device hardware information and battery state.

Link copied to clipboard
abstract val connectionState: StateFlow<ReaderConnectedState>

Connection state for the current connected device.

Link copied to clipboard
abstract val dockConnectionStatus: StateFlow<DockStatus>

Current connected dock status DockStatus.Attached is only emitted if refreshConnectionStateForAttachedDock is (periodically) called

Functions

Link copied to clipboard
abstract suspend fun connect(usbDevice: UsbDevice)

Connects to a USB card reader.

abstract suspend fun connect(cardReaderDevice: CardReaderDevice)

Connects to a card reader.

Link copied to clipboard
abstract suspend fun connectToDock(usbAccessory: UsbAccessory)

Connects to a USB Accessory (Dock).

Link copied to clipboard
abstract suspend fun disconnect()

Disconnects from the current connected device.

Link copied to clipboard
abstract suspend fun firmwareUpdateStatus(): Result<FirmwareUpdateStatus>

Returns information about updates available for the current connected device.

Link copied to clipboard
abstract suspend fun firmwareUpdateSummary(): Result<AvailableFirmwareUpdate?>

Returns information about updates available for the current connected device.

Link copied to clipboard
abstract suspend fun getKnownDevices(): List<CardReaderDevice>

List of previously connected devices.

Link copied to clipboard

Refreshes the connected and attached status of NYC1 Dock

Link copied to clipboard
abstract fun startBluetoothDiscovery(): Flow<Result<List<DiscoveredDevice>>>

Starts the discovery of compatible BTLE devices. Returns an error in case the discovery was not possible or scanning failed

Link copied to clipboard

Starts an update of the current connected reader's software

Link copied to clipboard
abstract suspend fun stopBluetoothDiscovery()

Stops the discovery of compatible BTLE devices.