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

multiple packets per connection interval between nrf52 central and peripheral

I am evaluating the throughput of BLE communication between 2 NRF52832's, 1 acting as a central and 1 as a peripheral. I've modified the ATT_MTU Throughput Example, and I'm attempting to configure the peripheral to send more than 1 notification per connection interval. I believe I've successfully increased the `hvn_tx_queue_size` GATTS configuration following the instructions here and the I'm avoiding `NRF_ERROR_RESOUCES` errors from `sd_ble_gatts_hvx` by tracking the available space in the queue as described in variant #2 of the GATT Server handle notification message sequence chart below.  Despite all of this, the count reported on each BLE_GATTS_EVT_HVN_TX_COMPLETE is always equal to 1.

I'm using SDK v15.0.0 and softdevice S132 v6.0.0, and queueing notifications of 223 Bytes every 4 milliseconds using `sd_ble_gatts_hvx`. The connection interval is 20 milliseconds, MTU is  247 Bytes, PHY is 2 Mbps, GAP event length 320, and 

Is there any additional configuration needed on either the central or peripheral to see more than 1 notification per connection interval?

  • Adding some updated information. After reading the s132 migration notes for v4.0.3 section BLE bandwidth configuration, I think I have a better idea of how bandwidth configuration works. I've updated my parameters to the following:

    connection inteval: 50 milliseconds

    MTU: 247 bytes

    PHY: 2 Mbps

    GAP event length: 50 milliseconds

    notification length: 223 bytes, each containing an incrementing counter

    sd_ble_gatts_hvx called every 4 milliseconds

    I am still always seeing the count from each BLE_GATTS_HVN_TX_COMPLETE equal to 1, but the throughput I'm observing suggests that more than 1 notification is being sent in each connection interval. By that I mean that if only 1 223 byte packet was being sent every 50 milliseconds, I'd expect to see only about 20 packets per second, but on the receiving side I am seeing the full 250 packets per second, arriving in order without losing any based on the incrementing counter in each packet.

    Am I incorrect in assuming that there should be a BLE_GATTS_HVN_TX_COMPLETE once for each connection interval?

  • HI Bob, 

    I apologize for the late reply. 

    I sniffed the traffic between two nRF52 DKs running the ble_app_att_mtu_throughput example modified to print the count variable passed in the hvn_tx_complete struct. I observed multiple packets per connection interval and the  hvn_tx_complete  count is always 1, i.e. you get  the BLE_GATTS_EVT_HVN_TX_COMPLETE event per notification and not per connection event. 

    Best regards

    Bjørn 

Related