in rx-central-ble/src/main/java/com/uber/rxcentralble/core/CorePeripheral.java [221:241]
private void processConnect() {
if (connectionStateSubject == null) {
return;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
bluetoothGatt = device.connectGatt(context, false, getGattCallback());
} else {
bluetoothGatt =
device.connectGatt(context, false, getGattCallback(), BluetoothDevice.TRANSPORT_LE);
}
if (bluetoothGatt != null) {
connectionStateSubject.onNext(ConnectableState.CONNECTING);
} else {
connectionStateSubject.onError(
new ConnectionError(
ConnectionError.Code.CONNECT_FAILED,
new PeripheralError(CONNECTION_FAILED, ERROR_STATUS_CALL_FAILED)));
}
}