BleReconnectPolicy
class BleReconnectPolicy(maxFailures: Int = DEFAULT_MAX_FAILURES, failureThreshold: Int = DEFAULT_FAILURE_THRESHOLD, settleDelay: Duration = DEFAULT_SETTLE_DELAY, val minStableConnection: Duration = DEFAULT_MIN_STABLE_CONNECTION, backoffStrategy: (attempt: Int) -> Duration = ::computeReconnectBackoff)(source)
Encapsulates the BLE reconnection policy with exponential backoff.
The policy tracks consecutive failures and decides whether to retry or signal a transient disconnect (DeviceSleep). When maxFailures is reached the execute loop invokes execute's onPermanentDisconnect callback and returns; set maxFailures to Int.MAX_VALUE (as BleRadioTransport does) to disable the give-up path entirely.
Parameters
maxFailures
maximum consecutive failures before giving up; use Int.MAX_VALUE to retry indefinitely
failureThreshold
after this many consecutive failures, signal a transient disconnect
settleDelay
delay before each connection attempt to let the BLE stack settle
minStableConnection
minimum time a connection must stay up to be considered "stable"
backoffStrategy
computes the backoff delay for a given failure count