<?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>periodic configuration of Advertisement and sleep</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32252/periodic-configuration-of-advertisement-and-sleep</link><description>I want advertise the peripheral periodically only. i implement the logic it is working fine.but my doubt is once i connected to connected to central device advertise is no need.but after stopping the advertisement the device is disconnecting automatically</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Mar 2018 15:45:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32252/periodic-configuration-of-advertisement-and-sleep" /><item><title>RE: periodic configuration of Advertisement and sleep</title><link>https://devzone.nordicsemi.com/thread/124805?ContentTypeID=1</link><pubDate>Fri, 16 Mar 2018 15:45:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d2ba475-5669-4601-9dae-0303914026b5</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is impossible to say what is the disconnect reason based only on the piece of code you attached.&lt;/p&gt;
&lt;p&gt;What board (development kit) are you using?&lt;/p&gt;
&lt;p&gt;What version of the SDK are you using?&lt;/p&gt;
&lt;p&gt;Have you built the project from an SDK example project? Which one?&lt;/p&gt;
&lt;p&gt;It may be that the board resets, because of APP_ERROR_CHECK() detecting an error. This is very useful, as it lets you debug and figure out what line and what error code you get. Have a look at &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10729/my-device-is-freezing-and-restarting"&gt;My device is freezing and restarting&lt;/a&gt;. File, line and error code would be very useful for figuring out what happens.&lt;/p&gt;
&lt;p&gt;Can you provide a log from running the program? (In SDK 12 or later you enable logging in sdk_config.h, it is the NRF_LOG_ENABLED setting. You then choose either the NRF_LOG_BACKEND_SERIAL_USES_UART or the NRF_LOG_BACKEND_SERIAL_USES_RTT, depending on if you want to log over UART or over RTT. See for instance &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/16979/where-can-i-see-nrf_log-output"&gt;this thread&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;If possible, can you provide a &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer/(language)/eng-GB"&gt;sniffer log&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;I highly recommend using the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.3.0%2Flib_ble_advertising.html"&gt;Advertising Module&lt;/a&gt; for advertising. It will automatically cycle through the enabled advertising modes and then end up in &amp;quot;idle&amp;quot; which means no advertising. You can also set a mode to never time out, which means you will stay in that advertising mode indefinitely. (Or, in the case of connectable advertising, it will stop advertising when it connects.) Have a look at any BLE peripheral example in the SDK to see usage examples of the Advertising Module.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>