我在我的安卓应用程序中使用BluetoothGatt.requestMtu(512)
。第一次使用时它可以正常工作,但之后MTU自动更改为23(默认值)。
我不知道问题出在哪里...
这是一个日志:
`D/BluetoothGatt: setCharacteristicNotification() - uuid: 0000fff1-0000-1000-8000-00805f9b34fb enable: true
D/BluetoothGatt: configureMTU() - device: 74:F0:7D:C0:CB:68 mtu: 512
D/BluetoothGatt: onConfigureMTU() - Device=74:F0:7D:C0:CB:68 mtu=23 status=0
D/BluetoothGatt: discoverServices() - device: 74:F0:7D:C0:CB:68
D/BluetoothGatt: onSearchComplete() = Device=74:F0:7D:C0:CB:68 Status=0
I/gattSuccess: gattSuccess`
这段代码在onMtuChanged()方法中,因此会导致无限循环。