BleCentralConfig

data class BleCentralConfig(val scanRestartTimeout: Duration? = 10.seconds, val maxScanFailureRetries: Int = 10, val scanFailureRetryDelay: Duration = 500.milliseconds, val postScanDelay: Duration = 150.milliseconds, val maxConnectRetries: Int = 10, val connectRetryDelay: Duration = 500.milliseconds, val maxDiscoverServicesRetries: Int = 10, val discoverServicesRetryDelay: Duration = 500.milliseconds, val requireL2capPeripheralConnectedFirst: Boolean = false, val l2capConnectTimeout: Duration? = 3.seconds, val maxL2capConnectRetries: Int = 10, val l2capRetryInitialDelay: Duration = 500.milliseconds, val l2capRetryMaxDelay: Duration = 4.seconds)

Timing, retry, and connection parameters for BLE Central operations when constructing a BLE MdocTransport via createBleMdocTransport.

Constructors

Link copied to clipboard
constructor(scanRestartTimeout: Duration? = 10.seconds, maxScanFailureRetries: Int = 10, scanFailureRetryDelay: Duration = 500.milliseconds, postScanDelay: Duration = 150.milliseconds, maxConnectRetries: Int = 10, connectRetryDelay: Duration = 500.milliseconds, maxDiscoverServicesRetries: Int = 10, discoverServicesRetryDelay: Duration = 500.milliseconds, requireL2capPeripheralConnectedFirst: Boolean = false, l2capConnectTimeout: Duration? = 3.seconds, maxL2capConnectRetries: Int = 10, l2capRetryInitialDelay: Duration = 500.milliseconds, l2capRetryMaxDelay: Duration = 4.seconds)

Properties

Link copied to clipboard

delay between BLE connection retry attempts.

Link copied to clipboard

delay between GATT retry attempts.

Link copied to clipboard

per-attempt timeout for opening an L2CAP channel, or null for no timeout.

Link copied to clipboard

initial backoff delay before the second L2CAP connection attempt.

Link copied to clipboard

maximum backoff delay between L2CAP connection retry attempts.

Link copied to clipboard

maximum number of additional BLE connection attempts after an initial failure.

Link copied to clipboard

maximum number of additional GATT discovery/read/CCCD-write attempts.

Link copied to clipboard

maximum number of attempts to open the L2CAP channel before failing.

Link copied to clipboard

maximum number of additional scan attempts after BleCentralHal.Callback.onScanFailed.

Link copied to clipboard

delay inserted after stopping a BLE scan before initiating a connection.

Link copied to clipboard

if true, establishes a peripheral-level BLE connection before calling BleCentralHal.connectL2cap when the L2CAP PSM is provided in engagement.

Link copied to clipboard

delay before restarting a BLE scan after BleCentralHal.Callback.onScanFailed.

Link copied to clipboard

if non-null, periodically stops and restarts BLE scanning after this duration while waiting for a peripheral, working around OS or controller scan stalls.