I'm having a advertising device and then I want to stop advertising and prevent BLE connection from device that would have received the advertisement. It seems to work by using this:
err_code = sd_ble_gap_adv_stop(m_advertising.adv_handle);
nrf_sdh_disable_request();
Problem appears when I want to start advertising again. When I using this:
err_code = nrf_sdh_enable_request();
APP_ERROR_CHECK(err_code);
err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
In ble_advertising_start(...) sd_ble_gap_adv_set_configure(...) return 0x3001 (having a doubt about the error code but can't reproduce right now). How should I proceed to prevent BLE connection. Should I force disconnection on connect event or there's a nicer wait to do it? Using s132 SDK 15.3
Thank you for your help!