Hi
I have a requirement to be able to re-start advertising with new parameters when told to do so over a Slave SPI interface. From other posts, it appears that there is no way to 'de-init' the soft-device - eg to remove and re-add services. Rather, the SD must be disabled and then re-initialised.
SDK 15.2, Soft device 132 V6.1
My new parameters consist of a new MAC address and a new service UUID (this is generated randomly, and used to uniquely identify an advertising device. The mobile learns the device MAC and GUID via NFC. Also in my advertising data is a mask detailing which of my three apps may connect at any time. The device is a medical product with both patient and clinician apps. I need to prevent the use of the clinician app in certain runtime modes.
My StartAdvertising(), and ble_stack_init() is as follows. The crash happens in err_code = nrf_sdh_enable_request(); which returns NRF_ERROR_INVALID_STATE 0x08
Hoping someone has an idea of how to resolve the crash, my backup plan is to have the Nordic MCU reset (via SPI command from its master) and then await new config from the master, but that's a right pain. Restarting the SD without rebooting the MCU should work somehow.
NB - the ability to stop advertising, remove services, change manuf specific data and then restart advertising WITHOUT killing off and re-initialising the soft device would be a nice addition for a future SDK.