Re: Maximizing Data Transfer over BLE on iOS
Re: Maximizing Data Transfer over BLE on iOS
- Subject: Re: Maximizing Data Transfer over BLE on iOS
- From: Nick Brook <email@hidden>
- Date: Wed, 27 Jan 2016 07:46:10 +1300
The best way I have found to do this is to add another characteristic which notifies when a certain number of data chunks has been received. Your data characteristic is 20 bytes. Write the data characteristic n times then wait for the notification, then another n times until all data is written. I pack out the last chunk with 0xFF as that is unwritten flash on the Bluegiga chips.
Cheers
Nick
On 27 Jan 2016 4:41 am, "Ben Flannery" <
email@hidden> wrote:
I’m attempting to transfer 100-200 kB over BLE. I understand the limits of BLE for this purpose, and am willing for this transfer to be slow, but I would still like to maximize it as much as possible. There is a lot of information online regarding transmission
rates, but much of it seems to be outdated (pre-iOS 7). My setup is as follows:
CBCentral: iPhone 6S+
CBPeripheral: BLE121LR
This transfer is going from the Central to the Peripheral through the `CBPeripheral.writeValue(data, forCharacteristic: characteristic, type: CBCharacteristicWriteType)` method.
I have tried a variety of schemes.
- Write 100kB once withResponse
- Write a single 20 byte chunk withResponse
- Write 4 20 byte chunks every 20ms withoutResponse
- Write a single 80 byte chunk every 20ms withResponse
Obviously using ‘withResponse’ gives a huge overhead & latency. The best transmission rates I have achieved are by writing 4 20 byte chunks every 20ms without notifications. Obviously, without loss, this is a hard limit of 4kB/s. I can typically achieve
rates of 1-3 kB/s depending on connection strength.
Are there any adjustments I can make to increase this? Can I modify the BLE connection parameters (MTU size)? Would increasing the characteristic size in the GATT profile give me any real-world benefit?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden