DeviceScanner

Class responsible for discovering nearby Nix devices.

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Util

Properties

Link copied to clipboard

Current state of the IDeviceScanner.

Functions

Link copied to clipboard
open override fun listUsbDevices(): List<IDeviceCompat>

List USB attached IDeviceCompat instances without running a Bluetooth search.

Link copied to clipboard
open suspend override fun scanForHardwareId(id: String, scanPeriodMs: Long): IDeviceCompat?

Starts a search for a specific Nix device using Bluetooth. The search will run until the specified device is found, or until a timeout elapses, whichever is shorter.

Link copied to clipboard

Starts a search for nearby Nix devices using Bluetooth for a selected time interval. If no timeout interval is specified, the search will run for DEFAULT_GENERAL_SCAN_PERIOD_MS.

Link copied to clipboard

Starts a search for a specific Nix device using Bluetooth. The search will run until the specified device is found, or until a timeout elapses, whichever is shorter. This search can alternatively be achieved without a callback by calling the coroutine function scanForHardwareId.

Link copied to clipboard
open override fun stop()

Stops a Bluetooth search if one is currently running.