Hello,
is there a way to check for NRF_ERROR_BUSY
before issuing a new command?
The idea would be to create a timer to retry issuing a/the command if the NRF is not busy any more.
(I am currently on SDK 9, S130)
Thanks!
Hello,
is there a way to check for NRF_ERROR_BUSY
before issuing a new command?
The idea would be to create a timer to retry issuing a/the command if the NRF is not busy any more.
(I am currently on SDK 9, S130)
Thanks!
What commands/function do you have in mind? is there a specific command or softdevice-function that is returning NRF_ERROR_BUSY
you have problem with?
Hi,
This will depend on the function. Some functions might give you callback to indicate that the procedure/operation the function did is finished, and that you now can call the function again. For other functions, you might need to call the function again to test if it’s ready. Adding a timer here could be solution.
Note that NRF_ERROR_BUSY
is sometimes a symptom on a function that is not used as intended. Example; if you use sd_ble_gatts_hvx() to send an Indication, but calls the sd_ble_gatts_hvx() again before you receive confirmation from GATT client on the previous Indication, you will get NRF_ERROR_BUSY
. In this case the solution is to wait for confirmation in the BLE event BLE_GATTS_EVT_HVC before calling sd_ble_gatts_hvx() again.
Hello Sigurd, yes actually it can be a result of many things in my case and it makes it hard to trace. I moved to a timer implementation to overcome this. In any case, the way to go is via error handling. Thx
Hello Daniel, it is complicated. The app has both GATTC and GATTS. Many things can happen asynchronously/concurrently. I was thinking of an architecture to deal with this, so I was looking at my (API) options. :)