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

Sending large packets via BLE

Hi,

I want to know a few things about sending large packets via BLE using nRF52 SDK 15.0 and above.

I am able to send the packets larger upto 128 Bytes. But i want to know how does the queue system works??

Lets say i send 100 bytes and my connection interval is 20ms. Does it mean that this data will be sent in 100ms at an interval of 20ms or it will all be sent in a single packet with in 20ms??

Also, is there anyway to send the data faster like upto 1KB within 100ms?

Thank you.

Parents
  • Hi Jamal, 

    You can read a little bit more about Bluetooth interval and connection event here and here.
    Basically you can have multiple packets in one connection event (in one interval). So there can be multiple 100 byte packets in one single connection event that occurs every 20ms. 

    100 byte of data (without overhead) only need 0.8ms to be transmitted at 1Mbps PHY. 

    If you want to send the data as quick as possible, make sure you queue as much as possible until you receive NRF_ERROR_RESOURCES or NRF_ERROR_NO_MEM meaning the softdevice TX buffer is full. Then try to queue again as soon as there is a packet sent, or when you receive BLE_GATTS_EVT_HVN_TX_COMPLETE or BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE event. 

    You can send up to 7-8kB per 100ms in theory. 

  • Hi Hung,

    Thank you for the information.

    I could not find exactly the relative information on those links which you sent but still i learned a lot from there.

    So according to your description.

    If i send 240 bytes using ble_nus_data_send(****) function which can send max 247 bytes. Those 240 bytes will be sent all in a single update event??

    If yes, then there is not problem in sending 1KB with in 100ms if the connection interval is 20ms.

    Am i right?

    Thank you.

  • Yes, you are correct. 
    I have made an example for testing through put that you can have a look here. 
    3286.ble_app_uart - Througput.zip

    The example based on the ble_app_uart in SDK v17.0.2 . Please check the log to see how to use it 

Reply Children
No Data
Related