Zephyr API Function bt_gatt_read Takes long time to return an error code

Hi,

I was doing BLE tests with our custom code using two nrf52dk DK boards. The client keeps reading data from the server every 250ms. If I power reset the server during the client's reading activity, I noticed it took a long time (about 20-30 seconds) for the function bt_gatt_read to return the error code (-12, ENOMEM). Is there any specific reason why it takes so much time?

The SDK I was using is v2.4.0 nRF Connect.

Thanks! 

Parents
  • I guess I know why there is a 30 seconds delay there. Inside the function bt_gatt_read, the function gatt_req_alloc is called and there is a timeout constant BT_ATT_TIMEOUT used for allocating a new request, which is 30 seconds.

    So if I change this timeout to a shorter time, say 5 seconds, will it cause other issues potentially?

    Thanks!

Reply
  • I guess I know why there is a 30 seconds delay there. Inside the function bt_gatt_read, the function gatt_req_alloc is called and there is a timeout constant BT_ATT_TIMEOUT used for allocating a new request, which is 30 seconds.

    So if I change this timeout to a shorter time, say 5 seconds, will it cause other issues potentially?

    Thanks!

Children
No Data
Related