This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Send data from keyfob to pc in the shortest time

Other Parts Discussed in Thread: CC2540

Hi everyone! I´ve got a doubt about HCI buffers.

I need to transfer a lot of bytes of data from keyfob to PC application (on the order of 10,000 packets of 15 bytes each one).

I've understood that the CC2540 has a limited buffer for queuing up data packets for one connection events. The max data per connection event is limited to 80 bytes at app level. There is a 4X20 buffer, and the buffer gets flushed when data is successfully sent and acknowledged at the link layer.

So... Which is the best way to send data in the shortest time possible? I thought two ways:

1. Create for example 4 characteristics of 15(or 20) bytes each one. And the connection interval established in 80 ms.

2. Or create 1 characteristic of 15 (or 20) bytes and establish the connection interval in 20 ms for example.

I need to transfer 10,000 packets of 15 bytes each one in the shortest time possible.

Which is the best way? Or both ways behave the same form for the stated purpose? What is the difference between them?


Thanks in advance...

Martin Romero

  • Hello,

    Your examples would both take the same amount of time. #2 would use more power though, as there would be more connection intervals, and thus more duplication of wakeup, stabilizing RF, pre and post processing.

    BR,

    -Greg

  • Thanks GregS for your reply, i've got another doubt.

    What happens if I change one characteristic more than once in sequence, for example:

    I've got a characteristic (composed of 15 bytes), and i change it four times in sequence, like:

    ...

    SimpleProfile_SetParameter( SIMPLEPROFILE_CHAR6, 15, charValue6 );

    ...[Change  charValue6]...

    SimpleProfile_SetParameter( SIMPLEPROFILE_CHAR6, 15, charValue6 );

    ...[Change  charValue6]...

      SimpleProfile_SetParameter( SIMPLEPROFILE_CHAR6, 15, charValue6 );

    ...[Change  charValue6]...

      SimpleProfile_SetParameter( SIMPLEPROFILE_CHAR6, 15, charValue6 );

    ...

    So, if i've got 4x20 buffers, it should not be a problem, is that correct?

    Which way do you recommend me to send more data in the shortest time possible?

    Thanks again...

    Martin Romero

  • 1. You can change the charachteristic more than once - it is not a problem (at least in TI' stack it works).

    However, I share your concert, that it might not work in other stack implementations. I could not find a clear definition of the behaviour of the stack in such a case in the Core Specification.

    2. You can send the data even faster by sending each connection event (at 20 msec interval) 4 writes to the same charachterisic and using Gatt WriteNOResponse (So you will be able to write twice to the same handle WITHOUT waiting for GATT acknowledge).