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.
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.
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.
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.