Jasonchenlijian / FastBle

Android Bluetooth Low Energy (BLE) Fast Development Framework. It uses simple ways to filter, scan, connect, read ,write, notify, readRssi, setMTU, and multiConnection.
Apache License 2.0
5.26k stars 1.22k forks source link

notify和write用的同一个UUID,使用框架的时候该怎么处理下面的错误? #536

Open sawyer-lee opened 2 years ago

sawyer-lee commented 2 years ago

日志信息: BluetoothGatt: onConnectionUpdated() - Device=99:99:99::: interval=40 latency=0 timeout=500 status=0 BluetoothGatt: writeCharacteristic() - uuid: 0000ffe1-0000-1000-8000-00805f9b34fb BluetoothGatt: onCharacteristicWrite() - Device=99:99:99::: handle=33 Status=0 BluetoothGatt: setCharacteristicNotification() - uuid: 0000ffe1-0000-1000-8000-00805f9b34fb enable: true BluetoothGatt: writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb BluetoothGatt: onDescriptorWrite() - Device=99:99:99::: handle=34 BluetoothGatt: onNotify() - Device=99:99:99::: handle=33

当我去Write的时候,是写不了的,因为上面已经onNotify了: BluetoothGatt: setCharacteristicNotification() - uuid: 0000ffe1-0000-1000-8000-00805f9b34fb enable: false BluetoothGatt: writeDescriptor() - uuid: 00002902-0000-1000-8000-00805f9b34fb

sawyer-lee commented 2 years ago

不能去写入,会报这样的错:onWriteFailure == gatt writeCharacteristic fail