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

stop Ble advertising

I want to stop advertising for 8 hours but when I use

		sd_ble_gap_adv_stop();
		sd_ble_gap_connect_cancel();

It starts advertising after 1 or 2 secends again. I think SoftDevice start that but how I stop or start that manually without SD management?

Parents
  • You are sure you are not running into an error condition and reset? See this. sd_ble_gap_connect_cancel() is used during connection establishment, you should rather use sd_ble_gap_disconnect(). Also the order is wrong, this is the correct way to do it:

    • Disconnect
    • Wait for disconnect event (BLE_GAP_EVT_DISCONNECTED)
    • Stop advertising (the advertising module will start advertising on disconnect, see ble_advertising_on_ble_evt(..) function. Alternatively you can avoid start advertising).
Reply
  • You are sure you are not running into an error condition and reset? See this. sd_ble_gap_connect_cancel() is used during connection establishment, you should rather use sd_ble_gap_disconnect(). Also the order is wrong, this is the correct way to do it:

    • Disconnect
    • Wait for disconnect event (BLE_GAP_EVT_DISCONNECTED)
    • Stop advertising (the advertising module will start advertising on disconnect, see ble_advertising_on_ble_evt(..) function. Alternatively you can avoid start advertising).
Children
No Data
Related