This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE send and receive speed, GATTS

Hello,

Currently i am doing some testing with the NRF52 DK. I am measuring the time it takes to send and receive a BLE message. I am using the high bandwidth setting the the TX and RX.

conn_bw.conn_bw.conn_bw_rx = BLE_CONN_BW_HIGH;
conn_bw.conn_bw.conn_bw_tx = BLE_CONN_BW_HIGH;

also i am using a write command instead of a write request.

writeParameters.write_op = BLE_GATT_OP_WRITE_CMD;
err = sd_ble_gattc_write(connectionHandle, &writeParameters);

For the connection interval I use both on 7.5 ms

uint16_t meshMinConnectionInterval = MSEC_TO_UNITS(7.5, UNIT_1_25_MS);   	
uint16_t meshMaxConnectionInterval = MSEC_TO_UNITS(7.5, UNIT_1_25_MS);  

The packet length is 20 bytes. What i found was that the time it took to send and receive that message was very unreliable. I did the test a 100 times and found these results:

> Average time = 35,86364746 ms 
> longest time = 86,36474609 ms 
> shortest time =1,525878906 ms

I was wondering how this can take so long sometimes?

Thanks in advance.

  • I found the issue, i was scanning while sending.... devzone.nordicsemi.com/.../, same issue as here.

    another question: I am using the S132 V2, and i read this: 127.8 kbps (each direction) What does this mean , that i have 64kb/s send and receive?, since i reach 139kb/s to one deveice, but only 54kb/s whe the device is sending and receiving.

  • 127.8 kbps in each direction means that you can send and receive at 127.8 kbps. This number is basically just 6 TX/RX packets per connection event and a connection interval of 7.5ms:

    6 packets per event * 8 bits per byte * 20 byte per packet / 7.5 ms = 128 kbps
    

    Why you don't get that high throughput when sending and receiving, I don't know. It can be application processing or something else. As the SDS says:

    Maximum throughput will only be possible when the application reads data packets as they are received, and
    provides new data as packets are transmitted, without delay
    

    You should take a look at the ATT MTU throughput example in SDK 12.2.0. This also shows how you can change the MTU or PDU (packet payload) size and connection event extension to get even higher speeds. Maximum speed with SoftDevice S132 v3 can be up to 765.8kbps, see here.

  • Issue was that I was still searching for other devices, while sending. Same issue as here : devzone.nordicsemi.com/.../

Related