connect

abstract suspend fun connect(deviceId: String)

Connects to a specific Opticon BLE scanner using its deviceId.

Use this method to attempt a connection with the Opticon BLE scanner specified by the deviceId.

Parameters

deviceId

The identifier of the target scanner.

Throws

when the connection cannot be established.


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

Callback-based version of connect for Java interoperability.

Use this method to initiate a connection attempt. Callback.onSuccess is called only after the scanner is connected; Callback.onError is called when the connection cannot be established.

Parameters

deviceId

The identifier of the target scanner.

callback

The callback to receive success or error status.