This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Stop advertising is blocking?

I'm trying to regularly change some advertising parameters (ble_gap_adv_params_t.type). The only way i can see to do so, is by stopping and starting advertising. However, I noticed that stopping advertising (sd_ble_gap_adv_stop()) takes about 5-30ms. I didn't expect this call to be blocking and take this long.

Are there any suggestions as to how to update the parameters in a quicker way?

Parents
  • Hmm, for me, the function gets executed in an app_sched_execute(), in the main loop. I also measured it like so:

    nrf_gpio_pin_set(TEST_PIN);
    err_code = sd_ble_gap_adv_stop();
    nrf_gpio_pin_clear(TEST_PIN);
    

    Optimization: -Os

    A lot of other things are happening too in the meanwhile though, like meshing. I guess I'll try to pinpoint when it takes so long to execute.

Reply
  • Hmm, for me, the function gets executed in an app_sched_execute(), in the main loop. I also measured it like so:

    nrf_gpio_pin_set(TEST_PIN);
    err_code = sd_ble_gap_adv_stop();
    nrf_gpio_pin_clear(TEST_PIN);
    

    Optimization: -Os

    A lot of other things are happening too in the meanwhile though, like meshing. I guess I'll try to pinpoint when it takes so long to execute.

Children
No Data
Related