Direct

data class Direct(val timeout: Duration = 10.seconds, val retry: Int = 2, val retryDelay: Duration = 300.milliseconds, val preferredPhy: List<Phy> = listOf(Phy.PHY_LE_1M), val automaticallyRequestHighestValueLength: Boolean = false) : CentralManager.ConnectionOptions

Connection options for direct connection.

Direct connection has a maximum timeout which depends on the device manufacturer and is usually 30 seconds or less. It may be shortened using the timeout parameter.

Constructors

Link copied to clipboard
constructor(timeout: Duration = 10.seconds, retry: Int = 3, retryDelay: Duration = 300.milliseconds, vararg preferredPhy: Phy, automaticallyRequestHighestMtu: Boolean = false)

Connection options for direct connection.

constructor(timeout: Duration = 10.seconds, retry: Int = 2, retryDelay: Duration = 300.milliseconds, preferredPhy: List<Phy> = listOf(Phy.PHY_LE_1M), automaticallyRequestHighestValueLength: Boolean = false)

Properties

Link copied to clipboard

If true, the manager will automatically request the highest MTU supported by the remote device immediately after establishing the connection.

Link copied to clipboard

Preferred PHY for connections to remote LE device. Note that this is just a recommendation, whether the PHY change will happen depends on other applications preferences, local and remote controller capabilities. Controller can override these settings.

Link copied to clipboard
val retry: Int = 2

The number of connection retries. Value N indicates N+1 connection attempts.

Link copied to clipboard

The delay between connection retries, defaults to 300 ms.

Link copied to clipboard

The connection timeout. 0 to default to system timeout. Default timeout is 10 seconds.