You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HID device is connected through the system settings, and the APP will receive BleGattException for the first time the device is connected, status = 4
Open the APP to connect the device and negotiate MTU
Disconnect the device in the APP
Connect the device again
Received BleGattException
Expected behavior
Get the correct MTU after executing RxBleConnection#getMtu()
Reason Android's native API BluetoothGattCallback#onMtuChanged() will be notified twice: first status = 0, then status = 4, RxAndroidBle received 4 issued a BleGattException, but RxAndroidBle has retained the correct MTU, through RxBleConnection#getMtu() can be obtained
There are two situations when the APP connects to the device connected in the Android system settings:
No MTU negotiated: need to call BluetoothGatt#requestMtu to negotiate MTU
MTU has been negotiated: BluetoothGattCallback#onMtuChanged will directly return to MTU when connected.
Describe the bug
BleGattException
for the first time the device is connected, status = 4To Reproduce
BleGattException
Expected behavior
Get the correct MTU after executing
RxBleConnection#getMtu()
Reason
Android's native APIBluetoothGattCallback#onMtuChanged()
will be notified twice: first status = 0, then status = 4, RxAndroidBle received 4 issued aBleGattException
, but RxAndroidBle has retained the correct MTU, throughRxBleConnection#getMtu()
can be obtainedThere are two situations when the APP connects to the device connected in the Android system settings:
No MTU negotiated: need to call
BluetoothGatt#requestMtu
to negotiate MTUMTU has been negotiated:
BluetoothGattCallback#onMtuChanged
will directly return to MTU when connected.My solution
Suggest
Please consider adding similar processing in RxAndroidBle to ensure that
RxBleConnection#requestMtu()
can return the correct MTU.The text was updated successfully, but these errors were encountered: