Re: [BTLE] Sending (a lot of) data to a Peripheral
Re: [BTLE] Sending (a lot of) data to a Peripheral
- Subject: Re: [BTLE] Sending (a lot of) data to a Peripheral
- From: Louis Gerbarg <email@hidden>
- Date: Fri, 04 Jan 2013 15:34:53 -0500
If you need to move a lot of data and support OSes and devices that
have small buffers it may be most effective to build in flow control
of some sort. For example, you could have the central subscribe to a
notification on some node, then write a value to it indicating how
many packets of data there are to be sent. At that point the
peripheral can update the node with a value indicating the packet
number to send, the central sees the update and sends the appropriate
packet in response to it. If you are willing to get fancier you can
increase the effective speed a bit, for instance by building retry
logic and s sending writes with no responses, and/or requesting
multiple packets per update.
Louis
On Fri, Jan 4, 2013 at 2:58 PM, Mark Palatucci <email@hidden> wrote:
> Are you using iOS 5 or iOS 6?
>
> On iOS 5, calling writeValue will cause a write failure after about 30
> writes (of 20 bytes each) unless you add a delay and allow the device to
> catch up and deliver the packets to the device.
>
> On iOS 6, the internal iOS buffer seems a lot bigger. It appears you can
> queue up about 200 writes before getting a write failure.
>
> On Sat, Nov 24, 2012 at 10:06 AM, Christian Giordano <email@hidden>
> wrote:
>>
>> Took 17.3 seconds to send 28757 bytes. this can be speed up reducing the
>> latency though.
>>
>>
>> On Sat, Nov 24, 2012 at 5:51 PM, Christian Giordano <email@hidden>
>> wrote:
>>>
>>> Tested the other way round (sent 29KB from Peripheral to Central) and I
>>> had no problems.
>>>
>>> Thanks, chr
>>>
>>>
>>> On Sat, Nov 24, 2012 at 3:52 PM, Christian Giordano <email@hidden>
>>> wrote:
>>>>
>>>> Sorry, I forgot to mention that so far I have been using 2 ios devices
>>>> (iphone4s and ipad3), maybe with a proper BTLE module I would have less
>>>> issues?
>>>>
>>>> Cheers, chr
>>>>
>>>>
>>>> On Sat, Nov 24, 2012 at 3:50 PM, Christian Giordano <email@hidden>
>>>> wrote:
>>>>>
>>>>> Hi guys, I manage to successfully pass data from the Central to the
>>>>> Peripheral and thanks to Khaos I have some ideas how the speed could be
>>>>> improved.
>>>>>
>>>>> I was testing the solution passing 200 bytes spread across 10
>>>>> [peripheral writeValue:chunk forCharacteristic:characteristic
>>>>> type:CBCharacteristicWriteWithResponse];
>>>>> The communication was pretty solid and the speed acceptable (sometimes
>>>>> was taking just a couple of seconds)
>>>>>
>>>>> Then I tried to increase the number of bytes passed to the order of
>>>>> tens of thousands and some problems appeared. Looks like the connection with
>>>>> the peripheral breaks after a bit. The maximum I managed to send "in one go"
>>>>> was 2KB. But most of the case it breaks after few hundreds.
>>>>>
>>>>> I understand that what I am trying to do is not a canonical use case
>>>>> for the technology. But I wonder if it would still be possible to have a
>>>>> prolonged stable communication where the Central send a fair amount of data
>>>>> to the Peripheral or if I really do have to find a way to invert the roles.
>>>>>
>>>>>
>>>>> Thanks for any opinion, chr
>>>>
>>>>
>>>
>>
>>
>> _______________________________________________
>> 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
>
_______________________________________________
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