This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Peripheral UART example - connection interval and throughput

Hey guys,

I have another question related to this example.

I've modified the UART example such that UART printing is disabled, and I am calling ble_nus_send_string() to send a packet of 20 bytes six consecutive times in the nus event handler upon receiving data. I'm also using the nRF UART android app and a nrf51 dongle as a sniffer. Note I've also had to change the GAP_EVENT_LENGTH to be (connection interval / 1.25).

I've noticed that with a connection interval of 20ms, the 6 packets do seem to take 20ms to send (just taking the time difference of the last packet and the first from Wireshark).

However, when I change the connection interval to say 500ms, I expected the time difference to be 500ms, but it seems that the data gets transferred way faster than that. I can confirm that the connection interval was agreed at 500ms, and the empty PDU packages are sent only ever 500ms.

This doesn't seem to match up...am I misunderstanding how this is supposed to work? I can post some Wireshark log dumps later on. Thanks.

  • I'm guessing that with 20ms connection interval and gap event length = 3. you send 3 packets in the first event then the rest in the next. But when you extend the gap event lenght you get more buffers, and are able to send all 6 packets in the first connection event.

  • Sorry maybe my question wasn't entirely clear. If I keep the gap event length CONSTANT, but just change the connection interval, I kind of expected to see the data transferred slower with a larger connection interval than a shorter one.

    However, on Wireshark I still see the packets being transferred very quickly.

    For example, with MTU=23, 30ms connection interval, and 6 packets sent in a row, the sniffer says all 6 packets were transferred within 20ms.

    If I change the connection interval to 15ms, WireShark tells me that all 6 packets were also transferred within 20ms.

    This is somewhat confusing because I thought the timing values would be different. I do see with an oscilloscope that it takes 30ms and 15ms respectively to queue/send all the data though.

  • Could you post wireshark logs so I can see what is happening on air?

Related