<?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>Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66608/advertisement-packet-loss-at-device-startup</link><description>Hello, 
 nRF5SDk16.0, Softdevice v.7.0.1, device nRF52840. 
 We using manufacturer specific information in the advertisement data. Here are the set values: 
 
 The data is update through following code: 
 
 The send_adv_data() function above is being</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Oct 2020 05:36:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66608/advertisement-packet-loss-at-device-startup" /><item><title>RE: Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/thread/273349?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 05:36:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87487135-f18c-4eac-9c1c-b2bfcbb06474</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Ah, yes. The advertising flag will have to be set to&amp;nbsp;&lt;strong&gt;BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE&amp;nbsp;&lt;/strong&gt;in order to use 0 as the advertising duration.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/thread/273300?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 15:38:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9551dd96-179a-4c4b-999d-d6ff266142fd</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Changing from SDK v15.2 to later versions caused advertising to stop when set to 0, there were several posts regarding this. Looking back I now see that another change was required to allow a value of 0 be used:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;If you don&amp;#39;t want your advertisements to time out, and your device to go to sleep, you can set the advertising duration (APP_ADV_DURATION) to 0. Note that you also need to change the advertising flag from BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE to&amp;nbsp;BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE.&lt;/span&gt;&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/thread/273079?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 06:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57c5bc84-df98-445b-ab37-7e3498455bf8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;setting the advertising duration (&lt;strong&gt;APP_ADV_DURATION&lt;/strong&gt;) to 0 will disable the advertising timeout, and will let the device keep advertising &amp;quot;indefinitely&amp;quot;. I&amp;#39;m not entirely sure what&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;&amp;nbsp;is referring to I&amp;#39;m afraid.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/thread/272868?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 07:20:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd1f4eb6-e13d-4fa8-8977-c6f366f05eef</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;@Sinmonr,&lt;/p&gt;
&lt;p&gt;Does the following code continuously advertise or not in the softdevice v7.0.1 (SDK v16.0)?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define APP_ADV_DURATION   0   //always advertise&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My testing shows that it does, and whenever I scan devices through nRFConnect, it shows updated adv data. But still I want to confirm as @hmolesworth suggested otherwise.&lt;/p&gt;
&lt;p&gt;Also my issue is not that it stops advertising, my issue is packet loss at the start of advertising. It may just be mobile app scanner issue, but I still want to confirm.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/thread/272799?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 19:13:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48bb16c0-d41e-4e63-91cc-0cb160139bdd</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;This is just a guess but I think this feature changed and doesn&amp;#39;t&amp;nbsp;now continuous&amp;nbsp;advertise in recent softdevices:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define APP_ADV_DURATION   0   //always advertise&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t check as too busy, but on advertising timeout - set to a large number like 18000 - simply restart the advertising if I recall correctly. Quick look in my code shows this, may be what you want:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for handling the Timeout event.
 *
 * @param[in] p_advertising Advertising module instance.
 * @param[in] p_ble_evt Event received from the BLE stack.
 */
static void on_terminated(ble_advertising_t * const p_advertising, ble_evt_t const * p_ble_evt)
{
    ret_code_t ret;

    if (p_ble_evt-&amp;gt;header.evt_id != BLE_GAP_EVT_ADV_SET_TERMINATED)
    {
        // Nothing to do.
        return;
    }

    if (  p_ble_evt-&amp;gt;evt.gap_evt.params.adv_set_terminated.reason == BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_TIMEOUT
        ||p_ble_evt-&amp;gt;evt.gap_evt.params.adv_set_terminated.reason == BLE_GAP_EVT_ADV_SET_TERMINATED_REASON_LIMIT_REACHED)
    {
        // Start advertising in the next mode.
        ret = ble_advertising_start(p_advertising, adv_mode_next_get(p_advertising-&amp;gt;adv_mode_current));

        if ((ret != NRF_SUCCESS) &amp;amp;&amp;amp; (p_advertising-&amp;gt;error_handler != NULL))
        {
            p_advertising-&amp;gt;error_handler(ret);
        }
    }
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/thread/272735?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 12:48:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c849c194-4e2d-48ed-9948-15060094ceb8</guid><dc:creator>Aftab</dc:creator><description>&lt;p&gt;We further tested this issue and found that if iPhone rescans the advertisement data, it starts getting good packets again. So, for now, restarting iPhone scanner after every 10s resolves the issue. I means that hardware sends correct packets but iPhone somehow cannot capture those packets unless it&amp;#39;s BLE scanner is reset. Does this make any sense? Why it&amp;#39;s happening?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertisement packet loss at device startup</title><link>https://devzone.nordicsemi.com/thread/272710?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 11:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c203aa13-3296-4b8d-a034-1fec6d067ea6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;First off, do you see this on multiple of your custom boards or just the one? It could be that you have a faulty/poorly optimized crystal that takes some time to get up to speed after a power cycle. Can you upload the schematics of your board and/or the datasheet of the external crystal(s) you are using so we can take a look at that.&lt;/p&gt;
&lt;p&gt;Next, advertising won&amp;#39;t be the most reliable way to capture data, as there is no way to&amp;nbsp;&lt;strong&gt;ensure&lt;/strong&gt; that an advertisement reaches its destination, so if you&amp;#39;re looking for reliability I would suggest connecting the devices instead to ensure that all the necessary data is received in the central device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>