BluetoothManager

Interface for managing Bluetooth operations with Opticon BLE scanners.

This interface helps you handle tasks such as discovering devices, connecting and disconnecting, and listening to data streams from your Opticon BLE scanners.

Properties

Link copied to clipboard
abstract val isDiscovering: Boolean

Indicates whether the discovery process is currently active.

Functions

Link copied to clipboard
abstract suspend fun connect(deviceId: String)

Connects to a specific Opticon BLE scanner using its deviceId.

abstract fun connect(deviceId: String, callback: Callback<Unit>)

Callback-based version of connect for Java interoperability.

Link copied to clipboard
abstract fun disconnect(deviceId: String)

Disconnects from a specific Opticon BLE scanner using its deviceId.

Link copied to clipboard
abstract fun getLatestBatteryPercentage(deviceId: String): Int

Retrieves the latest battery percentage of a specific Opticon BLE scanner.

Link copied to clipboard

Retrieves the latest battery status of a specific Opticon BLE scanner.

Link copied to clipboard
abstract fun listenToBarcodeData(deviceId: String): Flow<BarcodeData>

Listens to the barcode data stream from a specific Opticon BLE scanner.

abstract fun listenToBarcodeData(deviceId: String, callback: Callback<BarcodeData>)

Callback-based version of listenToBarcodeData for Java interoperability.

Link copied to clipboard
abstract fun listenToBatteryPercentage(deviceId: String): Flow<Int>

Listens to the battery percentage of a specific Opticon BLE scanner.

abstract fun listenToBatteryPercentage(deviceId: String, callback: Callback<Int>)

Callback-based version of listenToBatteryPercentage for Java interoperability.

Link copied to clipboard
abstract fun listenToBatteryStatus(deviceId: String): Flow<BatteryLevelStatus>

Listens to the battery status of a specific Opticon BLE scanner.

abstract fun listenToBatteryStatus(deviceId: String, callback: Callback<BatteryLevelStatus>)

Callback-based version of listenToBatteryStatus for Java interoperability.

Link copied to clipboard

Listens to the connection state of a specific Opticon BLE scanner.

Callback-based version of listenToConnectionState for Java interoperability.

Link copied to clipboard

A flow of BleDiscoveredDevice representing Opticon BLE scanners discovered during scanning.

Callback-based version of listenToDiscoveredDevices for Java interoperability.

Link copied to clipboard
abstract fun startDiscovery()

Starts discovering Opticon BLE scanners nearby.

Link copied to clipboard
abstract fun stopDiscovery()

Stops discovering Opticon BLE scanners.