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

Calling sd_ble_gap_adv_stop() does not emit an on_adv_evt event

I'm a bit at a loss of how to voluntarily stop advertising:
My related thread says I should call sd_ble_gap_adv_stop(), but when I do, no corresponding event is raised by the soft-device. This ultimately means that on_adv_evt() in main.c does not get called, the static m_adv_mode_current in ble_advertising.c does not change state to BLE_ADV_MODE_IDLE, and the ble_advertising module in an unmatching state.

How can I overcome this? Is the only way to reliably stop advertising is to wait for it to time-out?

Version: nRF5 SDK 11.0.0, s132, with PCA10040 EVB

Parents
  • The Advertising Module can be used for many typical "Connectable Advertising" scenarios, but if you want other functionality you are free to modify it, or not use it at all.

    You can set the advertising data with ble_advdata_set(), and then call sd_ble_gap_adv_start() with the parameters you like. Maybe you want to advertise forever, and always stop it manually with sd_ble_gap_adv_stop()?

  • it's simple to menage adv_stop OR timeout but if i want use both, i have a problem that one i stopped it with sd_ble_ga_adv_stop(), after the timeout expired and try to stop again the advertising and give an error. So two question

    • What's means " it is easier the sd *API directly "
    • How when the evt timeout arrived from softdevice the advertising is stopped, i don't see that in the loop Fast_slow_idle the function is called.
Reply
  • it's simple to menage adv_stop OR timeout but if i want use both, i have a problem that one i stopped it with sd_ble_ga_adv_stop(), after the timeout expired and try to stop again the advertising and give an error. So two question

    • What's means " it is easier the sd *API directly "
    • How when the evt timeout arrived from softdevice the advertising is stopped, i don't see that in the loop Fast_slow_idle the function is called.
Children
No Data
Related