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

Shorten GATT notify interval

Hello,

I am trying to send data via GATT notify at a rate of 60hz. I have created a tx thread that calls bt_gatt_notify in a loop and sleeps for 16ms. However, during profiling, I found that on entry to bt_gatt_notify, the system takes 50ms (20hz) to unblock and return making it impossible to run faster than 20hz.

I have traced this back to ncs/zephyr/subsys/bluetooth/host/conn.c#L368 where the tx is waiting for a free context to transmit and thus blocks forever but I cannot seem to find where the delay is located which controls how fast notifications are sent to a connected client.

I have tried adjusting the first argument in bt_le_adv_start to use BT_GAP_ADV_FAST_INT_MIN_1 and BT_GAP_ADV_FAST_INT_MAX_1 but that did not work.

Is there a configuration option available to reduce the notification interval?

Parents
  • Ended up finding the answer through searching the SDK for UUID of the Peripheral Preferred Connection Parameters given in the NRF connect app.

    The config options are CONFIG_BT_PERIPHERAL_PREF_MAX_INT and CONFIG_BT_PERIPHERAL_PREF_MIN_INT which defaulted to 30-50ms interval. shortening them to 10-15ms allowed for a 60hz notification rate.

Reply
  • Ended up finding the answer through searching the SDK for UUID of the Peripheral Preferred Connection Parameters given in the NRF connect app.

    The config options are CONFIG_BT_PERIPHERAL_PREF_MAX_INT and CONFIG_BT_PERIPHERAL_PREF_MIN_INT which defaulted to 30-50ms interval. shortening them to 10-15ms allowed for a 60hz notification rate.

Children
No Data
Related