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
  • Maybe you trying to call sd_ble_gap_adv_start() when you already advertising and get this error?

  • 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();
    }
    
Reply
  • 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();
    }
    
Children
No Data
Related