public static class ConnectionSetup.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
ConnectionSetup |
build() |
ConnectionSetup.Builder |
setAutoConnect(boolean autoConnect)
Autoconnect concept may be misleading at first glance.
|
ConnectionSetup.Builder |
setOperationTimeout(Timeout operationTimeout) |
ConnectionSetup.Builder |
setSuppressIllegalOperationCheck(boolean suppressOperationCheck) |
public ConnectionSetup.Builder setAutoConnect(boolean autoConnect)
RxBleDevice#establishConnection(ConnectionSetup) call.autoConnect - Flag related to
BluetoothDevice.connectGatt(Context, boolean, BluetoothGattCallback) autoConnect
flag. In case of auto connect is enabled the observable will wait with the emission of RxBleConnection.
Without auto connect flag set to true the connection will fail
with BleGattException if the device is not in range after a
30 seconds timeout.public ConnectionSetup.Builder setSuppressIllegalOperationCheck(boolean suppressOperationCheck)
suppressOperationCheck - Flag describing the method of operation viability checking. If set to false,
a BleIllegalOperationException will be
emitted every time properties of the characteristic don't match those required by the operation.
If set to true, an event will be logged without interrupting the execution.public ConnectionSetup.Builder setOperationTimeout(Timeout operationTimeout)
operationTimeout - Timeout after which the operation will be considered as broken. Eventually the operation
will be canceled and removed from queue. Keep in mind that it will cancel the library's operation
only and may leave Android's BLE stack in an inconsistent state.public ConnectionSetup build()