Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE Gatt Queue Library with sd_ble_gattc_write NRF_ERROR_RESOURCES

I am running SDK 16.0 on nrf52840. For GATT Writes I am using the BLE Gatt Queue Library. When I try to performing lots of writes in succession some packets do not get transmitted and I have tied it to sd_ble_gattc_write returning NRF_ERROR_RESOURCES and the data not being queued. My question is why does the GATT Queue library not queue up this transmission? The only time it will be queued is if the write attempt returns NRF_ERROR_BUSY. Seems like if NRF_ERROR_RESOURCES is received then it too should be queued. What is the reason for not queuing?

Parents Reply
  • Hi,

    I would suggest that you use either internal Softdevice queue (configurable ble_gattc_conn_cfg_t::write_cmd_tx_queue_size) or BLE Gatt Queue module for GATTC Writes. Actually, the Softdevice queue is a better option because you can track its size at the application level.

    You cannot assess BLE GATT Queue size the same way, because all Softdevice requests use exactly the same queue and the information about it is unavailable. So the algorithm for tracking the BLE GATT queue state cannot be used in this case: "Store initial queue element count in a variable" can work well....".

    You are probably using both queues in your solution (judging from your screenshot). In that case, the SD queue will fill up first and the BLE GATT Queue will be used. That's why you see the disparity between the number of times when the item was added to the BLE GATT queue (only 1 time in your screenshot) and the number of BLE_GATTC_EVT_WRITE_CMD_TX_COMPLETE events (5).

    -Amanda H.

Children
Related