6

BleGattException - occured during first read write operation sometimes it read and write correctly but after reconnects ble device get this exception...

 if (bleManager.getMacAddress() != null && checkIsSameMac(peripheralModel.address) && bleManager.getConnectionSubscription() != null) {
        bleManager.getConnectionSubscription().flatMap(RxBleConnection::discoverServices)
                .observeOn(AndroidSchedulers.mainThread())
                .first() // Disconnect automatically after discovery
                .subscribe(swapScanResult -> {
                    Log.e("write and read", "discover success");
                    firstWriteCharacteristic(peripheralModel);
                }, this::onConnectionFailure);

0 Answers0