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

sd_ble_gatts_hvx() and connection parameters

I've finally completed a BLE transmission using tips about connection interval, slave latency and supervision timeout given here. I checked it with Master Control Panel app on my smartphone and with WireShark: after some seconds from connection's initialization the parameters are successfully updated to conn.interval=500ms, Slave lat.=7, Sup. timeout=10s.

Now, when the interrupt occurs, the application compute new data and execute the sd_ble_gatts_hvx() functions with new data as parameter.

1- With help of WireShark it seems the application transmit a notification every time the sd_ble_gapps_hvx() was called, even more often than 500ms that is the minimum connection interval. Is that a normal feature?

2-Are the connection parameters operating only at Link-Layer level and independent from notified data-packets?

In this video the speaker is talking about packets send by master every connection interval. The slave could responds, at maximum, every (connection_interval*slave_latency)+connection_interval seconds.

3-Are these packets handled by S110 and independent by data packets (that are part of Gatt-level) ?

Thank you!

  • Hi

    1. If the connection interval is 500ms, data exchange over the air can not happen more frequently than every 500ms. However, up to 6 packets can be transmitted in every connection interval, but they would all be transmitted within the same 6ms timeframe. However, if you use Master Control Panel and the PCA10000 dongle, you can only transmit 1 packet per connection interval. For every call to sd_ble_gatts_hvx(), one packet is created in the softdevice which is transferred over the air.
  • My question is: How are you measuring the actual connection interval? Are you sure it is 500ms?

    By Wireshark you mean that you use nRF-Sniffer? What do you see on air, more frequent packets than every 500ms? If so, your connection interval is shorter than 500ms.

  • Yes, I use nRF-Sniffer associated with Wireshark, as shown here. I'm quite sure the connection interval is 500 ms because I see on-air, among others, following packets:

    • SLAVE->MASTER: L2CAP protocol, Rcvd Connection Parameter Update Request containing properly above mentioned connection parameters. After some ms the MASTER respond as...
    • MASTER->SLAVE: L2CAP protocol, Rcvd Connection Parameter Update Response (Accepted)

    Furthermore, if the interrupt is not triggered I see some empty PDU from MASTER to SLAVE every 500 ms and some empty PDU from SLAVE to MASTER every 4 seconds.

    But yes, there are packets (data-packets) over the air more frequent than 500 ms but probably I mislead by the possibility to transmit up to 6 packets every connection interval. To confirm this, I've just read from BLE 4.2 specification manual (vol.6, part b, par.4.5.1), about the event counter containing the value connEventCounter. It is incremented by one for each new connection event sent by the master. With the nRF-Sniffer i see it is the same value among close packets (closest than min. conn. interval, <<500 ms) thus, close packets are part of the same connection interval.

  • I used PCA10000 with nRF-Sniffer/Wireshark to monitor BLE connection between:

    • PCA10001 (with my custom FW based on ble-lbs) and
    • my android smartphone with nRF-Master Control Panel app.

    Probably I mislead by data-packets of the same connection interval, as you said. In-fact, in the same connection interval (500 ms), the FW can call multiple times the sd_ble_gatts_hvx() function.

    Thank you for your extra-efficient support!

Related