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

How can I disconnect Bluetooth connection by pressing button on board

i am using ble_app_uart example on nRF52833 board. I want to make a function that whenever I press button 1 on board, the board will disconnect Bluetooth connection with my phone. How can I implement that function? Thank you.

Parents
  • Hi,

    I assume you are using SDK v17.0. 
    In ble_app_uart example this feature is already implemented. You can find that in bsp_event_handler(). When you press button BTN_ID_DISCONNECT it will disconnect. 
    Currently it's the same button as BTN_ID_SLEEP = 0 ( value 0 means button 1) . But if you don't want to sleep after disconnect, you can change BTN_ID_DISCONNECT  to 3 (button 4)  in bsp_btn_ble.c , for example. 

Reply
  • Hi,

    I assume you are using SDK v17.0. 
    In ble_app_uart example this feature is already implemented. You can find that in bsp_event_handler(). When you press button BTN_ID_DISCONNECT it will disconnect. 
    Currently it's the same button as BTN_ID_SLEEP = 0 ( value 0 means button 1) . But if you don't want to sleep after disconnect, you can change BTN_ID_DISCONNECT  to 3 (button 4)  in bsp_btn_ble.c , for example. 

Children
No Data
Related