Flutter_blue: Feature request: Request MTU size

Created on 1 Nov 2018  路  6Comments  路  Source: pauldemarco/flutter_blue

First of all, thanks for this awesome project.

I'm write an app using BLE to listen to some sensor data, I was able to receive notify value on a characteristic. But mtu size is 23 bytes by default, so I can only read the first 20 bytes, I didn't find any api to request a large size. My sensor data length is mutable and could be large than 23.

My app is running on > Android API 21. Here I found a stackoverflow post

Most helpful comment

MTU size is very important. I hope devs can add this feature so more people can start using this.

All 6 comments

MTU size is very important. I hope devs can add this feature so more people can start using this.

+1 For this. On iOS I don't have to do this and can very quickly send 136 byte packets. On Android I am unable to send anything greater than 23 bytes and the transfer takes quite a bit longer because of the overhead built into BLE.

I found that I can receive 136 byte packets from the bluetooth device, but I am unable to send them. If I send an 8 byte packet on the characteristic, the device will reply with a 136 byte packet.

I have this fixed but I can't figure out how to commit the code to the repository. It says I "require push access to this repository" Changed files attached, hopefully I can get access to properly submit it.

requestMtu Changes.zip

you can create a pull request @wabash9000

If you want to send more than 23 bytes on android, use writeWithResponse instead of writeWithoutResponse

@RyanYANG52 @bondjpf @LastMonopoly
I have implemented MTU functionality in the latest version of the plugin (0.6.2).
Please try it out and let me know your feedback.

Was this page helpful?
0 / 5 - 0 ratings