<?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>BluetoothLeAdvertiser.stopAdvertising() causes device to disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41123/bluetoothleadvertiser-stopadvertising-causes-device-to-disconnect</link><description>I develop an Android app which connects to a Nordic chip, and I cannot get the Android app to stop advertising once it connects to the central from the SDK multi link project. 
 I was curious if any one from Nordic might be able to have some insight into</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Dec 2018 14:45:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41123/bluetoothleadvertiser-stopadvertising-causes-device-to-disconnect" /><item><title>RE: BluetoothLeAdvertiser.stopAdvertising() causes device to disconnect</title><link>https://devzone.nordicsemi.com/thread/160420?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 14:45:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a335fde-ad25-4287-a777-5c43ac7abf41</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Btw, there are some phones, for example Meizu 2 with Android 5.1, where calling `server.connect(device, autoConnect)` will actually call `onConnectionStateChanged callback again. So make sure you don&amp;#39;t fall into a loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BluetoothLeAdvertiser.stopAdvertising() causes device to disconnect</title><link>https://devzone.nordicsemi.com/thread/160417?ContentTypeID=1</link><pubDate>Wed, 05 Dec 2018 14:38:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59d36751-2214-40e5-a5b6-432d22f75333</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;First of all, sorry for the devzone experience. Don&amp;#39;t know what to say, I&amp;#39;m not responsible for this &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Coming to your question: advertising is independent from the connections. On Android a phone may actually advertise with many different advertising sets, each with a different, changing from time to time address, etc. You control advertising separately from connections.&lt;/p&gt;
&lt;p&gt;Your approach to stop advertising when a remote device connects is correct. Remember to call `server.connect(device, autoConnect)` after a device connected. This is to let the system know that you&amp;#39;re now going to use the connection, otherwise the system may close it if you don&amp;#39;t do `device.connectGatt(...)` (which also tells the system, that you will actively use the connection in your app). When you are done, call `server.cancelConnection(device)`. If `server.connect(...)` won&amp;#39;t help, call `connectGatt(..)` to get access to the device`s services.&lt;/p&gt;
&lt;p&gt;Stopping advertising should not disconnect anything, just like it doesn&amp;#39;t disconnect in nRF Connect when you stop advertising. It may be either the automatic disconnection, which happens a second after last client disconnected (or when your device connected, but no client connected to it), or some mistake in your code.&lt;/p&gt;
&lt;p&gt;Hope that helped!&lt;/p&gt;
&lt;p&gt;BR, Aleksander&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BluetoothLeAdvertiser.stopAdvertising() causes device to disconnect</title><link>https://devzone.nordicsemi.com/thread/159827?ContentTypeID=1</link><pubDate>Sat, 01 Dec 2018 22:35:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed41db43-29d5-4bcc-a98b-4296b60f6c63</guid><dc:creator>MichaelNordicUser</dc:creator><description>&lt;p&gt;I can&amp;#39;t even edit my own post, this new Q&amp;amp;A website is regression from the previous version IMO. I almost don&amp;#39;t even want to ask for help.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>