If your device is acting as the peripheral, there are some things you can implement on various connection parameters on that side to improve throughput.
If your device is the central, then you will not be able to control the connection, but there are still things you can do in your app.
If your device is the peripheral, it can request certain connection settings, but acceptance by iOS is not guaranteed. As an iPhone is not a dedicated device for your purposes, various factors and usage at the time will determine which of these following connection settings will be accepted. So, you can consider these as a best case scenario and be prepared for lower throughput in the hands of your users under less than ideal situations.
Let's start with what techniques you can use to improve your throughput:
-
Are you using GATT or L2CAP? If not L2CAP, I suggest you should look into that, as it will dramatically increase your throughput by reducing GATT protocol overhead
-
Are you using Write With Response, or Without? Write without response will at least double your performance, or even more depending on the capability of the chipset you are using in the accessory
-
When using Write without response, you can try multiple writes within a single connection interval. How many writes you can squeeze in will depend on the capabilities of the chipset on your device, and general performance to be able to send/receive and process the data.
-
The device can request increased MTU.
-
Make sure that your writes are aligned in size with the MTU size that is negotiated to minimize wasted packet space?
-
You can use Extended Data Length to increase the packet size from 27 to 251
-
You can optimize your connection interval? While you could be requesting 15ms, it may not be getting accepted depending what else is going on the iOS side, and whether your accessory has the processing power to process and send/receive the data at faster intervals. Also, sometimes you may get better results with larger connection intervals if you are able to squeeze more writes into a single connection interval. But like I said, this will depend on the chipset and the processing power of your device.
If you take these factors into consideration you can expect better throughput. If you have implemented all these things but still not getting the throuhgput you expect, you would want to start checking on the accessory to make sure everything has been negotiated correctly. If for one reason or another the iOS device is not accepting the requested connection parameters, then there is nothing much else you can do outside of making sure that the parameters are realistic and correct as to the requirements stated in https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf
If your device is acting as the central, then all these connection parameters will be controlled by the iOS side, and there isn't anything you can do to change those, outside of implementing L2CAP on your app.
Argun Tekant /
WWDR Engineering /
Core Technologies