<?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>how to Restart advertising after timeout?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19879/how-to-restart-advertising-after-timeout</link><description>Could you give me an example how to restart advertising after timeout. 
 thank. 
 sorry, i need on the button event to restart advertising.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Dec 2018 09:02:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19879/how-to-restart-advertising-after-timeout" /><item><title>RE: how to Restart advertising after timeout?</title><link>https://devzone.nordicsemi.com/thread/163297?ContentTypeID=1</link><pubDate>Mon, 31 Dec 2018 09:02:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7c19b49-1f72-4a08-98f8-9fa4255e7b7a</guid><dc:creator>Devanshi1510</dc:creator><description>&lt;p&gt;This worked for me !!! But there was slight change in this&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static void on_adv_evt(ble_adv_evt_t ble_adv_evt)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;switch (ble_adv_evt)&lt;br /&gt; {&lt;br /&gt; &lt;br /&gt; case BLE_ADV_EVT_IDLE:&lt;br /&gt; err_code = ble_advertising_start(&amp;amp;m_advertising,BLE_ADV_MODE_FAST);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BLE_ADV_EVT_FAST:&lt;br /&gt; err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;default:&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much!!!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to Restart advertising after timeout?</title><link>https://devzone.nordicsemi.com/thread/77363?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 13:25:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00972b96-45f0-4f7c-916f-7f93d50582e7</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Then in your hids_mouse example you probably using, in &lt;code&gt;bsp_event_handler()&lt;/code&gt; under lets say button 0 have:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; case BSP_EVENT_KEY_0:
    if (m_conn_handle == BLE_CONN_HANDLE_INVALID)
    {
        advertising_start();
    }
    break;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use any button, just make sure it is defined properly&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to Restart advertising after timeout?</title><link>https://devzone.nordicsemi.com/thread/77364?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 12:27:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9cd4c1dd-d75d-4adc-aa35-07a14b27d9e9</guid><dc:creator>Yurii G</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;just start advertising again upon BLE_ADV_EVT_IDLE in advertising event handler.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_adv_evt(ble_adv_evt_t ble_adv_evt) {
  ret_code_t err_code;
  switch (ble_adv_evt) {
    case BLE_ADV_EVT_IDLE:
      err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
      APP_ERROR_CHECK(err_code);
      break;
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Yurii&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to Restart advertising after timeout?</title><link>https://devzone.nordicsemi.com/thread/77362?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2017 12:14:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff0b0d66-9a29-4ce0-ad85-1e20d4a5ccd3</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;In &lt;code&gt;on_ble_evt()&lt;/code&gt; function add&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_GAP_EVT_TIMEOUT:
            if (p_ble_evt-&amp;gt;evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_ADVERTISING)
            {
advertising_start();
    } 
break;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>