Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxBleRadioImpl is getting stuck after resetting Bluetooth #81

Closed
kanat opened this issue Oct 14, 2016 · 15 comments
Closed

RxBleRadioImpl is getting stuck after resetting Bluetooth #81

kanat opened this issue Oct 14, 2016 · 15 comments
Assignees
Labels
bug Bug that is caused by the library

Comments

@kanat
Copy link

kanat commented Oct 14, 2016

RxBleRadioImpl is getting stuck after resetting Bluetooth


Need connected app

  1. connect
  2. switch off bluetooth
  3. switch on bluetooth
  4. connect

Actual result

nothing happens, No connection

Expected result

Connection established

I can't see FINISHED after disabling bluetooth and also it's trying to write after disconnection:
10-14 17:44:02.136 2072-2931/ru.starline.key D/RxBle#Radio: QUEUED RxBleRadioOperationDisconnect(945209293)
10-14 17:44:02.136 2072-2133/ru.starline.key D/RxBle#Radio: STARTED RxBleRadioOperationDisconnect(945209293)
10-14 17:44:02.156 2072-2931/ru.starline.key D/RxBle#Radio: QUEUED RxBleRadioOperationDescriptorWrite(411833235)
10-14 17:44:02.166 2072-2133/ru.starline.key D/RxBle#Radio: FINISHED RxBleRadioOperationDisconnect(945209293)
10-14 17:44:02.166 2072-2133/ru.starline.key D/RxBle#Radio: STARTED RxBleRadioOperationDescriptorWrite(411833235)
10-14 17:44:02.166 2072-2931/ru.starline.key D/RxBle#Radio: QUEUED RxBleRadioOperationDescriptorWrite(840731593)

@aldoborrero
Copy link

aldoborrero commented Oct 14, 2016

I've noticed the same exact input. The operations are queued even if you specified the operation with retryWhen() on the connection observable.

@dariuszseweryn dariuszseweryn added the bug Bug that is caused by the library label Oct 14, 2016
@dariuszseweryn dariuszseweryn self-assigned this Oct 14, 2016
@aldoborrero
Copy link

To have more insight on this particular issue. I'll copy here the steps I'm doing to reproduce it:

I have a class which is called BleDeviceManager:

  @Override public void connect(@NonNull final String address) {
      rxBleDevice = rxBleClient.getBleDevice(address);

      // Setup observation of connectivity changes
      connectionStateSubscription = rxBleDevice.observeConnectionStateChanges().observeOn(AndroidSchedulers.mainThread()).subscribe(this::onConnectionStateChanged);

      // Start properly the connection to the device
      connectionObservable = rxBleDevice.establishConnection(context, false)
          .takeUntil(disconnectionTrigger)
          .retryWhen(this::onShouldRetryConnectionOperation)
          .compose(new ConnectionSharingAdapter());

      // Subscribe to the observable
      connectionObservable.subscribe(this::onConnectionSuccess, this::onConnectionFailure);
  }

  private Observable<?> onShouldRetryConnectionOperation(Observable<? extends Throwable> observable) {
    return observable.delay(RECONNECTION_DELAY_TIME, TimeUnit.SECONDS).filter(throwable -> {
      if (throwable instanceof BleDisconnectedException) {
        return true;
      }

      if (throwable instanceof BleGattException) {
        BleGattException bleGattException = (BleGattException) throwable;

        switch (bleGattException.getStatus()) {
          case BLUEDROID_GATT_ERROR:
          case BLUEDROID_GATT_CONNECTION_TIMEOUT:
            return true;
        }
      }

      return false;
    });
  }

  private void onConnectionSuccess(RxBleConnection rxBleConnection) {
        deviceSubscription = connectionObservable.observeOn(Schedulers.computation())
            .flatMap(connection -> connection.discoverServices()
                .flatMap(services -> services.getService(SERVICE_ID).map(BluetoothGattService::getCharacteristics)), Pair::with)
            .flatMap(pair -> {
              final RxBleConnection connection = pair.getValue0();
              final List<BluetoothGattCharacteristic> characteristics = pair.getValue1();
              return readInitialValues(connection, characteristics).concatWith(setupNotifications(connection, characteristics));
            })
            .subscribe(ignored -> {
            }, throwable -> {
              logger.e(TAG, "Error: " + throwable);
            });
  }

  private Observable<Triplet<UUID, ValueAdapter<?>, byte[]>> readInitialValues(final RxBleConnection connection,
      final List<BluetoothGattCharacteristic> characteristics) {
    return Observable.from(characteristics)
        .filter(characteristic -> BleUtils.hasReadProperty(characteristic.getProperties()))
        .flatMap(connection::readCharacteristic, Pair::with)
        .observeOn(Schedulers2.singleThread())
        .compose(valueAdapterTransformer)
        .doOnNext(triplet -> {
              // Do things with the values received
        });
  }

  private Observable<Triplet<UUID, ValueAdapter<?>, byte[]>> setupNotifications(final RxBleConnection connection,
      final List<BluetoothGattCharacteristic> characteristics) {
    return Observable.from(characteristics)
        .filter(characteristic -> BleUtils.hasNotificationProperty(characteristic.getProperties()))
        .flatMap(characteristic -> connection.setupNotification(characteristic).flatMap(observable -> observable), Pair::with)
        .observeOn(Schedulers2.singleThread())
        .compose(valueAdapterTransformer)
        .doOnNext(triplet -> {
           // Do things with the values received
        });
  }

When I call the method connect() and the reading of the values characteristics starts (after the initial connection), then I switch off the Bluetooth toggle and reenable it:

This is the log I obtain:

10-17 09:13:55.844 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationConnect(79890976)
10-17 09:13:55.845 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationConnect(79890976)
10-17 09:13:55.850 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{DISCONNECTED}
10-17 09:13:55.850 26709-26709/com.test.bluetooth D/BleDeviceManager: Device has been disconnected!
10-17 09:13:55.851 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{CONNECTING}
10-17 09:13:55.854 26709-26709/com.test.bluetooth V/RxBle#BleConnectionCompat: Connecting without reflection
10-17 09:13:55.855 26709-26709/com.test.bluetooth D/BluetoothGatt: connect() - device: D8:7A:09:F1:66:8E, auto: false
10-17 09:13:55.856 26709-26709/com.test.bluetooth D/BluetoothGatt: registerApp()
10-17 09:13:55.856 26709-26709/com.test.bluetooth D/BluetoothGatt: registerApp() - UUID=ee5193fa-1f7f-4d19-a314-25d76602dfd4
10-17 09:13:55.858 26709-26722/com.test.bluetooth D/BluetoothGatt: onClientRegistered() - status=0 clientIf=7
10-17 09:14:05.858 26709-26709/com.test.bluetooth D/BleDeviceManager: Device timeout while connecting!
10-17 09:14:20.736 26709-26721/com.test.bluetooth D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=7 device=D8:7A:09:F1:66:8E
10-17 09:14:20.739 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onConnectionStateChange newState=0 status=133
10-17 09:14:20.745 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{DISCONNECTED}
10-17 09:14:20.745 26709-26709/com.test.bluetooth D/BleDeviceManager: Device has been disconnected!
10-17 09:14:20.749 26709-26721/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDisconnect(235196745)
10-17 09:14:20.756 26709-26721/com.test.bluetooth D/RxBle#RadioOperationConnect: No subscribers, finishing operation
10-17 09:14:20.758 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationConnect(79890976)
10-17 09:14:20.761 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDisconnect(235196745)
10-17 09:14:20.768 26709-26709/com.test.bluetooth D/BluetoothManager: getConnectionState()
10-17 09:14:20.770 26709-26709/com.test.bluetooth D/BluetoothManager: getConnectedDevices
10-17 09:14:20.782 26709-26709/com.test.bluetooth D/BluetoothGatt: close()
10-17 09:14:20.782 26709-26709/com.test.bluetooth D/BluetoothGatt: unregisterApp() - mClientIf=7
10-17 09:14:20.782 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDisconnect(235196745)
10-17 09:14:25.763 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{CONNECTING}
10-17 09:14:25.771 26709-27395/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationConnect(26606938)
10-17 09:14:25.773 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationConnect(26606938)
10-17 09:14:25.780 26709-26709/com.test.bluetooth V/RxBle#BleConnectionCompat: Connecting without reflection
10-17 09:14:25.783 26709-26709/com.test.bluetooth D/BluetoothGatt: connect() - device: D8:7A:09:F1:66:8E, auto: false
10-17 09:14:25.783 26709-26709/com.test.bluetooth D/BluetoothGatt: registerApp()
10-17 09:14:25.783 26709-26709/com.test.bluetooth D/BluetoothGatt: registerApp() - UUID=7806f3d8-d304-440e-ad1a-ebd3e5eaf70e
10-17 09:14:25.787 26709-26722/com.test.bluetooth D/BluetoothGatt: onClientRegistered() - status=0 clientIf=8
10-17 09:14:28.045 26709-26721/com.test.bluetooth D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=D8:7A:09:F1:66:8E
10-17 09:14:28.048 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onConnectionStateChange newState=2 status=0
10-17 09:14:28.062 26709-27498/com.test.bluetooth D/DeviceManager: onConnectionSuccess: Successfully connected! Reading initial values and subscribing to updates!
10-17 09:14:28.062 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{CONNECTED}
10-17 09:14:28.079 26709-27505/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationServicesDiscover(202528343)
10-17 09:14:28.079 26709-27498/com.test.bluetooth D/RxBle#RadioOperationConnect: No subscribers, finishing operation
10-17 09:14:28.081 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationConnect(26606938)
10-17 09:14:28.082 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationServicesDiscover(202528343)
10-17 09:14:28.084 26709-26709/com.test.bluetooth D/BluetoothGatt: discoverServices() - device: D8:7A:09:F1:66:8E
10-17 09:14:28.117 26709-26722/com.test.bluetooth D/BluetoothGatt: onSearchComplete() = Device=D8:7A:09:F1:66:8E Status=0
10-17 09:14:28.118 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onServicesDiscovered status=0
10-17 09:14:28.130 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(216178149)
10-17 09:14:28.133 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(78945131)
10-17 09:14:28.135 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(119812961)
10-17 09:14:28.137 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(234849095)
10-17 09:14:28.139 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(126854301)
10-17 09:14:28.141 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(203885795)
10-17 09:14:28.143 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(189197721)
10-17 09:14:28.145 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(196318271)
10-17 09:14:28.146 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(93309525)
10-17 09:14:28.148 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(257373531)
10-17 09:14:28.149 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(240105169)
10-17 09:14:28.151 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(147442743)
10-17 09:14:28.152 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(206040845)
10-17 09:14:28.153 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(56947923)
10-17 09:14:28.155 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(118583049)
10-17 09:14:28.156 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationServicesDiscover(202528343)
10-17 09:14:28.157 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(216178149)
10-17 09:14:28.474 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=11 Status=0
10-17 09:14:28.475 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0013-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:28.479 26709-27395/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@b47453c | Byte: [0]
10-17 09:14:28.480 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(216178149)
10-17 09:14:28.481 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(78945131)
10-17 09:14:28.654 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=14 Status=0
10-17 09:14:28.656 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0014-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:28.660 26709-27499/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@8e17928 | Byte: [4]
10-17 09:14:28.661 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(78945131)
10-17 09:14:28.662 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(119812961)
10-17 09:14:28.833 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=17 Status=0
10-17 09:14:28.834 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0015-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:28.838 26709-27518/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@f9fb57d | Byte: [3]
10-17 09:14:28.840 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(119812961)
10-17 09:14:28.840 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(234849095)
10-17 09:14:29.013 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=20 Status=0
10-17 09:14:29.015 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0016-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.017 26709-27395/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@460fdbe | Byte: [0]
10-17 09:14:29.018 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(234849095)
10-17 09:14:29.019 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(126854301)
10-17 09:14:29.104 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=23 Status=0
10-17 09:14:29.105 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0017-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.107 26709-27499/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@ea27d3b | Byte: [1]
10-17 09:14:29.109 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(126854301)
10-17 09:14:29.110 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(203885795)
10-17 09:14:29.193 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=26 Status=0
10-17 09:14:29.195 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0018-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.197 26709-27518/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@8b60604 | Byte: [0]
10-17 09:14:29.199 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(203885795)
10-17 09:14:29.200 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(189197721)
10-17 09:14:29.283 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=29 Status=0
10-17 09:14:29.284 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0019-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.287 26709-27395/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@38f7e70 | Byte: [0, 2, 6, 0, 0]
10-17 09:14:29.288 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(189197721)
10-17 09:14:29.289 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(196318271)
10-17 09:14:29.373 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=32 Status=0
10-17 09:14:29.374 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001a-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.376 26709-27499/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@946119c | Byte: [0, 0, 3, 0]
10-17 09:14:29.377 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(196318271)
10-17 09:14:29.378 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(93309525)
10-17 09:14:29.463 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=35 Status=0
10-17 09:14:29.464 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001b-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.466 26709-27518/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@870ab88 | Byte: [-40, 122, 9, -15, 102, -114]
10-17 09:14:29.468 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(93309525)
10-17 09:14:29.468 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(257373531)
10-17 09:14:29.553 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=38 Status=0
10-17 09:14:29.554 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001c-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.556 26709-27395/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@28f834 | Byte: [0, 0, 0, 30]
10-17 09:14:29.557 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(257373531)
10-17 09:14:29.558 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(240105169)
10-17 09:14:29.644 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=41 Status=0
10-17 09:14:29.645 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001d-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.647 26709-27499/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@1f05b59 | Byte: [0, 0, 0, 47]
10-17 09:14:29.648 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(240105169)
10-17 09:14:29.649 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(147442743)
10-17 09:14:29.733 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=44 Status=0
10-17 09:14:29.734 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001e-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.737 26709-27518/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@6c25415 | Byte: [0, 0, 0, 25]
10-17 09:14:29.738 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(147442743)
10-17 09:14:29.739 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(206040845)
10-17 09:14:29.823 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=47 Status=0
10-17 09:14:29.824 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001f-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.826 26709-27395/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@f811c91 | Byte: [0, 0, 0, 0]
10-17 09:14:29.828 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(206040845)
10-17 09:14:29.829 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(56947923)
10-17 09:14:29.913 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=50 Status=0
10-17 09:14:29.914 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0020-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:29.916 26709-27499/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@489f0cd | Byte: [0, 0, 0, 4]
10-17 09:14:29.918 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(56947923)
10-17 09:14:29.918 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(118583049)
10-17 09:14:30.003 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=53 Status=0
10-17 09:14:30.004 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0021-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:30.006 26709-27518/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@cd1ccc9 | Byte: [0, 0, 0, 1]
10-17 09:14:30.008 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(118583049)
10-17 09:14:30.009 26709-27520/com.test.bluetooth D/BleDeviceManager: Device has been connected!
10-17 09:14:30.009 26709-27520/com.test.bluetooth D/BleDeviceManager: Device is ready!
10-17 09:14:30.014 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0013-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.018 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(72080038)
10-17 09:14:30.019 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(72080038)
10-17 09:14:30.019 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0014-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.023 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(40532537)
10-17 09:14:30.026 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0015-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.031 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(71483018)
10-17 09:14:30.033 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0016-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.037 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(166907351)
10-17 09:14:30.038 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0017-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.042 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(127998768)
10-17 09:14:30.044 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0018-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.047 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(132354405)
10-17 09:14:30.049 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0019-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.052 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(122528774)
10-17 09:14:30.053 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001a-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.058 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(185752675)
10-17 09:14:30.059 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001b-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.064 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(105476748)
10-17 09:14:30.065 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001c-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.072 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(57557585)
10-17 09:14:30.074 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001d-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.078 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(25701442)
10-17 09:14:30.080 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001e-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.083 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(51491503)
10-17 09:14:30.085 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001f-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.088 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(137519784)
10-17 09:14:30.090 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0020-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.094 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.094 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(18045181)
10-17 09:14:30.096 26709-27520/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0021-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:30.099 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(72080038)
10-17 09:14:30.100 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(40532537)
10-17 09:14:30.101 26709-27520/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(161416522)
10-17 09:14:30.184 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.188 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(40532537)
10-17 09:14:30.189 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(71483018)
10-17 09:14:30.274 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.278 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(71483018)
10-17 09:14:30.278 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(166907351)
10-17 09:14:30.410 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.417 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(166907351)
10-17 09:14:30.418 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(127998768)
10-17 09:14:30.499 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.503 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(127998768)
10-17 09:14:30.504 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(132354405)
10-17 09:14:30.589 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.593 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(132354405)
10-17 09:14:30.593 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(122528774)
10-17 09:14:30.679 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.683 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(122528774)
10-17 09:14:30.683 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(185752675)
10-17 09:14:30.769 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.773 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(185752675)
10-17 09:14:30.774 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(105476748)
10-17 09:14:30.861 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.868 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(105476748)
10-17 09:14:30.868 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(57557585)
10-17 09:14:30.949 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:30.953 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(57557585)
10-17 09:14:30.953 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(25701442)
10-17 09:14:31.039 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:31.043 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(25701442)
10-17 09:14:31.044 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(51491503)
10-17 09:14:31.129 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:31.134 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(51491503)
10-17 09:14:31.136 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(137519784)
10-17 09:14:31.219 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:31.224 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(137519784)
10-17 09:14:31.225 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(18045181)
10-17 09:14:31.309 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:31.313 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(18045181)
10-17 09:14:31.314 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(161416522)
10-17 09:14:31.400 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:31.405 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(161416522)
10-17 09:14:39.829 26709-26721/com.test.bluetooth D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=D8:7A:09:F1:66:8E
10-17 09:14:39.829 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onConnectionStateChange newState=0 status=0
10-17 09:14:39.832 26709-27395/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDisconnect(199113332)
10-17 09:14:39.833 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{DISCONNECTED}
10-17 09:14:39.835 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDisconnect(199113332)
10-17 09:14:39.835 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0015-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.839 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(146058211)
10-17 09:14:39.840 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001a-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.843 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(16983193)
10-17 09:14:39.844 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001b-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.855 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(217850687)
10-17 09:14:39.857 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001f-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.859 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(5796181)
10-17 09:14:39.860 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0013-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.865 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(236565595)
10-17 09:14:39.865 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0019-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.867 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(175885777)
10-17 09:14:39.868 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001c-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.870 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(179649335)
10-17 09:14:39.871 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0020-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.873 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(77493773)
10-17 09:14:39.874 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0016-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.876 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(169366483)
10-17 09:14:39.876 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0017-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.878 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(197748233)
10-17 09:14:39.879 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001d-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.881 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(76175919)
10-17 09:14:39.882 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001e-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.883 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(177822149)
10-17 09:14:39.884 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0014-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.886 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(90991179)
10-17 09:14:39.886 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0018-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.888 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(247123265)
10-17 09:14:39.889 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0021-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:39.892 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(51732519)
10-17 09:14:39.892 26709-26709/com.test.bluetooth D/BleDeviceManager: Device has been disconnected!
10-17 09:14:39.893 26709-26709/com.test.bluetooth D/BluetoothManager: getConnectionState()
10-17 09:14:39.893 26709-26709/com.test.bluetooth D/BluetoothManager: getConnectedDevices
10-17 09:14:39.895 26709-26709/com.test.bluetooth D/BluetoothGatt: close()
10-17 09:14:39.895 26709-26709/com.test.bluetooth D/BluetoothGatt: unregisterApp() - mClientIf=8
10-17 09:14:39.895 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDisconnect(199113332)
10-17 09:14:39.896 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(146058211)
10-17 09:14:39.897 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(146058211)
10-17 09:14:39.899 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(16983193)
10-17 09:14:39.901 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(16983193)
10-17 09:14:39.902 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(217850687)
10-17 09:14:39.907 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(217850687)
10-17 09:14:39.908 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(5796181)
10-17 09:14:39.910 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(5796181)
10-17 09:14:39.911 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(236565595)
10-17 09:14:39.914 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(236565595)
10-17 09:14:39.914 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(175885777)
10-17 09:14:39.916 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(175885777)
10-17 09:14:39.916 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(179649335)
10-17 09:14:39.917 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(179649335)
10-17 09:14:39.917 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(77493773)
10-17 09:14:39.918 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(77493773)
10-17 09:14:39.919 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(169366483)
10-17 09:14:39.921 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(169366483)
10-17 09:14:39.921 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(197748233)
10-17 09:14:39.922 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(197748233)
10-17 09:14:39.922 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(76175919)
10-17 09:14:39.923 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(76175919)
10-17 09:14:39.924 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(177822149)
10-17 09:14:39.925 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(177822149)
10-17 09:14:39.926 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(90991179)
10-17 09:14:39.927 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(90991179)
10-17 09:14:39.928 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(247123265)
10-17 09:14:39.929 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(247123265)
10-17 09:14:39.930 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(51732519)
10-17 09:14:39.931 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(51732519)
10-17 09:14:44.836 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{CONNECTING}
10-17 09:14:44.840 26709-27395/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationConnect(51215156)
10-17 09:14:44.841 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationConnect(51215156)
10-17 09:14:44.843 26709-26709/com.test.bluetooth V/RxBle#BleConnectionCompat: Connecting without reflection
10-17 09:14:44.844 26709-26709/com.test.bluetooth D/BluetoothGatt: connect() - device: D8:7A:09:F1:66:8E, auto: false
10-17 09:14:44.844 26709-26709/com.test.bluetooth D/BluetoothGatt: registerApp()
10-17 09:14:44.844 26709-26709/com.test.bluetooth D/BluetoothGatt: registerApp() - UUID=79ebce34-d22a-4246-8cd2-dc24fcd0a0f6
10-17 09:14:44.847 26709-26721/com.test.bluetooth D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6
10-17 09:14:45.049 26709-26722/com.test.bluetooth D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=D8:7A:09:F1:66:8E
10-17 09:14:45.050 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onConnectionStateChange newState=2 status=0
10-17 09:14:45.054 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{CONNECTED}
10-17 09:14:45.054 26709-27499/com.test.bluetooth D/DeviceManager: onConnectionSuccess: Successfully connected! Reading initial values and subscribing to updates!
10-17 09:14:45.059 26709-27518/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationServicesDiscover(152348802)
10-17 09:14:45.061 26709-27499/com.test.bluetooth D/RxBle#RadioOperationConnect: No subscribers, finishing operation
10-17 09:14:45.062 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationConnect(51215156)
10-17 09:14:45.063 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationServicesDiscover(152348802)
10-17 09:14:45.064 26709-26709/com.test.bluetooth D/BluetoothGatt: discoverServices() - device: D8:7A:09:F1:66:8E
10-17 09:14:46.128 26709-26721/com.test.bluetooth D/BluetoothGatt: onSearchComplete() = Device=D8:7A:09:F1:66:8E Status=0
10-17 09:14:46.130 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onServicesDiscovered status=0
10-17 09:14:46.138 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(231392730)
10-17 09:14:46.141 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(251683048)
10-17 09:14:46.143 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(136275366)
10-17 09:14:46.146 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(183411604)
10-17 09:14:46.149 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(164378162)
10-17 09:14:46.152 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(14443776)
10-17 09:14:46.154 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(218334078)
10-17 09:14:46.156 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(153276716)
10-17 09:14:46.158 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(181426570)
10-17 09:14:46.160 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(109171736)
10-17 09:14:46.162 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(266503254)
10-17 09:14:46.164 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(97262020)
10-17 09:14:46.166 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(35295202)
10-17 09:14:46.169 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(206769712)
10-17 09:14:46.170 26709-27519/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationCharacteristicRead(47564846)
10-17 09:14:46.171 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationServicesDiscover(152348802)
10-17 09:14:46.172 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(231392730)
10-17 09:14:46.252 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=11 Status=0
10-17 09:14:46.254 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0013-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.256 26709-27498/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@5a27865 | Byte: [0]
10-17 09:14:46.257 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(231392730)
10-17 09:14:46.257 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(251683048)
10-17 09:14:46.343 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=14 Status=0
10-17 09:14:46.344 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0014-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.347 26709-27505/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@84735e1 | Byte: [4]
10-17 09:14:46.349 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(251683048)
10-17 09:14:46.350 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(136275366)
10-17 09:14:46.432 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=17 Status=0
10-17 09:14:46.433 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0015-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.435 26709-27519/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@8204f1d | Byte: [3]
10-17 09:14:46.438 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(136275366)
10-17 09:14:46.439 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(183411604)
10-17 09:14:46.522 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=20 Status=0
10-17 09:14:46.523 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0016-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.524 26709-27498/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@877c019 | Byte: [0]
10-17 09:14:46.525 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(183411604)
10-17 09:14:46.525 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(164378162)
10-17 09:14:46.612 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=23 Status=0
10-17 09:14:46.613 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0017-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.615 26709-27505/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@d3b44d5 | Byte: [1]
10-17 09:14:46.617 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(164378162)
10-17 09:14:46.618 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(14443776)
10-17 09:14:46.702 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=26 Status=0
10-17 09:14:46.704 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0018-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.706 26709-26714/com.test.bluetooth I/art: Do partial code cache collection, code=30KB, data=29KB
10-17 09:14:46.706 26709-27519/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@1785951 | Byte: [0]
10-17 09:14:46.707 26709-26714/com.test.bluetooth I/art: After code cache collection, code=24KB, data=25KB
10-17 09:14:46.707 26709-26714/com.test.bluetooth I/art: Increasing code cache capacity to 128KB
10-17 09:14:46.709 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(14443776)
10-17 09:14:46.709 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(218334078)
10-17 09:14:46.792 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=29 Status=0
10-17 09:14:46.793 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0019-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.796 26709-27498/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@998398d | Byte: [0, 2, 6, 0, 0]
10-17 09:14:46.797 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(218334078)
10-17 09:14:46.798 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(153276716)
10-17 09:14:46.883 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=32 Status=0
10-17 09:14:46.884 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001a-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.887 26709-27505/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@d5be189 | Byte: [0, 0, 3, 0]
10-17 09:14:46.889 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(153276716)
10-17 09:14:46.889 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(181426570)
10-17 09:14:46.972 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=35 Status=0
10-17 09:14:46.974 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001b-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:46.975 26709-27519/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@5980d45 | Byte: [-40, 122, 9, -15, 102, -114]
10-17 09:14:46.977 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(181426570)
10-17 09:14:46.977 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(109171736)
10-17 09:14:47.062 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=38 Status=0
10-17 09:14:47.063 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001c-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:47.064 26709-27498/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@6062866 | Byte: [0, 0, 0, 30]
10-17 09:14:47.065 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(109171736)
10-17 09:14:47.065 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(266503254)
10-17 09:14:47.152 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=41 Status=0
10-17 09:14:47.153 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001d-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:47.155 26709-27505/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@2a4e743 | Byte: [0, 0, 0, 47]
10-17 09:14:47.157 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(266503254)
10-17 09:14:47.158 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(97262020)
10-17 09:14:47.242 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=44 Status=0
10-17 09:14:47.243 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001e-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:47.245 26709-27519/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@22389ec | Byte: [0, 0, 0, 25]
10-17 09:14:47.246 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(97262020)
10-17 09:14:47.247 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(35295202)
10-17 09:14:47.332 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=47 Status=0
10-17 09:14:47.333 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a001f-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:47.335 26709-27498/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@58d431 | Byte: [0, 0, 0, 0]
10-17 09:14:47.335 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(35295202)
10-17 09:14:47.336 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(206769712)
10-17 09:14:47.422 26709-26722/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=50 Status=0
10-17 09:14:47.423 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0020-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:47.425 26709-27505/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@c53eea2 | Byte: [0, 0, 0, 4]
10-17 09:14:47.426 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(206769712)
10-17 09:14:47.427 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(47564846)
10-17 09:14:47.512 26709-26721/com.test.bluetooth W/BluetoothGatt: onCharacteristicRead() - Device=D8:7A:09:F1:66:8E handle=53 Status=0
10-17 09:14:47.513 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onCharacteristicRead characteristic=6e4a0021-a5a3-f393-e0a9-e50e24dcaa9a status=0
10-17 09:14:47.515 26709-27519/com.test.bluetooth D/DeviceManager: ReadInitialValue - Characteristic: android.bluetooth.BluetoothGattCharacteristic@2aa038f | Byte: [0, 0, 0, 1]
10-17 09:14:47.515 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(47564846)
10-17 09:14:47.516 26709-28030/com.test.bluetooth D/BleDeviceManager: Device has been connected!
10-17 09:14:47.516 26709-28030/com.test.bluetooth D/BleDeviceManager: Device is ready!
10-17 09:14:47.519 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0013-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.524 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(26531207)
10-17 09:14:47.525 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(26531207)
10-17 09:14:47.526 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0014-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.531 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(163795870)
10-17 09:14:47.532 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0015-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.535 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(18346907)
10-17 09:14:47.537 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0016-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.541 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(173947620)
10-17 09:14:47.542 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0017-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.545 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(202555209)
10-17 09:14:47.547 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0018-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.551 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(64467802)
10-17 09:14:47.552 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0019-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.555 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(203137895)
10-17 09:14:47.557 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001a-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.560 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(117210752)
10-17 09:14:47.564 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001b-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.568 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(166247285)
10-17 09:14:47.569 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001c-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.573 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(174926294)
10-17 09:14:47.574 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001d-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.577 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(252165875)
10-17 09:14:47.578 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001e-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.581 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(134901468)
10-17 09:14:47.582 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001f-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.585 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(61923681)
10-17 09:14:47.587 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0020-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.591 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(120886034)
10-17 09:14:47.592 26709-28030/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0021-a5a3-f393-e0a9-e50e24dcaa9a enable: true
10-17 09:14:47.595 26709-28030/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(48280127)
10-17 09:14:47.602 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:47.606 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(26531207)
10-17 09:14:47.607 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(163795870)
10-17 09:14:47.693 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:47.696 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(163795870)
10-17 09:14:47.697 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(18346907)
10-17 09:14:47.782 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:47.786 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(18346907)
10-17 09:14:47.786 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(173947620)
10-17 09:14:47.872 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:47.875 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(173947620)
10-17 09:14:47.876 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(202555209)
10-17 09:14:47.963 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:47.967 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(202555209)
10-17 09:14:47.969 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(64467802)
10-17 09:14:48.053 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.056 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(64467802)
10-17 09:14:48.057 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(203137895)
10-17 09:14:48.143 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.146 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(203137895)
10-17 09:14:48.146 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(117210752)
10-17 09:14:48.234 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.237 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(117210752)
10-17 09:14:48.238 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(166247285)
10-17 09:14:48.323 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.328 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(166247285)
10-17 09:14:48.329 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(174926294)
10-17 09:14:48.413 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.417 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(174926294)
10-17 09:14:48.418 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(252165875)
10-17 09:14:48.503 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.509 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(252165875)
10-17 09:14:48.510 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(134901468)
10-17 09:14:48.593 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.596 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(134901468)
10-17 09:14:48.597 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(61923681)
10-17 09:14:48.685 26709-26722/com.test.bluetooth D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
10-17 09:14:48.689 26709-26736/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(61923681)
10-17 09:14:48.690 26709-26736/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationDescriptorWrite(120886034)
10-17 09:14:48.777 26709-26721/com.test.bluetooth D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=D8:7A:09:F1:66:8E
10-17 09:14:48.777 26709-26721/com.test.bluetooth D/RxBle#BluetoothGatt: onConnectionStateChange newState=0 status=0
10-17 09:14:48.781 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{DISCONNECTED}
10-17 09:14:48.781 26709-27505/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDisconnect(147496175)
10-17 09:14:48.781 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001b-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.785 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(171417818)
10-17 09:14:48.785 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001f-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.788 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(157561832)
10-17 09:14:48.788 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0013-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.790 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(234811558)
10-17 09:14:48.792 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001c-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.797 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(54306452)
10-17 09:14:48.798 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0017-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.801 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(93942066)
10-17 09:14:48.802 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0014-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.804 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(59217920)
10-17 09:14:48.805 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0021-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.807 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(132738686)
10-17 09:14:48.808 26709-26709/com.test.bluetooth D/RxBle#Radio:  REMOVED RxBleRadioOperationDescriptorWrite(48280127)
10-17 09:14:48.808 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0016-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.817 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(114177068)
10-17 09:14:48.820 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001e-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.822 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(95024266)
10-17 09:14:48.822 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0020-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.824 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(117466904)
10-17 09:14:48.824 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001d-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.826 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(238735190)
10-17 09:14:48.826 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0019-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.828 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(186703044)
10-17 09:14:48.828 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a001a-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.830 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(86805218)
10-17 09:14:48.831 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0015-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.832 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(95486256)
10-17 09:14:48.833 26709-26709/com.test.bluetooth D/BluetoothGatt: setCharacteristicNotification() - uuid: 6e4a0018-a5a3-f393-e0a9-e50e24dcaa9a enable: false
10-17 09:14:48.834 26709-26709/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDescriptorWrite(76313390)
10-17 09:14:48.835 26709-26709/com.test.bluetooth D/BleDeviceManager: Device has been disconnected!
10-17 09:14:53.783 26709-26709/com.test.bluetooth D/DeviceManager: Connection state changed: RxBleConnectionState{CONNECTING}
10-17 09:14:53.787 26709-27395/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationConnect(6119269)

This is the current state of the RxBleRadio queue (entries in the queue ranging from 2 to 15 are descriptor writes):

screen shot 2016-10-17 at 09 21 38

Is there a way to clear the queue? Or maybe to add a timeout to the operations?

Thanks

@dariuszseweryn
Copy link
Owner

Hello. I was thinking about the problem. Actually it is not possible to cancel the current operation when it is executing because only establishing connection can be effectively cancelled.
I was always thinking that rxJava is supposed to be used in a single flow describing all actions (from establishing connection, discovering services if needed, performing read / writes / notifies, etc.) with a single .subscribe(). Then the subscriber would be always informed about any error that happens during the connection.
But like in this situation when a disconnection would happen when an operation is in the middle of execution it won't be notified about anything and will effectively be frozen without any chance to resume. This may be actually the cause of a different issue #76 .
I will definitely look into it as soon as possible.

@aldoborrero
Copy link

Hi @dariuszseweryn thanks for your comment!

Is there any possibility that we can have a "hacky" solution meanwhile? Even if is not the most elegant one?

(I would like to help you to sort this out).

@dariuszseweryn
Copy link
Owner

I am starting with writing tests for RxBleGattCallback. I didn't checked it yet though inserting

observeDisconnect(),

at line 256 of RxBleGattCallback could do the trick.

@aldoborrero
Copy link

Bad luck:

screen shot 2016-10-18 at 20 53 11

10-18 20:44:53.248 20817-20832/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(122289203)
10-18 20:44:53.249 20817-20832/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(20002153)
10-18 20:44:53.329 20817-20829/com.test.bluetooth D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=D8:7A:09:F1:66:8E
10-18 20:44:53.330 20817-20829/com.test.bluetooth D/RxBle#BluetoothGatt: onConnectionStateChange newState=0 status=0
10-18 20:44:53.333 20817-20817/com.test.bluetooth D/DeviceManager: Connection state changed: DISCONNECTED
10-18 20:44:53.333 20817-20916/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationDisconnect(237186712)
10-18 20:44:53.335 20817-20817/com.test.bluetooth D/RxBle#Radio:  REMOVED RxBleRadioOperationCharacteristicRead(43958053)
10-18 20:44:53.335 20817-20832/com.test.bluetooth D/RxBle#Radio: FINISHED RxBleRadioOperationCharacteristicRead(20002153)
10-18 20:44:53.335 20817-20832/com.test.bluetooth D/RxBle#Radio:  STARTED RxBleRadioOperationCharacteristicRead(90095275)
10-18 20:44:53.337 20817-20817/com.test.bluetooth D/RxBle#Radio:  REMOVED RxBleRadioOperationCharacteristicRead(161360015)
10-18 20:44:53.340 20817-20817/com.test.bluetooth D/RxBle#Radio:  REMOVED RxBleRadioOperationCharacteristicRead(84564003)
10-18 20:44:53.342 20817-20817/com.test.bluetooth D/RxBle#Radio:  REMOVED RxBleRadioOperationCharacteristicRead(77670561)
10-18 20:44:53.344 20817-20817/com.test.bluetooth D/RxBle#Radio:  REMOVED RxBleRadioOperationCharacteristicRead(71867015)
10-18 20:44:53.345 20817-20817/com.test.bluetooth D/RxBle#Radio:  REMOVED RxBleRadioOperationCharacteristicRead(168209885)
10-18 20:44:53.345 20817-20817/com.test.bluetooth D/BleDeviceManager: Device has been disconnected!
10-18 20:44:58.336 20817-20817/com.test.bluetooth D/DeviceManager: Connection state changed: CONNECTING
10-18 20:44:58.344 20817-20916/com.test.bluetooth D/RxBle#Radio:   QUEUED RxBleRadioOperationConnect(108345520)

@dariuszseweryn
Copy link
Owner

dariuszseweryn commented Oct 18, 2016

Another shot which theoretically should work:

    private <T> Observable<T> withHandlingStatusError(Observable<T> observable) {
        //noinspection unchecked
        return Observable.merge(
                statusErrorSubject.asObservable(), // statusErrorSubject emits only errors
                disconnectedErrorObservable,
                observable
        );
    }

where

    private final Observable disconnectedErrorObservable = connectionStatePublishSubject
            .filter(this::isDisconnectedOrDisconnecting)
            .doOnNext(rxBleConnectionState -> bluetoothGattBehaviorSubject.onCompleted())
            .cache()
            .flatMap(rxBleConnectionState -> Observable.error(new BleDisconnectedException()));

I have quickly designed two test cases:

    def ".observeDisconnect() should emit error when .onConnectionStateChange() receives DISCONNECTED state"() {

        given:
        objectUnderTest.observeDisconnect().subscribe(testSubscriber)

        when:
        objectUnderTest.getBluetoothGattCallback().onConnectionStateChange(null, 0, 0)

        then:
        testSubscriber.assertError(BleDisconnectedException)
    }

    def ".observeDisconnect() should emit error if .onConnectionStateChange() received DISCONNECTED state"() {
        given:
        objectUnderTest.getBluetoothGattCallback().onConnectionStateChange(null, 0, 0)

        when:
        objectUnderTest.observeDisconnect().subscribe(testSubscriber)

        then:
        testSubscriber.assertError(Throwable)
    }

The first one passes and the second one fails with a somewhat funny message:

java.lang.AssertionError: No errors (0 completions)

    at rx.observers.TestSubscriber.assertionError(TestSubscriber.java:663)
    at rx.observers.TestSubscriber.assertError(TestSubscriber.java:528)
    at com.polidea.rxandroidble.internal.connection.RxBleGattCallbackTest..observeDisconnect() should emit error if .onConnectionStateChange() received DISCONNECTED state(RxBleGattCallbackTest.groovy:80)
Caused by: com.polidea.rxandroidble.exceptions.BleDisconnectedException
    at com.polidea.rxandroidble.internal.connection.RxBleGattCallback.lambda$new$1(RxBleGattCallback.java:49)
    at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
    at rx.internal.operators.NotificationLite.accept(NotificationLite.java:152)
    at rx.internal.operators.CachedObservable$ReplayProducer.replay(CachedObservable.java:407)
    at rx.internal.operators.CachedObservable$CacheState.dispatch(CachedObservable.java:223)
    at rx.internal.operators.CachedObservable$CacheState.onNext(CachedObservable.java:194)
    at rx.internal.operators.CachedObservable$CacheState$1.onNext(CachedObservable.java:174)
    at rx.internal.operators.OperatorDoOnEach$1.onNext(OperatorDoOnEach.java:86)
    at rx.internal.operators.OnSubscribeFilter$FilterSubscriber.onNext(OnSubscribeFilter.java:76)
    at rx.subjects.SubjectSubscriptionManager$SubjectObserver.onNext(SubjectSubscriptionManager.java:225)
    at rx.subjects.PublishSubject.onNext(PublishSubject.java:113)
    at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39)
    at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
    at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:227)
    at rx.internal.schedulers.EventLoopsScheduler$EventLoopWorker$1.call(EventLoopsScheduler.java:172)
    at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

You can give it a shot - I do not have any Android device at the moment and can only test with unit tests.

@aldoborrero
Copy link

With this change, it looks very promising! For now, it does the reconnection properly!!!

I'll tell you if I detect something wrong, testing more :)

dariuszseweryn added a commit that referenced this issue Oct 20, 2016
…connection happened before or during execution. Added some tests in RxBleGattCallbackTest.

Summary:
( #81 )
(possibly also #76 )

Reviewers: michal.zielinski, pawel.urban

Reviewed By: pawel.urban

Differential Revision: https://phabricator.polidea.com/D1890
@dariuszseweryn
Copy link
Owner

The above commit should fix the issue for good. In case of anything wrong - feel free to reopen the issue. Best Regards.

@aldoborrero
Copy link

Thanks @dariuszseweryn for your great work! Worth mentioning how fast you solved this thing! :)

@dariuszseweryn
Copy link
Owner

dariuszseweryn commented Oct 21, 2016

Reopening the issue as the fix introduced a different bug and was reverted. A proper fix is ready though it will wait till Monday for a code review.

@aldoborrero
Copy link

Can you share the new changes on the code? Or is already commited? I can test it on my device @dariuszseweryn Thanks!! :)

dariuszseweryn added a commit that referenced this issue Oct 24, 2016
…connection happened before or during execution. Added some tests in RxBleGattCallbackTest.

Summary:
( #81 )
(possibly also #76 )

Reviewers: pawel.urban, michal.zielinski

Differential Revision: https://phabricator.polidea.com/D1901
@dariuszseweryn
Copy link
Owner

I have just pushed branch fix/issue_81 which you can checkout. It's waiting for a code review.

@aldoborrero
Copy link

For now, working fine with my real device! 👍

dariuszseweryn added a commit that referenced this issue Oct 25, 2016
…connection happened before or during execution. Added some tests in RxBleGattCallbackTest.

Summary:
( #81 )
(possibly also #76 )

Reviewers: michal.zielinski, pawel.urban

Reviewed By: pawel.urban

Differential Revision: https://phabricator.polidea.com/D1904
@dariuszseweryn
Copy link
Owner

Fix merged. Should be available in the SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is caused by the library
Projects
None yet
Development

No branches or pull requests

3 participants