bt_gatt_notify_cb callback delayed by one connection interval. Faster alternative?

Hi,

I'm developing an application where data is streamed from a BLE peripheral using notifications. I'm currently using bt_gatt_notify_cb to send each packet and wait until the completion callback is invoked before sending the next packet. I've noticed that the completion callback is consistently delayed by about one connection interval. I'm assuming this is related to how the BLE stack handles packet ACKing, as mentioned in this thread the.

Since I'm interested in minimizing latency, I wonder: Is there some other notification mechanism that I could use that does not suffer from this delay, like some lower level SoftDevice or BLE stack events?

I'm using nRF Connect SDK 2.5 and SoftDevice.

Thanks

Parents
  • Hello,

    You can use bt_gatt_notify() instead of bt_gatt_notify_cb(). All data is allways acked and sent in the correct order by the link layer in BLE, so the additional callback that bt_gatt_notify_cb() provide is not really necessary (it only slow down transfer since it suddenly depends on application do what the link layer is already doing, and the application it not able to do it as fast at the link layer) . For fastest transfer just call bt_gatt_notify() as fast you can until you receive an error that indicate the buffers are full, when buffers are full you typically need to wait until ~connection interval period until you can fill the buffers again. 

    Kenneth

Reply
  • Hello,

    You can use bt_gatt_notify() instead of bt_gatt_notify_cb(). All data is allways acked and sent in the correct order by the link layer in BLE, so the additional callback that bt_gatt_notify_cb() provide is not really necessary (it only slow down transfer since it suddenly depends on application do what the link layer is already doing, and the application it not able to do it as fast at the link layer) . For fastest transfer just call bt_gatt_notify() as fast you can until you receive an error that indicate the buffers are full, when buffers are full you typically need to wait until ~connection interval period until you can fill the buffers again. 

    Kenneth

Children
Related