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

what's the meaning of error no. NRF_ERROR_BUSY

When I use sd_ble_gap_adv_start( ), sometimes get return value NRF_ERROR_BUSY . What's the meaning of this error No. ?

Parents Reply Children
  • Yes, but I call sd_ble_gap_adv_stop() before call sd_ble_gap_adv_start() again. Is there any problem? PS: I set m_adv_params.timeout = 1; so that the advertising should stopped after 1 second advertising, right?

  • What are you trying to do? Why are you calling sd_ble_gap_adv_stop() and where? Where are you calling sd_ble_gap_adv_start()?

  • I want to advertising after pushed a button, and only advertising 1 second. and I call sd_ble_gap_adv_stop() before sd_ble_gap_adv_start().

  • If I don't call sd_ble_gap_adv_stop() before sd_ble_gap_adv_start(), the error_code become NRF_ERROR_INVALID_STATE

  • In what case are you getting NRF_ERROR_BUSY? Completely at random or when button is pressed around 1s advertising timeout? My only assumption is that when you pressing on button in that moment previous advertising is timed out and stopped (or stopping) and softdevice generate BLE_GAP_EVT_TIMEOUT event (BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT), but it's pending and this pending event block your sd_ble_gap_adv_start() call. If you are using scheduler, then try to do this:

    if (sd_ble_gap_adv_start() == NRF_ERROR_BUSY)
    {
        app_sched_execute();
        sd_ble_gap_adv_start();
    }