<?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>sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11233/sleep-mode-in-nrf51822</link><description>from this post link text i have again doubt 
 i define #define APP_ADV_TIMEOUT_IN_SECONDS 10. now my advertising stops after 10 sec.but i want to restart it again then??</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Jan 2016 13:20:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11233/sleep-mode-in-nrf51822" /><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42173?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2016 13:20:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f260cc6a-f844-4478-8353-74d5d220c398</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;can you tell me that why my LED is not becoming ON??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42170?ContentTypeID=1</link><pubDate>Tue, 12 Jan 2016 10:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40e3d24f-39e5-403f-ae0a-ccdc390c3e19</guid><dc:creator>Marco Russi</dc:creator><description>&lt;p&gt;My proposed solution allows you to start again advertising after 10 s so the device will never stop to advertise. It doesn&amp;#39;t go in sleep mode. Indeed as far as I know the device can not go in sleep mode and advertise at the same time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42171?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2016 18:28:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31b323e4-81cf-40fb-962b-bbb4f14be100</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;i can&amp;#39;t understand solution. i want to make it in sleep mode and then advertise again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42175?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2016 18:23:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ffa778e1-512d-45d0-8c76-a79bb6e65456</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;but after my advertising stops. my LED does not becom on&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42174?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2016 18:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93b5b6e0-4f2d-430e-aa3c-4a8b47e558c1</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t                         err_code;
    
    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            break;
            
        case BLE_GAP_EVT_DISCONNECTED:
            err_code = bsp_indication_set(BSP_INDICATE_IDLE);
            APP_ERROR_CHECK(err_code);
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            break;

        case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
            // Pairing not supported
            err_code = sd_ble_gap_sec_params_reply(m_conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTS_EVT_SYS_ATTR_MISSING:
            // No system attributes have been stored.
            err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
            APP_ERROR_CHECK(err_code);
            break;
				case BLE_GAP_EVT_TIMEOUT:
					//printf(&amp;quot;rushin&amp;quot;);
				LEDS_ON(BSP_LED_1_MASK);
				 break;
        default:
            // No implementation needed.
            break;
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42169?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2016 16:19:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8dc8326-1a4e-4606-8e1e-7d880700551f</guid><dc:creator>Marco Russi</dc:creator><description>&lt;p&gt;Hi, just add advertising start function call on idle event. See here below:&lt;/p&gt;
&lt;p&gt;/* Function for handling advertising events.
This function will be called for advertising events which are passed to the application */
static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
ret_code_t err_code;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;switch (ble_adv_evt)
{
    case BLE_ADV_EVT_FAST:
	{
    	/* do nothing */
        break;
	}
    case BLE_ADV_EVT_IDLE:
	{
		/* start advertising again */
		err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
        APP_ERROR_CHECK(err_code);
        break;
	}
    default:
        break;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Feel free to have a look at my code repo on github for a full application example:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/marcorussi/nrf51_led_dimmer"&gt;github.com/.../nrf51_led_dimmer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42172?ContentTypeID=1</link><pubDate>Mon, 11 Jan 2016 15:53:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23a05fb5-e339-4b66-84eb-0552862fcb38</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;As pointed out in previous answer, you can start advertising with calling advertising_start(), as done in i.e. ble_app_bps in nRF51 SDK 10.0.0&lt;/p&gt;
&lt;p&gt;To stop advertising, you can call sd_ble_gap_adv_stop() function.&lt;/p&gt;
&lt;p&gt;If you want to enter System Off low power mode, you can call sleep_mode_enter, as done in the ble_app_bps example. When in System Off low power mode, you can only wake up the chip by pin interrupt (when SENSE enabled), reset, or ANADETECT signal on low power comparator. The device will reset when waking up from System Off mode.&lt;/p&gt;
&lt;p&gt;If you want to enter System On low power mode, you should call sd_app_evt_wait(). Any interrupt will wake up the CPU from system on low power mode. All nRF51 peripherals are enabled in System On low power mode.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 13.1.2016&lt;/strong&gt;
I have updated a modified ble_app_bps example from nRF51 SDK 10.0.0. When BLE event is either BLE_GAP_EVT_DISCONNECTED or BLE_GAP_EVT_TIMEOUT a timer is started which will expire in 10 seconds and then restart advertising. To find the code that is changed/added from the original example, look for &amp;quot;by Nordic&amp;quot; in the main file.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_bps_5F00_with_5F00_periodic_5F00_advertising.zip"&gt;ble_app_bps_with_periodic_advertising.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The advertising timeout is set to 10 seconds. When advertising starts again after timeout, it will be in slow advertising mode (like the default ble_app_bps example) which shows no LED activity on the PCA10028 board. However, if you connect to the board and then disconnect, you will see the board will start advertising again and the LED starts to blink after 10 seconds.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42168?ContentTypeID=1</link><pubDate>Sun, 10 Jan 2016 05:03:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa8010f2-50d3-4780-89e0-ead3bed4257f</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;can we use  power_manage() to stop advertising??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42167?ContentTypeID=1</link><pubDate>Sun, 10 Jan 2016 05:02:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a81d953f-a11c-46db-8ae8-809f5e232cbf</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;advertising stops after 10 sec.then device restart advertising after 20 second. i want to do this continuously. when advertising stops, i want nrf51822 in low power mode&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42166?ContentTypeID=1</link><pubDate>Sun, 10 Jan 2016 04:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f979d5f0-f248-43c6-aa6c-2dfa82623f96</guid><dc:creator>monpetit</dc:creator><description>&lt;p&gt;You did not say the restart condition. When does your device restart advertising?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42179?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2016 18:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39062eb1-e203-48ee-ab55-126454d10174</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;APP_ADV_TIMEOUT_IN_SECONDS is 10 second. once advertisement starts then i want to put it in sleep mode after 10 second then i want to make it advertise again. how it is possible. my one problem is aalso that  if i don&amp;#39;t define advertisement time out, power_manage() function don&amp;#39;t stop advertising&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42178?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2016 18:34:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:976ae577-316b-4b3f-b409-b2c32bed84a5</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;int main(void)
{
uint32_t err_code;
bool erase_bonds;
uint8_t  start_string[] = START_STRING;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
    uart_init();
    buttons_leds_init(&amp;amp;erase_bonds);
    ble_stack_init();
    gap_params_init();
    services_init();
    advertising_init();
    conn_params_init();
    
    printf(&amp;quot;%s&amp;quot;,start_string);

    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    
    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42177?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2016 18:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f419be0-3053-4ce6-bd4b-e6abe4ea0dad</guid><dc:creator>rushin</dc:creator><description>&lt;p&gt;my  function is like that&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void advertising_init(void)
{
    uint32_t      err_code;
    ble_advdata_t advdata;
    ble_advdata_t scanrsp;

// Build advertising data struct to pass into @ref ble_advertising_init.
memset(&amp;amp;advdata, 0, sizeof(advdata));
advdata.name_type          = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = false;
advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

memset(&amp;amp;scanrsp, 0, sizeof(scanrsp));
scanrsp.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
scanrsp.uuids_complete.p_uuids  = m_adv_uuids;

ble_adv_modes_config_t options = {0};
options.ble_adv_fast_enabled  = BLE_ADV_FAST_ENABLED;
options.ble_adv_fast_interval = APP_ADV_INTERVAL;
options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;

err_code = ble_advertising_init(&amp;amp;advdata, &amp;amp;scanrsp, &amp;amp;options, on_adv_evt, NULL);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep mode in nrf51822</title><link>https://devzone.nordicsemi.com/thread/42176?ContentTypeID=1</link><pubDate>Sat, 09 Jan 2016 17:07:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99bd4831-33eb-4558-a5e2-05b75855cb6c</guid><dc:creator>aep</dc:creator><description>&lt;p&gt;You can at any time call sd_ble_gap_adv_start again to restart advertisement.
(in advertising_start() in most of the examples)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>