<?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>non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51808/non-connectable-advertising-while-connected-on-sdk15-3</link><description>Hello, 
 I&amp;#39;m using SDK15.3 and trying to do a non-connectable advertising while connected. 
 For that I set my adv package as non-connectable, however, when I run the function sd_ble_gap_adv_start I always receive the error 0x3004. 
 
 Based on my research</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Oct 2019 18:59:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51808/non-connectable-advertising-while-connected-on-sdk15-3" /><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/213264?ContentTypeID=1</link><pubDate>Thu, 03 Oct 2019 18:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1216525a-23a7-4abf-95a4-ca1adee3c061</guid><dc:creator>testsweng</dc:creator><description>&lt;p&gt;what is your peripheral_link count set to in sdk_config.h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208842?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 09:01:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fc74505-0925-4017-a814-fe8e28fe0bcd</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4276._5F00_Verify_2D00_answer_2D00_nordic_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208839?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2019 08:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df24b573-3f2d-4671-b8d8-d0389bae163a</guid><dc:creator>kreis</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tested here and it worked! In that case I changed the advertising type to a scannable one and that passed.&lt;/p&gt;
&lt;p&gt;I needed to update the other part of the code as well so&amp;nbsp;for reference I&amp;#39;m posting the&amp;nbsp;updated code here.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void advertising_init(bool connectable)
{
    ret_code_t    err_code;
    ble_advdata_t advdata;
    ble_advdata_t srdata;

    ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type}};

    // Build and set advertising data.
    memset(&amp;amp;advdata, 0, sizeof(advdata));

    advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance = true;
    advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;


    memset(&amp;amp;srdata, 0, sizeof(srdata));
    srdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    srdata.uuids_complete.p_uuids  = adv_uuids;

    err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
    APP_ERROR_CHECK(err_code);

    err_code = ble_advdata_encode(&amp;amp;srdata, m_adv_data.scan_rsp_data.p_data, &amp;amp;m_adv_data.scan_rsp_data.len);
    APP_ERROR_CHECK(err_code);

    ble_gap_adv_params_t adv_params;

    // Set advertising parameters.
    memset(&amp;amp;adv_params, 0, sizeof(adv_params));

    if(connectable)
    {
      adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
      adv_params.interval        = APP_ADV_INTERVAL;
    }
    else
    {
      adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED;
      adv_params.interval        = 320;
    }
    adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
    adv_params.duration        = APP_ADV_DURATION;
    adv_params.p_peer_addr     = NULL;
    adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    
    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;adv_params);
    NRF_LOG_INFO(&amp;quot;error code: %x&amp;quot;, err_code);
    APP_ERROR_CHECK(err_code);
}

//---------------------------------

case BLE_GAP_EVT_CONNECTED:
    NRF_LOG_INFO(&amp;quot;Connected&amp;quot;);
    bsp_board_led_on(CONNECTED_LED);
    bsp_board_led_off(ADVERTISING_LED);
    m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
    err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
    APP_ERROR_CHECK(err_code);
    err_code = app_button_enable();
    APP_ERROR_CHECK(err_code);

    advertising_init(false);
    advertising_start();
    break;

case BLE_GAP_EVT_DISCONNECTED:
    NRF_LOG_INFO(&amp;quot;Disconnected&amp;quot;);
    bsp_board_led_off(CONNECTED_LED);
    m_conn_handle = BLE_CONN_HANDLE_INVALID;
    err_code = app_button_disable();
    APP_ERROR_CHECK(err_code);

    advertising_stop();
    advertising_init(true);
    advertising_start();
    break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you all for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208751?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 15:40:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b84cf47e-3dce-4089-ac39-8da67a9c985e</guid><dc:creator>awneil</dc:creator><description>[quote userid="8164" url="~/f/nordic-q-a/51808/non-connectable-advertising-while-connected-on-sdk15-3/208749"] I do not have time to test now, but I suspect that might give invalid parameter error.[/quote]
&lt;p&gt;Yes, I think this error code includes, &amp;quot;&lt;em&gt;this particular &lt;strong&gt;combination&lt;/strong&gt; of parameters is not allowed&lt;/em&gt;&amp;quot; ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208749?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 15:34:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63d7b7de-7c7d-4008-aa89-27595a2b7fca</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You still prepare and send in scan response data (see the srdata variable), which is not needed when you do non-scannable advertising. I do not have time to test now, but I suspect that might give invalid parameter error.&lt;/p&gt;
&lt;p&gt;Edit: Removed paragraph mentioning static memory for advertising data, as I realized you used static memory for that.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208741?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 14:58:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2c2dc0a-55d8-47de-81ef-34c9221a9e8b</guid><dc:creator>Jimmy Wong</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i did the demo at&amp;nbsp;&lt;a href="https://github.com/jimmywong2003/nrf5-modify-device-parameter-through-host"&gt;https://github.com/jimmywong2003/nrf5-modify-device-parameter-through-host&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;the device can do the connectable adv &amp;nbsp;with mobile for parameter change. Also it does the non-connectable adv as beacon adv.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208734?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 14:27:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:762dbea3-3bd9-4236-8a33-90f348594f55</guid><dc:creator>kreis</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the SDK15.3 softdevice&amp;nbsp;s140 6.1.1&lt;/p&gt;
&lt;p&gt;to illustrate better I did the following. Used the example&amp;nbsp;ble_app_blinky and modified just the parts I&amp;#39;m posting here, the rest of the code I didn&amp;#39;t change anything.&lt;/p&gt;
&lt;p&gt;Firstly for the function advertising_init() I just created a parameter to tell if the advertising is of the type connectable or not if it&amp;#39;s connectable there&amp;#39;s no change related to the original function, otherwise, it changes the type to non-connectable. As follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void advertising_init(bool connectable)
{
    ret_code_t    err_code;
    ble_advdata_t advdata;
    ble_advdata_t srdata;

    ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type}};

    // Build and set advertising data.
    memset(&amp;amp;advdata, 0, sizeof(advdata));

    advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance = true;
    advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;


    memset(&amp;amp;srdata, 0, sizeof(srdata));
    srdata.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    srdata.uuids_complete.p_uuids  = adv_uuids;

    err_code = ble_advdata_encode(&amp;amp;advdata, m_adv_data.adv_data.p_data, &amp;amp;m_adv_data.adv_data.len);
    APP_ERROR_CHECK(err_code);

    err_code = ble_advdata_encode(&amp;amp;srdata, m_adv_data.scan_rsp_data.p_data, &amp;amp;m_adv_data.scan_rsp_data.len);
    APP_ERROR_CHECK(err_code);

    ble_gap_adv_params_t adv_params;

    // Set advertising parameters.
    memset(&amp;amp;adv_params, 0, sizeof(adv_params));

    if(connectable)
    {
      adv_params.properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED;
      adv_params.interval        = APP_ADV_INTERVAL;
    }
    else
    {
      adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
      adv_params.interval        = 320;
    }
    adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
    adv_params.duration        = APP_ADV_DURATION;
    adv_params.p_peer_addr     = NULL;
    adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    
    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;adv_params);
    NRF_LOG_INFO(&amp;quot;error code: %x&amp;quot;, err_code);
    APP_ERROR_CHECK(err_code);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Later I called the advertisig_init with the corresponding parameter of non-connectable in the BLE_GAT_EVT_CONNECTED as bellow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        case BLE_GAP_EVT_CONNECTED:
            NRF_LOG_INFO(&amp;quot;Connected&amp;quot;);
            bsp_board_led_on(CONNECTED_LED);
            bsp_board_led_off(ADVERTISING_LED);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
            APP_ERROR_CHECK(err_code);
            err_code = app_button_enable();
            APP_ERROR_CHECK(err_code);

            advertising_init(false);
            advertising_start();
            break;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I run the code and try to connect it returns an error 7 in the function&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;adv_params);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you all for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208639?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 11:07:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:771b9690-0a35-4997-a6be-94ee068db4d0</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What exact SoftDevice are you using? S140 v6.1.1?&lt;/p&gt;
&lt;p&gt;Unfortunately NRF_ERROR_INVALID_PARAM from &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v6.1.1%2Fgroup___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga9969047f4e7485c3f856c841978cc31a"&gt;sd_ble_gap_adv_set_configure()&lt;/a&gt; may mean several things, but if you share here how and what you fill into the structs used for p_adv_data and p_adv_params I will try to help figure this out.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208630?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 10:00:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92969fe1-07b5-4f14-88d1-2c4eab0af6d1</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;You will have seen my comments about how unhelpful that error message is!&lt;/p&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208629?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 09:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9caa4976-022a-49c2-b39a-6bf67e01e90f</guid><dc:creator>kreis</dc:creator><description>&lt;p&gt;As for the error code 7 it means&amp;nbsp;NRF_ERROR_INVALID_PARAM though the only modification I made in the example advertising_init function was to change the&amp;nbsp;BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED to&amp;nbsp;BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED as suggested. I also tried increasing the advertising period to 200ms but the error persists.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208627?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 09:43:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19e165cd-8283-47d4-aaac-e6c0eb336309</guid><dc:creator>kreis</dc:creator><description>&lt;p&gt;This is the workaround, but it works to update only the manufacture data:&lt;/p&gt;
&lt;div&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33606/updating-advertising-data-manuf-spec-data-in-sdk15/144853#144853" rev="en_rl_none"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/33606/updating-advertising-data-manuf-spec-data-in-sdk15/144853#144853&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208612?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 09:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:741cdf96-78f2-40cb-9ffa-87b3a868fe3a</guid><dc:creator>awneil</dc:creator><description>[quote userid="12962" url="~/f/nordic-q-a/51808/non-connectable-advertising-while-connected-on-sdk15-3/208608"]it returns the error code 7.[/quote]
&lt;p&gt;Have you looked up what that code means?&lt;/p&gt;
[quote userid="12962" url="~/f/nordic-q-a/51808/non-connectable-advertising-while-connected-on-sdk15-3/208608"] I found a workaround in the forum[/quote]
&lt;p&gt;Link?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208608?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2019 08:53:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27f6e230-71f3-4e57-a59f-ebcd6b5b690c</guid><dc:creator>kreis</dc:creator><description>&lt;p&gt;Hi awneil!&lt;/p&gt;
&lt;p&gt;Thank you very much for your prompt help.&lt;/p&gt;
&lt;p&gt;I spent some time trying to make it work but it didn&amp;#39;t. Actually this is the approach I was trying to before.&lt;/p&gt;
&lt;p&gt;As far as I understood the SDK15 returns an error when I call the function&amp;nbsp;sd_ble_gap_adv_set_configure, which is necessary to change the advertising to non-connectable, inside the&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_CONNECTED&lt;/span&gt;&amp;nbsp;it returns the error code 7.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve gone through this same problem when trying to update the contents of the advertising package, but in that case, I found a workaround in the forum where there was no need to call the function&amp;nbsp;&lt;span&gt;sd_ble_gap_adv_set_configure. For the current problem it does not work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: non-connectable advertising while connected on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/208276?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2019 14:38:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f2b9de4-b673-4360-8052-40cd76e9b456</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/49872/advertise-connected-when-connected/198912#198912"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/49872/advertise-connected-when-connected/198912#198912&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>