<?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>To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61574/to-be-in-non-scannable-non-connectable-mode</link><description>Hi, 
 I am on SDK 15.2 and NRF52832. I think that I am quite stupid because I do not succeed to be in Non-scannable non-connectable mode. 
 I tried few stuffs, change directly the line from the ble_advertising_init from ble_advertising library like that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 May 2020 06:29:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61574/to-be-in-non-scannable-non-connectable-mode" /><item><title>RE: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/251819?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 06:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328f3dde-7d9d-4082-84ab-7e45861d7304</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Glad you got it working! Depending on what tool you&amp;#39;re using to flash your device, you should make sure you erase the flash on your chip before flashing.&amp;nbsp;To make sure the device isn&amp;#39;t in debug mode after you&amp;#39;ve flashed the device, you should power cycle it to make sure you exit from debug mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any flaws with the way your advertising is set up, so if it&amp;#39;s working as intended now, I think you&amp;#39;re good.&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: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/251757?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 15:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:547b17cc-2032-44a7-96c8-beb6a9c8462f</guid><dc:creator>Beldramma</dc:creator><description>&lt;p&gt;Oh, I am so stupid, It works actually. I think it was a bug with my hardware, after debug mode. But if you have some advices, to clean my code, i am open.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/251742?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 14:11:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2a14de1-216c-4af0-937c-1daedbca7a59</guid><dc:creator>Beldramma</dc:creator><description>&lt;p&gt;I would like to advertise data in non connectable and non scannable mode, and to update it when I receive new data from UART bus.&amp;nbsp;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/61574/to-be-in-non-scannable-non-connectable-mode/251604"]What are you using the &amp;quot;Copy advertising data&amp;quot; function for exactly?[/quote]
&lt;p&gt;If you are talking about the Copy advertising data, there is first the initialization of my handle if it is not made, then I put 31 in len, because it is an imput parameter of the encode function, to&amp;nbsp; specify the maximum size, and finally I will encode my advertising data.&amp;nbsp;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/61574/to-be-in-non-scannable-non-connectable-mode/251604"]Have you checked (by debugging) that the FAST and SLOW if-loops you are using are executed as expected in your init function?[/quote]
&lt;p&gt;Yeah, it works well.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/251604?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 07:10:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f693f40-61e1-4e98-a32d-59010497be57</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you explain what exactly you&amp;#39;d like to achieve so that I know what assistance you need? Also, please explain the following in your advertising_init() function:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have you checked (by debugging) that the FAST and SLOW if-loops you are using are executed as expected in your init function?&lt;/li&gt;
&lt;li&gt;What are you using the &amp;quot;Copy advertising data&amp;quot; function for exactly?&lt;/li&gt;
&lt;/ul&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: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/251476?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 12:17:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21ab16dd-236c-49c6-aed3-b2753d804108</guid><dc:creator>Beldramma</dc:creator><description>[quote userid="75734" url="~/f/nordic-q-a/61574/to-be-in-non-scannable-non-connectable-mode/251465"]I see that you have commented out the advdata.flags.&amp;nbsp;You need advertising flags as part of your advertisement according to the Bluetooth Spec.[/quote]
&lt;p&gt;I have uncommented it, no changes.&amp;nbsp;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/61574/to-be-in-non-scannable-non-connectable-mode/251465"]If you just need NONCONNECTABLE_NONSCANNABLE advertising, I suggest basing your application on the beacon example, instead of trying to modify one of the others to&amp;nbsp;do&amp;nbsp;that.&amp;nbsp;[/quote]
&lt;p&gt;I did that, i have copied the code from the Beacon example, the advertising_init, but I had errors on the encode et sd_configure. I need others pieces of code, so I cannot take all the code from this example.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/251465?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 11:45:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7c01745-967a-409f-9434-67da31d8e560</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I see that you have commented out the advdata.flags.&amp;nbsp;You need advertising flags as part of your advertisement according to the Bluetooth Spec.&lt;/p&gt;
&lt;p&gt;If you just need NONCONNECTABLE_NONSCANNABLE advertising, I suggest basing your application on the beacon example, instead of trying to modify one of the others to&amp;nbsp;do&amp;nbsp;that.&amp;nbsp;&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: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/251423?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 09:14:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d950c5b1-ff1d-438e-ae75-cf1667b92f45</guid><dc:creator>Beldramma</dc:creator><description>&lt;p&gt;Ok I have checked this example. I have done my advertising_init function like that :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    uint32_t      err_code;
    ble_advdata_t advdata;
    uint8_t       flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;

    ble_advdata_manuf_data_t manuf_specific_data;
    memset(m_beacon_info, 0, sizeof(m_beacon_info));
    manuf_specific_data.company_identifier = APP_COMPANY_IDENTIFIER;
    manuf_specific_data.data.p_data = (uint8_t*) m_beacon_info;
    manuf_specific_data.data.size   = APP_BEACON_INFO_LENGTH;

    // Build and set advertising data.
    memset(&amp;amp;advdata, 0, sizeof(advdata));

    advdata.name_type             = BLE_ADVDATA_FULL_NAME;
    //advdata.flags                 = flags;
    advdata.include_appearance    = false;
    advdata.p_manuf_specific_data = &amp;amp;manuf_specific_data;
    advdata.uuids_complete.uuid_cnt = 0;   // in order to save bytes, we do not advertise UUID&amp;#39;s
    advdata.uuids_complete.p_uuids  = m_adv_uuids;

    // Initialize advertising parameters (used when starting advertising).
    memset(&amp;amp;m_advertising.adv_params, 0, sizeof(m_advertising.adv_params));

    //FAST
    #if BEACON_MODE &amp;amp;&amp;amp; !BEACON_MODE_TEST
       m_advertising.adv_modes_config.ble_adv_fast_enabled  = false;
    #else
       m_advertising.adv_modes_config.ble_adv_fast_enabled  = true;
    #endif
       m_advertising.adv_modes_config.ble_adv_fast_interval = NON_CONNECTABLE_ADV_INTERVAL;
       m_advertising.adv_modes_config.ble_adv_fast_timeout  = APP_ADV_DURATION;

	//SLOW
	#if BEACON_MODE &amp;amp;&amp;amp; !BEACON_MODE_TEST
       m_advertising.adv_modes_config.ble_adv_slow_enabled = true;
	#else
       init.config.ble_adv_slow_enabled = false;
	#endif
		m_advertising.adv_modes_config.ble_adv_slow_interval = NON_CONNECTABLE_ADV_INTERVAL;
		m_advertising.adv_modes_config.ble_adv_slow_timeout  = APP_ADV_DURATION;

    m_advertising.adv_mode_current               = BLE_ADV_MODE_IDLE;
    m_advertising.conn_cfg_tag                   = BLE_CONN_CFG_TAG_DEFAULT;
    m_advertising.evt_handler                    = on_adv_evt;
    m_advertising.current_slave_link_conn_handle = BLE_CONN_HANDLE_INVALID;
    m_advertising.adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
    m_advertising.adv_params.p_peer_addr     = NULL;    // Undirected advertisement.
    m_advertising.adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    m_advertising.adv_params.interval        = NON_CONNECTABLE_ADV_INTERVAL;
    m_advertising.adv_params.duration        = 0;       // Never time out.

    // Copy advertising data.
    if (!m_advertising.initialized)
    {
        m_advertising.adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
    }
    m_advertising.adv_data.adv_data.p_data = m_advertising.enc_advdata;

    m_advertising.adv_data.adv_data.len = BLE_GAP_ADV_SET_DATA_SIZE_MAX;
    err_code = ble_advdata_encode(&amp;amp;advdata, m_advertising.enc_advdata, &amp;amp;m_advertising.adv_data.adv_data.len);
    APP_ERROR_CHECK(err_code);

    //scan data to NULL
    m_advertising.adv_data.scan_rsp_data.p_data = NULL;
    m_advertising.adv_data.scan_rsp_data.len    = 0;

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_advertising.adv_handle, &amp;amp;m_advertising.adv_data, &amp;amp;m_advertising.adv_params);
    APP_ERROR_CHECK(err_code);

    m_advertising.initialized = true;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have no errors with the two functions, encode, and sd configure, but I cannot see my device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you check my code and tell me if it is correct ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: To be in Non-scannable  non-connectable mode</title><link>https://devzone.nordicsemi.com/thread/250954?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 12:03:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bea27adc-bc18-47e0-9d73-406b48aecba4</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Please check out the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_beacon.html"&gt;ble_app_beacon example&lt;/a&gt; in the SDK, which implements the nonconnectable_nonscannable advertisement correctly. The beacon will not respond to scan requests/advertising requests.&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>