This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

How to wait for BLE_EVT_TX_COMPLETE

I would like to write to multiple characteristics in a loop but the second call to sd_ble_gattc_write() causes a NRF_ERROR_BUSY error. From reading the documentation, I should be waiting for the BLE_EVT_TX_COMPLETE before calling sd_ble_gattc_write() again.

What's the proper way to call sd_ble_gattc_write() and then wait for the BLE_EVT_TX_COMPLETE to occur before calling this again with the next value in the loop?

I have the following code in on_ble_evt(), but this never gets entered:

case BLE_EVT_TX_COMPLETE:
    tx_busy = 0;
    break;
Related