This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

BLE Gatt Read Characteristic Slow Or Normal?

FormerMember
FormerMember

I am using read characteristic to read data from from a characteristic. The characteristics range from 2 bytes to 32 bytes in length. The time to read the data using IOS, Android or Linux, varies from 100ms to 400ms. Even for 2 bytes the timing is quite variable, 80ms to 350ms.

I guess this could be an issue at the receiver end or perhaps normal behaviour.

I have read around and it seems I should be able tune the timing using

sd_ble_gap_ppcp_set(....

And alter parameters such as

min_conn_interval max_conn_interval slave_latency conn_sup_timeout

I believe the minal connection time is limited to 7.5ms. I have tried various settings, without any significant change in performance.

I'm curious, is this kind of timing to be expected.

Parents
  • Hi Paul,

    Of all the things that govern the response time and throughput of read requests, the only thing you can tune here is the connection interval. This can be done by sending a connection parameter update request (if you are the peripheral) or by changing them directly (if central). This is done by calling sd_ble_gap_conn_param_update() with the connection parameters your prefer. The PPCP (Peripheral Preferred Connection Parameters) are only an indication of which connection parameters you normally prefer, but not all peers will care about this. PPCP is also only available after you are connected, unless you choose to include the AD field in your advertising data. Each central will also have their own limitations on connection parameters, where e.g. Android will go down to 7.5ms and iOS to 11.5ms (only if HID service available).

    You should set the PPCP to whatever parameters you prefer for normal operation, and send a connection parameter update request at the start of the connection if the parameters are unsuitable for your requirements. There are certain rules when it comes to combinations of slave latency, supervision timeout and connection intervals and quite different power usages, so please read through the documentation for sd_ble_gap_conn_param_update() and ble_gap_conn_params_t to get some pointers on these.

    The normal delay of a read request should be no more than 7.5ms at normal operating conditions, but this can be much worse in places with lots of interference in the 2.4 GHz band (leads to CRC errors, collisions, etc.)

  • FormerMember
    0 FormerMember in reply to Ulrich Myhre

    It did strike me as very slow. I'm not sure of the cause. As you say it could be interference caused by numerous other devices using the 2.4GHz band. The results are pretty consistent for different applications.

    Notifcations are reasonably fast, 30 ms for IOS, 50 ms for Android. My aim is for about 20ms.

Reply
  • FormerMember
    0 FormerMember in reply to Ulrich Myhre

    It did strike me as very slow. I'm not sure of the cause. As you say it could be interference caused by numerous other devices using the 2.4GHz band. The results are pretty consistent for different applications.

    Notifcations are reasonably fast, 30 ms for IOS, 50 ms for Android. My aim is for about 20ms.

Children
No Data
Related