Class ConnectionOptions

java.lang.Object
com.codename1.bluetooth.le.ConnectionOptions

public class ConnectionOptions extends Object
Options for BlePeripheral.connect(ConnectionOptions). Fluent setters return this for chaining.
  • 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.