Follow-Up question on Electrical Engineering Stackexchange
I want to write the value of a Bluetooth Low Energy characteristic repeatedly in a short amou
What you are seeing when packets are dropped are due to buffer overflow either on the iPhone side (most likely I think) or on the host side. Starting with iOS 11.2, apple provides a mechanism allowing you to check if the buffer is ready before writing the next packet; canSendWriteWithoutResponse:
If you wait until canSendWriteWithoutResponse is true before writing a packet, the delivery is guarantied to have been placed in the receiving buffer, but not guarantied that it has been processed (unacknowledged). The other thing that could help is by negotiating a MTU size greater than 20. Apple supports MTU at 185B, and up to 251 (extended data length aka EDL). By chunking your data packets in MTU-3 sizes, your packet==(MTU-3) x 1 per connection interval. @185B MTU, 24 ms connection interval I have throughput around 48kbps with no dropped packets. When sending data to the iPhone from the device, the SDK on that end will need the equivalent to 'canSendWriteWithoutResponse', which in my case using SiLabs hardware/SDK does have e.g
```
do {
result = gecko_cmd_gatt_server_send_characteristic_notification(
0xFF,
evt->data.evt_gatt_server_attribute_value.attribute,
chunk.length,
[chunk bytes])->result;
} while(result == bg_err_out_of_memory);
//retry until buffer is empty and ready for more
//then update the offset
offset += thisChunkSize;
```
Here is a video and .pdf from apple explaining the different BLE techniques and expected speeds. MTU + Connection Interval is what you use to determine max throughput. 48kps should be easily achievable, 96kbps and maybe a little higher are possible.
What's New in Core Bluetooth
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/712jqzhsxoww3zn/712/712_hd_whats_new_in_core_bluetooth.mp4?dl=1
pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/712jqzhsxoww3zn/712/712_whats_new_in_core_bluetooth.pdf