<?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 auto connect  and disconnect when we need send the data</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43892/how-to-auto-connect-and-disconnect-when-we-need-send-the-data</link><description>hi.... 
 i am using nrf52382 and segger 15.2 version , i want my peripheral to send the data only if it reaches the certain limit (threshold value) on that case it should start auto connecting with central , it should start advertise and pair, after sending</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Feb 2019 09:50:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43892/how-to-auto-connect-and-disconnect-when-we-need-send-the-data" /><item><title>RE: how to auto connect  and disconnect when we need send the data</title><link>https://devzone.nordicsemi.com/thread/172060?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 09:50:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c5aca97-fa78-499e-8a40-389d1cb05fae</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The peripheral can start the advertising once a certain criteria has been met. But the establishment of connection by sending a connection request has to be done by the central. This means that the central has to be scanning once the peripheral starts the advertising. You can use scanning with whitelist to avoid the central to connect to other devices. You could try the following approach:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start scanning.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Start advertising once your criteria for advertising has been met,&lt;/li&gt;
&lt;li&gt;Central connects once advertising packet has been received from peripheral in the whitelist.&lt;/li&gt;
&lt;li&gt;Data exchange&lt;/li&gt;
&lt;li&gt;Termination of link and go to sleep&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I would recommend reading our&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy"&gt; tutorials on BLE &lt;/a&gt;to get a better understanding of which callback functions you should use.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>