<?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>Going from Slow Advertise to Fast Advertise with button press</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58437/going-from-slow-advertise-to-fast-advertise-with-button-press</link><description>Hi, Is it possible to go from slow advertising to fast advertising with a button press? I did this but it didn&amp;#39;t work: 
 P.S. I slightly modified names and operation of my LED indication modes but I can clearly distinguish the two and pressing the button</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Feb 2020 19:05:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58437/going-from-slow-advertise-to-fast-advertise-with-button-press" /><item><title>RE: Going from Slow Advertise to Fast Advertise with button press</title><link>https://devzone.nordicsemi.com/thread/237239?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 19:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ebb6df3-d368-4164-a417-f79f71436b4a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Is it possible to go from slow advertising to fast advertising with a button press?[/quote]
&lt;p&gt;I don&amp;#39;t see exactly how the code snippet is related to the question, but yes, that is possible. You need some code for getting an event on the button press (for instance using the BSP module), and when you get the button press you can first stop any current advertisers with a call to sd_ble_gap_adv_stop() ignoring the return value in this case so that it will work regardless if it was active or not, and then call&amp;nbsp;ble_advertising_start() with&amp;nbsp;&lt;span style="font-family:inherit;"&gt;BLE_ADV_MODE_FAST as the second parameter.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;If you want an example, you can refer to&amp;nbsp;one of the examples that let you push a button to restart advertising without whitelisting. You could simply replace the call to ble_advertising_restart_without_whitelist() with&amp;nbsp;what I suggested above.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>