BLEProxy

class BLEProxy(messageStreamManager: IOSMessageStreamManager?, val blueLink: BlueLink, networkConnectivityMonitor: NetworkConnectivityMonitor, persistenceManager: PersistenceManager, iOSTrueTimeManager: ITrueTimeManager?) : ConnectivityListener

Constructors

Link copied to clipboard
constructor(messageStreamManager: IOSMessageStreamManager?, blueLink: BlueLink, networkConnectivityMonitor: NetworkConnectivityMonitor, persistenceManager: PersistenceManager, iOSTrueTimeManager: ITrueTimeManager?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val coroutineScope: CoroutineScope
Link copied to clipboard
val networkAvailable: StateFlow<Boolean?>
Link copied to clipboard
var proxyPaused: MutableStateFlow<Boolean>
Link copied to clipboard
val storageError: StateFlow<StorageError?>

Functions

Link copied to clipboard
Link copied to clipboard
suspend fun deliverInstallOOBAndWaitForMode(deviceId: UInt, dfuRequired: Boolean, timeoutMs: Long): InstallOOBResult

Waits for the device to enter install mode (or DFU mode if dfuRequired). When dfuRequired is true and device enters DFU mode, DFU is initiated.

Link copied to clipboard
open override fun didChangeConnectivity(isConnected: Boolean)
Link copied to clipboard
Link copied to clipboard
suspend fun getDevicesOnStream(): List<UInt>
Link copied to clipboard
suspend fun identifyDevice(deviceId: UInt, payload: ByteArray): Boolean

Sends an identify command to the device. If device is in DFU mode, uses SMP group 64 via DFUService. Otherwise, uses OOB characteristic via proxy.

Link copied to clipboard
suspend fun isStreamAlive(): Boolean
Link copied to clipboard
Link copied to clipboard
fun sendOOBToDevice(deviceId: UInt, payload: ByteArray)

Allows implementors to write payloads to the OOB Characteristic bypassing Link Note: This feature is to be used with utmost care as wrong / malformed operations could negatively impact the device

Link copied to clipboard
suspend fun setLockEngagedState(deviceId: UInt, payload: ByteArray): Boolean

Sends a lock engaged state command to the device. If device is in DFU mode, uses SMP group 64 via DFUService. Otherwise, uses OOB characteristic via proxy.

Link copied to clipboard
fun setProxyPaused(isPaused: Boolean)
Link copied to clipboard
fun shutdown()
Link copied to clipboard
Link copied to clipboard
suspend fun waitForInstallModeExit(deviceId: UInt, timeoutMs: Long = DEFAULT_EXIT_MODE_TIMEOUT_MS): InstallOOBResult

Waits for device to exit install mode by polling the device's install mode status.

Link copied to clipboard
fun watchStorageError(block: (StorageError?) -> Unit): Closeable

Calls Swift with current and future storage failures until the returned watcher is closed.