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.

  • Thanks for mentioning a project I can use as an example. I apologize, I wasn't very clear in my message regarding re-enabling. I only meant that I modified the ble_app_lbs example so that Button 0 when pressed disables the softdevice and when pressed again re-enables it. I tested only at a high level, trying to see if the device could be discovered again using the Master Control Panel. I am in the process of setting up an Eclipse project for this code so that I can debug a little further. It's quite possible I did something wrong.

Reply
  • Thanks for mentioning a project I can use as an example. I apologize, I wasn't very clear in my message regarding re-enabling. I only meant that I modified the ble_app_lbs example so that Button 0 when pressed disables the softdevice and when pressed again re-enables it. I tested only at a high level, trying to see if the device could be discovered again using the Master Control Panel. I am in the process of setting up an Eclipse project for this code so that I can debug a little further. It's quite possible I did something wrong.

Children
No Data
Related