<?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>Beacon wake up , Advertise, sleep on Switch Press</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15191/beacon-wake-up-advertise-sleep-on-switch-press</link><description>Hello, 
 We do not want our beacon on at all times. I suppose our need below has been asked before. 
 Is there a sample snippit of code, or a document on ble_app_beacon to help us execute this small main.c change? 
 ble_stack_init();
advertising_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Jul 2016 08:35:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15191/beacon-wake-up-advertise-sleep-on-switch-press" /><item><title>RE: Beacon wake up , Advertise, sleep on Switch Press</title><link>https://devzone.nordicsemi.com/thread/58000?ContentTypeID=1</link><pubDate>Wed, 20 Jul 2016 08:35:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52362768-f0a7-41e0-b3cf-8b56e8b2ab64</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;&amp;quot;nrf_delay_ms&amp;quot; declared implicity: you need to include nrf_delay.h in the file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;quot;nrf_delay.h`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The enumerated type mixed with another type warning was my fault, use this code instead:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_cfg_sense_input(BSP_BUTTON_0, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is exactly the same (see the definitions for &lt;code&gt;NRF_GPIO_PIN_PULLUP&lt;/code&gt; and &lt;code&gt;NRF_GPIO_PIN_SENSE_LOW&lt;/code&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon wake up , Advertise, sleep on Switch Press</title><link>https://devzone.nordicsemi.com/thread/57999?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 15:43:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a41bf47d-b1a9-41a2-b3de-3912e93b0a20</guid><dc:creator>CT_Engr</dc:creator><description>&lt;p&gt;Your answer was perfect. Thank you. I took the main.c code and started to use it as an example... then realized it was already fully working. Thanks for not just suggesting idea, but executing a working solution.&lt;/p&gt;
&lt;p&gt;We have updated this now to do our Major/Minor updates on button press and other changes needed and its all good :)&lt;/p&gt;
&lt;p&gt;I have 1 question to follow up.&lt;/p&gt;
&lt;p&gt;We are getting some compile time warnings and I suspect I have an ARM linker issue. Can you look at the attached screen shot and suggest the right way to remove these warning?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.dropbox.com/s/or0f66r90c996xz/SNAG-0003.jpg?dl=0"&gt;www.dropbox.com/.../SNAG-0003.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks J&lt;/p&gt;
&lt;p&gt;......\main.c(146): warning: #223-D: function &amp;quot;nrf_delay_ms&amp;quot; declared implicitly nrf_delay_ms(100);
......\main.c(149): warning: #188-D: enumerated type mixed with another type    nrf_gpio_cfg_sense_input(BSP_BUTTON_0, GPIO_PIN_CNF_PULL_Pullup, GPIO_PIN_CNF_SENSE_Low);   ......\main.c(149): warning: #188-D: enumerated type mixed with another type nrf_gpio_cfg_sense_input(BSP_BUTTON_0, GPIO_PIN_CNF_PULL_Pullup, GPIO_PIN_CNF_SENSE_Low); ......\main.c(151): warning: #188-D: enumerated type mixed with another type nrf_gpio_cfg_sense_input(BSP_BUTTON_1, GPIO_PIN_CNF_PULL_Pullup, GPIO_PIN_CNF_SENSE_Low); ......\main.c(151): warning: #188-D: enumerated type mixed with another type nrf_gpio_cfg_sense_input(BSP_BUTTON_1, GPIO_PIN_CNF_PULL_Pullup, GPIO_PIN_CNF_SENSE_Low);&lt;/p&gt;
&lt;p&gt;......\main.c: 5 warnings, 0 errors&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Beacon wake up , Advertise, sleep on Switch Press</title><link>https://devzone.nordicsemi.com/thread/57998?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 12:34:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51d507c3-fb67-4e27-ab35-42994e27075d</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can set the device to advertise for 1 second. When you get the BLE_GAP_EVT_TIMEOUT event from the SoftDevice (after 1 second of advertising) you can enter SYSTEM OFF sleep mode with GPIO wakeup. When the system wakes up from SYSTEM OFF sleep mode it will do a reset and hence start advertising for one second again. See this main file used for the ble_app_beacon example in SDK: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7534.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you don’t want to reset when you wake up you can enter SYSTEM ON sleep mode (draws a couple of uA more than SYSTEM OFF sleep mode) with sd_app_evt_wait(). Configure gpio to give you interrupt on change (see pin_change_int example in SDK for this) and start advertise again for 1 second.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>