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

Examples for enabling/disabling of BLE SoftDevice

So far I haven't run across any code examples that will switch the BLE (S110) stack in and out. I'm looking to test enabling and disabling of the softdevice to see how that works with a separate protocol that uses the radio. So far simply calling sd_softdevice_enable after calling sd_softdevice_disable doesn't seem to completely re-enable the soft device.

Any suggestions?

Parents
  • You can refer to ble_app_gzll in the SDK, which does such toggling.

    However, what do you mean that it doesn't seem to re-enable it completely? There are no intermediate steps; either enabling succeeds or it fails. Do you check the error code returned by the second enable? Could it be that you have some interrupts enabled with an illegal interrupt configuration (i.e. have enabled one of the interrupts that the softdevice needs, or have another interrupt with priority 0)? If so, enable will return NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION.

  • Be aware that enabling the softdevice is not sufficient to discover the device, you also have to start advertising, so if you don't do that, you won't be able to discover the device. If you have further problems, I'd be happy if you could edit your original question and supply the code you're working with, so I can test it here.

Reply Children
No Data
Related