Class ConnectionOptions
java.lang.Object
com.codename1.bluetooth.le.ConnectionOptions
Options for
BlePeripheral.connect(ConnectionOptions). Fluent setters
return this for chaining.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe configured timeout in milliseconds;0means platform default.booleanThe configured auto-connect flag.setAutoConnect(boolean auto) Whentrue, asks the platform to reconnect automatically whenever the peripheral comes back into range (AndroidautoConnect; iOS re-issues the connect request, which never times out there).setTimeout(int millis) Fails the connection attempt withBluetoothError.TIMEOUTafter the given number of milliseconds.
-
Constructor Details
-
ConnectionOptions
public ConnectionOptions()
-
-
Method Details
-
setAutoConnect
Whentrue, asks the platform to reconnect automatically whenever the peripheral comes back into range (AndroidautoConnect; iOS re-issues the connect request, which never times out there). Defaults tofalse: a single direct connection attempt. -
setTimeout
Fails the connection attempt withBluetoothError.TIMEOUTafter 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;0means platform default.
-