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

Turn ON and OFF BLE

I am using S132v2 on nrf52831. I am using UART BLE application. I want to turn ON BLE meaning advertising and all parameter of BLE whenever i press any switch. Also bluetooth should get turn OFF when i press another switch. How can i achieve this?What all API's are there to turn ON and OFF bluetooth?

Parents
  • Hi,

    You can find the relevant SoftDevice API functions here. 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.

Reply
  • Hi,

    You can find the relevant SoftDevice API functions here. 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.

Children
No Data
Related