读取和写入操作时,Rxble发生129错误和133错误

时间:2017-02-04 06:49:27

标签: java android bluetooth-lowenergy rxandroidble

BleGattException - 在第一次读写操作期间发生,有时它会正确读写,但在重新连接ble设备后会出现此异常......

 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 个答案:

没有答案