Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Enable/Disable Bluetooth.

Hi,

I use nRF5 SDK v15.0.0. In my application I need periodically disable and enable Bluetooth because they are wifi also, which connected to the same antenna. Its mean the receiver of the Bluetooth also mast be disabled. For that I completely disable and enable the SoftDevice, but it takes a long time.

Otherwise how I can disable Bluetooth? If I only stopped advertising, then Bluetooth receiver disabled or not?

Thanks.

Parents
  • Hi.

    You can SoftDevice API's that you can use without disabling the SoftDevice here. Here is also a message sequence chart for peripheral connection establishment and termination.

    You can start/stop advertising using sd_ble_gap_adv_start() and sd_ble_gap_adv_stop(). If you are in a connection you can use sd_ble_gap_disconnect() to disconnect from the central. In the ble_app_uart example, use the bsp_event_handler() in main.c to implement the functionality you want on different button events.

    - Andreas

Reply
  • Hi.

    You can SoftDevice API's that you can use without disabling the SoftDevice here. Here is also a message sequence chart for peripheral connection establishment and termination.

    You can start/stop advertising using sd_ble_gap_adv_start() and sd_ble_gap_adv_stop(). If you are in a connection you can use sd_ble_gap_disconnect() to disconnect from the central. In the ble_app_uart example, use the bsp_event_handler() in main.c to implement the functionality you want on different button events.

    - Andreas

Children
Related