BleGattException - occurred during the read operation of the first read, sometimes it reads and writes correctly, but after reconnecting the device you will 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);
source share