public class ConnectionOptions

  1. Object
  2. ConnectionOptions
Options for BlePeripheral.connect(ConnectionOptions). Fluent setters return this for chaining.

Constructors

public ConnectionOptions()

Methods

public ConnectionOptions setAutoConnect(boolean auto)When true, asks the platform to reconnect automatically whenever the peripheral comes back into range (Android autoConnect; iOS re-issues the connect request, which never times out there).
public ConnectionOptions setTimeout(int millis)Fails the connection attempt with BluetoothError.TIMEOUT after the given number of milliseconds.
public boolean isAutoConnect()The configured auto-connect flag.
public int getTimeout()The configured timeout in milliseconds; 0 means platform default.

Inherited methods

Constructor details

ConnectionOptions

public ConnectionOptions()

Method details

setAutoConnect

public ConnectionOptions setAutoConnect(boolean auto)
When true, asks the platform to reconnect automatically whenever the peripheral comes back into range (Android autoConnect; iOS re-issues the connect request, which never times out there). Defaults to false: a single direct connection attempt.

setTimeout

public ConnectionOptions setTimeout(int millis)
Fails the connection attempt with BluetoothError.TIMEOUT after the given number of milliseconds. 0 (the default) uses the platform’s own timeout behavior – note that iOS connect requests never time out on their own.

isAutoConnect

public boolean isAutoConnect()
The configured auto-connect flag.

getTimeout

public int getTimeout()
The configured timeout in milliseconds; 0 means platform default.