<?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>BLE advertisement stops after connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112131/ble-advertisement-stops-after-connection</link><description>Hi Devzone, 
 I am facing an issue in my application where my device is working as a BLE peripheral advertising for connection. The device stops advertising after connecting to it for the 2nd time and doesn&amp;#39;t recover advertising even after disconnection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 15 Jun 2024 19:45:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112131/ble-advertisement-stops-after-connection" /><item><title>RE: BLE advertisement stops after connection</title><link>https://devzone.nordicsemi.com/thread/488954?ContentTypeID=1</link><pubDate>Sat, 15 Jun 2024 19:45:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:badbafc1-b48b-46c1-b5cb-3fa85b8b7291</guid><dc:creator>aman111</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;Fixed it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;(I&amp;#39;m writing this from bed after I realized the fix(mistake) in my sleep)&lt;/p&gt;
&lt;p&gt;Mistake was use of&amp;nbsp;bt_conn_ref in the connected callback on line 87. The application is taking the connection reference and not dereferencing it which is required in this case as the function increments the counter. As soon as the counter is incremented to 2, there&amp;#39;s no need to advertise and hence we get the error on data update.&lt;br /&gt;&lt;br /&gt;Thanks &lt;a href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;&amp;nbsp;for looking into the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertisement stops after connection</title><link>https://devzone.nordicsemi.com/thread/488873?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 12:59:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20c447c5-f419-47f4-abae-12f2358621d3</guid><dc:creator>aman111</dc:creator><description>&lt;p&gt;Also note that this is happening not when all 2 or 3 connections are made at the same time, rather when connecting for the second time after disconnection. Number of connections remains max 1 at all times.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertisement stops after connection</title><link>https://devzone.nordicsemi.com/thread/488866?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 12:44:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f556639-1200-468a-9ff9-575ff5e44814</guid><dc:creator>aman111</dc:creator><description>&lt;p&gt;No errors being observed in start or stop of advert. Also tried checking if bt peripheral is working using bt_is_ready() which returned true every time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE advertisement stops after connection</title><link>https://devzone.nordicsemi.com/thread/488861?ContentTypeID=1</link><pubDate>Fri, 14 Jun 2024 12:32:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a9265ae-bb53-46fb-9690-2e9cac2816c3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Are you getting any error codes returned from&amp;nbsp;bt_le_adv_start() when this happens?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>