Hi @mc ,
Thanks for reaching out.
In BLE, you don’t have a single fixed “max bytes” value. It depends on the platform and the negotiated connection settings.
On Android, BLE uses an MTU (Maximum Transmission Unit). You can request a larger MTU at runtime, and once it’s negotiated, Android will tell you the actual size you can use. The usable payload is slightly smaller than the MTU itself, so you should always read the negotiated value and chunk your data accordingly.
On iOS, things are more restricted. iOS does not expose the MTU or allow apps to change it. The system decides the maximum write size for you. In practice, this is usually around ~20 bytes on older connections and up to ~182 bytes on newer ones. Because you can’t query this directly, the recommended approach is to assume a safe chunk size and split larger data into multiple writes.
So the solution on both platforms is:
- Always chunk your data before sending
- On Android, use the negotiated MTU to size your chunks
- On iOS, use a conservative fixed chunk size
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.