DeviceListEntry

sealed class DeviceListEntry

A sealed class is used here to represent the different types of devices that can be displayed in the list. This is more type-safe and idiomatic than using a base class with boolean flags (e.g., isBLE, isUSB). It allows for exhaustive when expressions in the code, making it more robust and readable.

Parameters

name

The display name of the device.

fullAddress

The unique address of the device, prefixed with a type identifier.

bonded

Indicates whether the device is bonded (for BLE) or has permission (for USB).

Inheritors

Types

Link copied to clipboard
data class Ble(val device: BluetoothDevice) : DeviceListEntry
Link copied to clipboard
data class Mock(val name: String) : DeviceListEntry
Link copied to clipboard
data class Tcp(val name: String, val fullAddress: String) : DeviceListEntry
Link copied to clipboard
data class Usb(radioInterfaceService: RadioInterfaceService, usbManager: UsbManager, val driver: UsbSerialDriver) : DeviceListEntry

Properties

Link copied to clipboard
Link copied to clipboard
open val bonded: Boolean
Link copied to clipboard
Link copied to clipboard
open val name: String

Functions

Link copied to clipboard
open override fun toString(): String