How is MTU determined and can it be changed

ios

I'm developing a multi-part solution that consists of an iOS application and OS X application which communicate over Bluetooth Low Energy. Everything works fine and I can send moderate amounts of text between the iPhone and my MacBook. I would like to be able to send larger amounts of data, such as an image, from the iPhone to the MacBook. I'm able to do this but it takes about 50 minutes for the transfer of 1 image, compressed as a JPEG with a 0.2 quality (on a scale of 0-1). Part of the problem is that in the iOS application when the central connects, it reports an maximum packet length of 20 bytes (plus 3 bytes for header). In iOS 7, the changed the MTU so it's not a hardcoded 23 bytes. I cannot find anywhere that would allow me to specify a higher MTU on my MacBook or in the IOBluetooth framework.

I found a constant value in one of the bluetooth header files in the framework that specifies the MTU as 23 (20 + 3 for header), which leads me to believe this is just something hard coded into the framework that should be able to be changed somehow.

An alternative would be to use BLE to negotiate some other form of transfer between the systems. Ultimately, the transfer shouldn't be required to go over the Internet (the way Bump does it) but if a direct WIFI or Bluetooth connection could be used without requiring any user configuration, that would work.

Best Answer

BLE max datarate limits you to your 23 packet size. you need to change to Standard bluetooth to get the 2Mbps datarates.

Related Topic