<?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 to disconnect/Disable BLE peripheral Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92513/how-to-disconnect-disable-ble-peripheral-zephyr</link><description>I have a use case where a Peripheral requires to disconnect itself from the Central. Is this possible? I have tried using the peripheral_hr example and modified as follows 
 
 https://github.com/vChavezB/peripheral_disconnect/blob/main/main.c 
 
 I am</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Oct 2022 13:39:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92513/how-to-disconnect-disable-ble-peripheral-zephyr" /><item><title>RE: How to disconnect/Disable BLE peripheral Zephyr</title><link>https://devzone.nordicsemi.com/thread/389014?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 13:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5423a1c5-2af6-45d4-8384-d5238859504f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for updating your ticket. Yes, you need to select one of the listed disconnect reasons (&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/f252fac960bf2806bf66815f292b5586c38b9f34/include/zephyr/bluetooth/conn.h#L516"&gt;link&lt;/a&gt;), and&amp;nbsp; BT_HCI_ERR_REMOTE_USER_TERM_CONN is usually the one you want if you just want to terminate a connection.&lt;/p&gt;
[quote userid="117198" url="~/f/nordic-q-a/92513/how-to-disconnect-disable-ble-peripheral-zephyr/388868"]The disable error seems to be that the NRF52833 DK does not support the api bt_disable[/quote]
&lt;p&gt;Yes, you are right. The disable API is supported by the BT host, but not our controller. That is why it returns with -ENOTSUP / -134. But are you sure you need to disable the stack in your case? In most cases it is sufficient to stop or pause ongoing BLE tasks such as advertising.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to disconnect/Disable BLE peripheral Zephyr</title><link>https://devzone.nordicsemi.com/thread/388868?ContentTypeID=1</link><pubDate>Sat, 01 Oct 2022 18:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:731b542e-409c-440f-8b4d-2f85147d0faa</guid><dc:creator>vcbz</dc:creator><description>&lt;p&gt;Ok I think I solved it.&lt;br /&gt;Disconnection error reason needs to be BT_HCI_ERR_REMOTE_USER_TERM_CONN as mentioned in another post and in the zephyr API docs.&lt;br /&gt;The disable error seems to be that the NRF52833 DK does not support the api bt_disable&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>