<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How can I disconnect Bluetooth connection by pressing button on board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75313/how-can-i-disconnect-bluetooth-connection-by-pressing-button-on-board</link><description>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.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 May 2021 14:33:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75313/how-can-i-disconnect-bluetooth-connection-by-pressing-button-on-board" /><item><title>RE: How can I disconnect Bluetooth connection by pressing button on board</title><link>https://devzone.nordicsemi.com/thread/310524?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 14:33:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32254402-8a00-4a12-a776-6e8ebf0a5ebd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I assume you are using SDK v17.0.&amp;nbsp;&lt;br /&gt;In&amp;nbsp;&lt;span&gt;ble_app_uart&amp;nbsp;example this feature is already implemented. You can find that in&amp;nbsp;bsp_event_handler(). When you press button&amp;nbsp;BTN_ID_DISCONNECT it will disconnect.&amp;nbsp;&lt;br /&gt;Currently it&amp;#39;s the same button as&amp;nbsp;BTN_ID_SLEEP = 0 ( value 0 means button 1) . But if you don&amp;#39;t want to sleep after disconnect, you can change&amp;nbsp;BTN_ID_DISCONNECT&amp;nbsp; to 3 (button 4)&amp;nbsp; in bsp_btn_ble.c , for example.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>