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

How to reduce the response time of read requests

Hi,

I am working on the heart_rate_collector example code of nrf51-ble-driver_linux_0.5.0. I try to modify the example code let it can connect the Environmental Sensing Service (ESS profile) peripheral.

The ESS peripheral have temperature(Assigned Number: 0x2A6E) and humidity(Assigned Number: 0x2A6F) characteristic. Both of characteristic all support notify property.

When I connect the ESS peripheral and use the "sd_ble_gattc_read" to read its characteristic(such characteristic uuid: 0x2A29). Time between read request and read response is short.image description

But, when the notify function of temperature and humidity characteristic is be enabled, I also use "sd_ble_gattc_read" to read characteristic uuid: 0x2A29. Time between read request and read response is become very long.

image description

I capture this sniffer packet sniffer.pcapng

And then, I use my android smart phone and install "nRF Connect for Mobile" APP to connect the ESS peripheral. Time between read request and read response is always short. (even the notify function of temperature and humidity characteristic is be enabled)

Does anyone have any way to reduce the response time of read requests?

Parents
  • Update: I missed the part you said that it was faster if no notification enabled. What happened was that the S130 only allow one packet per connection event, and if you already queued 8 notification packets, the read response will have to wait for these 8 packets to be transmitted before it can transmit. Since the S130 only allow one packet per connection event, it take 7 events to transmit all of them.

    In your case with Android phone, there are more packet per connection interval allowed, so you can see the response come sooner.

    The solution for it is to not to queue too many notification so that the read response can be sent earlier. Or you can temporary change the connection interval so the read response will arrive faster (but this will consume more power).

    Another option is to use newer S130 version, but the official version of ble driver is not released yet. You can have a look here for the latest driver that use S130 v2.0.

  • Hi Hung Bui,

    Thanks for your reply!

    Which one will queue notification packets, peripheral or central? According to your first answer, the peripheral have used a timer to get a data, and then call sd_ble_gatts_hvx function to send notification with this data.

    Thanks

Reply Children
No Data
Related