<?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>Can&amp;#39;t connect central to peripheral after peripheral resets</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/101867/can-t-connect-central-to-peripheral-after-peripheral-resets</link><description>I am working on a project for the nrf5430 audio DKs which involves having a central device establish an ACL connect with a peripheral device. 
 The central device can itself connect and disconnect from the peripheral device without issues. 
 However,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Jul 2023 08:00:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/101867/can-t-connect-central-to-peripheral-after-peripheral-resets" /><item><title>RE: Can't connect central to peripheral after peripheral resets</title><link>https://devzone.nordicsemi.com/thread/436907?ContentTypeID=1</link><pubDate>Tue, 18 Jul 2023 08:00:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0604e27d-1a5d-4e26-9110-c482fca23314</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I have tested button reset on our&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/central_uart/README.html#bluetooth-central-uart"&gt;central UART&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_uart/README.html#bluetooth-peripheral-uart"&gt;peripheral UART&lt;/a&gt;&amp;nbsp;samples and connection was automatically established after the reset. It did not matter if the reset was performed on peripheral or central device. There was no need for reboot.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect central to peripheral after peripheral resets</title><link>https://devzone.nordicsemi.com/thread/436562?ContentTypeID=1</link><pubDate>Fri, 14 Jul 2023 19:55:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60fd61d4-1b37-4ba1-94d0-aca68269b2c1</guid><dc:creator>mul</dc:creator><description>&lt;p&gt;I&amp;#39;ve added my &lt;em&gt;disconnect()&lt;/em&gt;&amp;nbsp;function to the post above.&lt;/p&gt;
&lt;p&gt;When this is called on the central, it executes fine, disconnects, then the &lt;em&gt;disconnected()&lt;/em&gt; callback gets invoked also.&lt;/p&gt;
&lt;p&gt;I can then call &lt;em&gt;connect()&lt;/em&gt; again after this without a reset and it connects again to the peripheral.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m just struggling to understand why, when the peripheral causes the disconnect itself, the &lt;em&gt;disconnected()&lt;/em&gt; callback on the central gets invoked in the same way, but can&amp;#39;t &lt;em&gt;connect()&lt;/em&gt; again afterwards until I reboot the central.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect central to peripheral after peripheral resets</title><link>https://devzone.nordicsemi.com/thread/436560?ContentTypeID=1</link><pubDate>Fri, 14 Jul 2023 19:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58e16572-2dd5-4db0-b330-5fc9bf2bf38d</guid><dc:creator>mul</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/dejans"&gt;dejans&lt;/a&gt;&amp;nbsp;Thanks for your reply. When I start scanning from the disconnected() callback, then try to connect again, I now get&amp;nbsp;&lt;strong&gt;Connection failed. Error : -11 &lt;/strong&gt;meaning&amp;nbsp;No more contexts&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't connect central to peripheral after peripheral resets</title><link>https://devzone.nordicsemi.com/thread/436558?ContentTypeID=1</link><pubDate>Fri, 14 Jul 2023 18:41:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2c18473-7c8e-46e9-ac29-aaf332b790a9</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You could try adding the lines below to your disconnected() callback:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;err = bt_scan_start(BT_SCAN_TYPE_SCAN_ACTIVE);
	if (err) {
		LOG_ERR(&amp;quot;Scanning failed to start (err %d)&amp;quot;,
			err);
	}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As a reference, you could have a look at&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/samples/bluetooth/central_uart/src/main.c#L416-L420"&gt;central UART&lt;/a&gt; sample.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>