title: RxAndroidBle2 working differently in scanning and connecting across Android phone models
body: <p>First of all, thanks to Polidea for the excellent ReactiveX based library for Android BLE (RxAndroidBle2)! </p>
  
  <p>As I came across the library, I have replaced my BLE usage in my Android app completely with RxAndroidBle, and this took away a lot of problems I had with BLE and Java native BT API. My app is intended to connect to and to steer a BLE peripheral. Below I copy-pasted my usage of RxAndroidBle as an example from my Android Java code.</p>
  
  <p>Yet I do not completely understand why is RxAndroidBle working seamlessly and good with newer Android models, whereas it has problems with older Android models.</p>
  
  <p>The problem is that some older phones can indeed scan and find the device, but then can’t connect to the BT peripheral after finding the right device. Devices that have problems connecting are for example Huawei P8 Lite (Android 6.0) and Asus Zenfone Go ZB500KL (Android 6.0). The same code works wonderfully in new devices.</p>
  
  <p>So my questions:</p>
  
  <ol>
  <li><p>How do I know, in which phone models or Android versions the RxAndroidBle2 library 1.5.0 should work the same way as it works in >6.0 Android versions.</p></li>
  <li><p>Why is scanning working always in all Android devices >5.0, but connecting not in all Android devices &lt;= 6.0.</p></li>
  </ol>
  
  <p>Thanking in advance for any answers!</p>
  
  <p>Examples from my code:</p>
  
  <p>Scanning----</p>
  
  <pre><code>scanDisposable = rxBleClient.scanBleDevices(
        new ScanSettings.Builder()
              .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
              .setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES)
              .build(),
        new ScanFilter.Builder()
              .setServiceUuid(new ParcelUuid(Globals.uuid_my_service))
              .build()
  )
        .compose(bindUntilEvent(FragmentEvent.PAUSE))
        .observeOn(AndroidSchedulers.mainThread())
        .take(scanTimeMillis, TimeUnit.MILLISECONDS)
        .doFinally(this::dispose)
        .subscribe(this::addScanResult, this::onScanFailure);
  </code></pre>
  
  <p>Connecting----</p>
  
  <pre><code>connectionDisposable = bleDevice.establishConnection(false)
        .compose(bindUntilEvent(PAUSE))
        .flatMapSingle(connection -&gt;
              connection.discoverServices()
                    .flatMap(services -&gt; services.getService(Globals.uuid_my_service))
                    .map(service -&gt; service.getCharacteristic(Globals.uuid_program_characteristic))
                    .flatMap(characteristic -&gt; connection
                          .writeCharacteristic(characteristic, programData))
        )
        .doFinally(this::dispose)
        .subscribe(
              characteristic -&gt; {
                 Log.i(tag, characteristic.toString());
                 bluetoothResponses.msgToUserOnSuccess("\n" + "Success...");
                 atomicSuccess.set(true);
              },
              throwable -&gt; {
                 bluetoothResponses.onConnectionFailure(throwable);
              });
  </code></pre>