AutoConnect

data class AutoConnect(val automaticallyRequestHighestValueLength: Boolean = true, val opportunistic: Boolean = false) : CentralManager.ConnectionOptions

Connection using Auto Connect feature.

The option to passively scan and finalize the connection when the remote device is in range and available. It does not allow to set a connection timeout and will not retry on failure.

In general, the first ever connection to a device should be direct and subsequent connections to known devices should be invoked with this option.

Parameters

automaticallyRequestHighestValueLength

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

opportunistic

Opportunistic connection is available from Android 17 onwards. An opportunistic GATT client does not hold a GATT connection. It automatically disconnects when no other GATT connections are active for the remote device.

Constructors

Link copied to clipboard
constructor(automaticallyRequestHighestValueLength: Boolean = true, opportunistic: Boolean = false)

Properties

Link copied to clipboard
open override val opportunistic: Boolean