<?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>I&amp;#39;d like to cut off the Bluetooth connection and stop advertising.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69331/i-d-like-to-cut-off-the-bluetooth-connection-and-stop-advertising</link><description>Hello 
 I&amp;#39;m using nrf52832 and sdk v17.0 and I&amp;#39;m testing in the example of ble_app_uart. 
 I&amp;#39;m creating a feature that Bluetooth disconnecting and then stops advertising. I use &amp;#39;sd_ble_gap_disconnect&amp;#39; and &amp;#39;adverting_stop&amp;#39; to do these two things. There</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Dec 2020 00:51:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69331/i-d-like-to-cut-off-the-bluetooth-connection-and-stop-advertising" /><item><title>RE: I'd like to cut off the Bluetooth connection and stop advertising.</title><link>https://devzone.nordicsemi.com/thread/284424?ContentTypeID=1</link><pubDate>Fri, 11 Dec 2020 00:51:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ffed4f4-201f-4761-b366-614e00e2ce87</guid><dc:creator>schosdas</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;I succeeded by running on the loop() using the flag variable and using a delay between the two functions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I'd like to cut off the Bluetooth connection and stop advertising.</title><link>https://devzone.nordicsemi.com/thread/284340?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 13:47:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47638369-71dc-48c0-9f62-647d64f76026</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which of the functions returns an error, and what is the error code?&lt;/p&gt;
&lt;p&gt;When you tested the functions separately, did you call them from&amp;nbsp;nus_data_handler() as well, or from main context? If the handler runs at a priority above 4, you will not be allowed to call SD APIs. In that case, try setting a flag in the handler and call the functions in main loop whenever the flag is set.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>