<?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>Bluetooth Codded PHY couldn&amp;#39;t connect after disconnecting. W: Found valid connection in disconnected state</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68150/bluetooth-codded-phy-couldn-t-connect-after-disconnecting-w-found-valid-connection-in-disconnected-state</link><description>I am working with: 
 NRF52840 boards 
 nRF Connect SDKwith Zephyr 
 On Ubuntu 
 Desired behaviour would be: 
 
 Establish connection with Codded PHY 
 After some time disconnect 
 Connect back to the device in the same way as it was done in step 1. (with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Nov 2020 09:20:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68150/bluetooth-codded-phy-couldn-t-connect-after-disconnecting-w-found-valid-connection-in-disconnected-state" /><item><title>RE: Bluetooth Codded PHY couldn't connect after disconnecting. W: Found valid connection in disconnected state</title><link>https://devzone.nordicsemi.com/thread/279650?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2020 09:20:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74c262fb-06a5-47c5-98c3-f7b2add30741</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Glad you were able to figure it out!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth Codded PHY couldn't connect after disconnecting. W: Found valid connection in disconnected state</title><link>https://devzone.nordicsemi.com/thread/279566?ContentTypeID=1</link><pubDate>Wed, 11 Nov 2020 16:07:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:248d3b52-bf5a-4dad-b0ec-01059839c02f</guid><dc:creator>vasilje</dc:creator><description>&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;Thanks a lot for pointing out those sample projects. I was able to find the problem. The problem was that I had this code in function&amp;nbsp;&lt;span style="text-decoration:underline;"&gt;scan_filter_match: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	err = bt_conn_le_create(device_info-&amp;gt;recv_info-&amp;gt;addr, conn_params,
				BT_LE_CONN_PARAM_DEFAULT,
				&amp;amp;default_conn);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And then in &lt;span style="text-decoration:underline;"&gt;connected&lt;/span&gt; callback I had this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;default_conn = bt_conn_ref(conn);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Meaning that I was ending up with 2 references after every connection.&lt;/p&gt;
&lt;p&gt;So when I was deleting the reference from &lt;span style="text-decoration:underline;"&gt;default_conn&lt;/span&gt; there was always one reference left. Thats why it was finding it on reconnection and giving the previously mentioned error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth Codded PHY couldn't connect after disconnecting. W: Found valid connection in disconnected state</title><link>https://devzone.nordicsemi.com/thread/279220?ContentTypeID=1</link><pubDate>Tue, 10 Nov 2020 11:56:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb48a7ea-c48d-4d08-bc51-0fb59b796c95</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What sample projects are you using? I would suggest checking out the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_hr_coded/README.html"&gt;peripheral_hr_coded &lt;/a&gt;and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/central_hr_coded/README.html"&gt;central_hr_coded &lt;/a&gt;sample projects. Do you start advertising again after a disconnected event in the peripheral device? You can check if it starts advertising again or not by checking the disconnected() call in main.c.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>