Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android device: requestMtu issue #22

Closed
spiderman16888 opened this issue Oct 20, 2023 · 1 comment · Fixed by #23
Closed

android device: requestMtu issue #22

spiderman16888 opened this issue Oct 20, 2023 · 1 comment · Fixed by #23
Assignees
Labels
bug Something isn't working

Comments

@spiderman16888
Copy link

D/BluetoothGatt(24178): configureMTU() - device: D029BA_C mtu: 517
D/BluetoothGatt(24178): onConnectionUpdated() - Device=D029BA_C interval=36 latency=0 timeout=500 status=0
D/BluetoothGatt(24178): onConfigureMTU() - Device=D029BA_C mtu=247 status=4
I/flutter (24178): error: PlatformException(IllegalStateException, java.lang.IllegalStateException: Request MTU failed with status: 4, Cause: null, Stacktrace: java.lang.IllegalStateException: Request MTU failed with status: 4
I/flutter (24178): at dev.yanshouwang.bluetooth_low_energy_android.MyCentralManager.onMtuChanged(MyCentralManager.kt:522)
I/flutter (24178): at dev.yanshouwang.bluetooth_low_energy_android.MyBluetoothGattCallback.onMtuChanged$lambda$1(MyBluetoothGattCallback.kt:21)
I/flutter (24178): at dev.yanshouwang.bluetooth_low_energy_android.MyBluetoothGattCallback.$r8$lambda$YuSPH4xgjMukXLzXKi-mkORqrJ4(Unknown Source:0)
I/flutter (24178): at dev.yanshouwang.bluetooth_low_energy_android.MyBluetoothGattCallback$$ExternalSyntheticLambda5.run(Unknown Source:8)
I/flutter (24178): at android.os.Handler.handleCallback(Handler.java:942)

@yanshouwang
Copy link
Owner

This means the MTU request is failed, I called requestMtu after GATT discovered in the newest version, and if the request is failed, the discoverGATT will throw this error, will fix this behavior in the next version.
the status 4 seems releated with multiple MTU requests, look at this: status = 4 error when calling requestMtu for twice in Android APP
I suggest to use version 3.0.1 if you can't resolve this error, this will be fixed as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants