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
  • I re-opened this because it seemed better than posting a new question on the same topic.

    Basically, I'm getting stuck because I don't fully appreciate or understand some subtleties of the ble_app_lbs demo and the usage of the scheduler. What I've done is to modify this to look a little bit more like ble_app_gzll. What I mean by that is I have added functions to start and stop ble, similar to the ble_app_gzll. I've also modified the startup in main to use ble_lbs_start. I modified buttons_init so that the wakeup_button is now tied into the button_event_handler and it is supposed to toggle the ble stack on or off with each press. I've attached the source files here if someone wants to take a stab at pointing out what I'm doing wrong.

    The device comes up just fine and can be connected to with the Master Control Panel. When I hit the wakeup button (button 0), the stack goes away but there is no GPIO toggle when I hit the button a second time. The event isn't getting to the handler.

    main.c

  • Thanks Ole! I definitely overlooked the obvious difference in how to sleep in the power_manage function. Thanks for pointing that out. I've not been using GDB to debug so this was taking me longer to figure out than I'd like. I really need to get that (GDB) working again.

    Marking this resolved again.

Reply Children
No Data
Related