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

[IOS & MacOS] RequestMtu doesn't work like expected #131

Open
Sravdar opened this issue Jan 17, 2025 · 2 comments
Open

[IOS & MacOS] RequestMtu doesn't work like expected #131

Sravdar opened this issue Jan 17, 2025 · 2 comments

Comments

@Sravdar
Copy link

Sravdar commented Jan 17, 2025

Tested and built on "Mac Mini m4", Flutter 3.27.1, xcode 16.2, universal ble 0.14.0
İphone 7, ios 15.8.3

On both of the devices i got the same behaviour.

On first RequestMtu call after boot and hot restarts it throws exception

PlatformException(IllegalArgument, Unknown deviceId:<_TtC13universal_bleP33_7F14D50205415E5D4F8E2E2076A78ED716BleCentralDarwin: 0x15166b6e0>, null, null)

On following calls it doesn't throw exception but also doesn't set the mtu to target value and returns "23". Thing is peripheral device says mcu is set to its prefered value "495".

@Sravdar
Copy link
Author

Sravdar commented Jan 17, 2025

I found the reason for the exception. I was calling RequestMtu in "onConnectionChange" callback. I think it causes some kind of race condition with connect function.

Second part still stays same. It returns "23" while peripheral is saying "495".

@Sravdar
Copy link
Author

Sravdar commented Jan 17, 2025

I have found the cause. Calling 'requestMtu' before 'discoverServices' was causing this problem.

But something to note is in example project i realized even though expected mtu is set to "247" i still get highest possible mtu. Not sure if this is intended or bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant