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

Transmitting 6 packets

Hi there,

I am trying to send six 20 byte packets per connection interval. Is changing the length of charecteristic simply

attr_char_value.init_len     = sizeof(uint8_t)*20;
attr_char_value.max_len      = sizeof(uint8_t)*20;

and then also the gatts value length to

gatts_value.len = sizeof(uint8_t)*20;

how do i send 6 packets as apose to 1? will a data stream just fill six 20 byte chars sequentially untill they are full and then send that?

  • Hi Wass,

    The maximum payload length for a connection packet with our stack is 20 bytes. You can send more than 1 packet per connection interval up to 6 packets.

    The way to do it is to queue as much as possible notification or write command until the buffer is full. And queue more again after the buffer has free slot.

    You can have a look at this case. We also have an through put test example on github. It's pretty old though.

    Note that not all central device support 6 packets per connection event. As far as I know iOS device (iOS8.x), Nexus 5, etc support 6 packets when other device usually support only 4 packets.

    [EDITED] (changed from 2 TX packet to 1 TX packet, the S120 scheduller doesn't support 2 packets) Our S120 supports 1 RX packet and 1 TX packet (S120 -> S110 direction) per connection interval.

  • Hi thanks for your reply, i am trying currently to send 6 packets per connection interval of 20 bytes over to a central S120 device. Does this mean that i will not be able to acheive this with the S120 softdevice? It will only receive 1 packet of 20 bytes per connection interval?

  • @Wass0392: Correct, if you try to send notification from S110 to S120, you will only be able to send one packet per connection event. But you can try to test with the Master Control Panel on PC instead of S120, where we support 6 packets per connection interval.

  • @Hung Bui: Hi, I found that the test example "through put test" for sending the long size packet is almost similar with the "ble-app-lbs-master" example which send only 1 byte of data over BLE. I tried to run this application (through-put-test) to understand its functionality but its showing error of not opening the arm_startup_nrf51.c file. I used nRF51 SDK version 5.2.0 and S110 SoftDevice version 6.0.0 as mentioned in the article. Please clear me why so??

    Also, please let me know which files are only modified in the both the cases while comparing both the examples (through-put-test) and (ble-app-lbs-master). I checked the main.c file, which has some changes as compare to through-put-test example. Is there any other files which are modified ? Please clear this~ Thanks.

Related