<?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>nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58647/nrf52840-sdk-16-peripheral-blinky-with-coded-phy</link><description>What all do I need to modify in the Blinky peripheral (from SDK 16) with in order for the 840 DK to advertise and connect with CODED PHY in long range mode? 
 My code compiles but the advertising LED hasn&amp;#39;t lit and I get a fatal error in the advertising</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Mar 2020 07:48:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58647/nrf52840-sdk-16-peripheral-blinky-with-coded-phy" /><item><title>RE: nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/thread/238434?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 07:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d56e2f66-7deb-4c4b-b6ba-0e61c11c3317</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Sam&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think scan_req_notification = 1 should make any trouble for Coded PHY advertisements. What I do see, is that you have some &lt;strong&gt;srdata&amp;nbsp;&lt;/strong&gt;(scan response data) in your advertising_init() function, which I assume is what causes the invalid parameters.&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: nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/thread/238328?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 14:20:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d298192c-6cbc-416b-b3e0-926d05f9e1d0</guid><dc:creator>SRall</dc:creator><description>&lt;p&gt;Ok but what about the scan_req_notification=1? Can you explain what&amp;#39;s happening in this advertising init function I posted?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/thread/238325?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 14:14:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f7a9af2-b09d-408c-9dda-c07586566035</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Yes, I can explain! I&amp;#39;m sorry I didn&amp;#39;t mention that initially, but extended advertising (which is necessary to run Coded PHY) does not support scan response packets, as it transfers extra data in the secondary channels instead. Setting the scan response data length to 0 will fix this.&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: nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/thread/238315?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 13:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b78f78f-26f8-4ac8-aec9-c41cd93e24bf</guid><dc:creator>SRall</dc:creator><description>&lt;p&gt;After some more digging I found this code snippet that modifies the scan response data as well as the advertising init function. This code does actually compile, does not throw any errors, I can observe the advertising LED is lit, and the I can see NRF_SUCCESS displayed in my debugging log. (where before I found NRF_INVALID_PARAM). However, still don&amp;#39;t see the &amp;quot;Nordic_Blinky&amp;quot; in the nRF Connect App device queue and it won&amp;#39;t connect to the Central Blinky example either.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Not totally sure why this works? Think it has something to do with setting the scan_req_notification = 1 ? But I&amp;#39;m not sure, can you explain what&amp;#39;s going on here?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static ble_gap_adv_data_t m_adv_data =
{
    .adv_data =
    {
        .p_data = m_enc_advdata,
        .len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX
    },
    .scan_rsp_data =
    {

		.p_data = NULL,
        .len    = 0
        //.p_data = m_enc_scan_response_data,
        //.len    = BLE_GAP_ADV_SET_DATA_SIZE_MAX			

    }
};


//...other init functions....
//...skip to advertising init...

static void advertising_init(void)
{
	
    ret_code_t    err_code;

    ble_advdata_t advdata =
    {
        .name_type          = BLE_ADVDATA_FULL_NAME,
        .flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE,
        .include_appearance = false,
    };	

    ble_advdata_t srdata;

    ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type}};

    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);

	ble_gap_adv_params_t adv_params =
    {
        .properties    =
        {
          .type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED,
        },
        .p_peer_addr   = NULL,
        .filter_policy = BLE_GAP_ADV_FP_ANY,
        .interval      = APP_ADV_INTERVAL,
        .duration      = 0,

        .primary_phy   = BLE_GAP_PHY_1MBPS, // Must be changed to connect in long range. (BLE_GAP_PHY_CODED)
        .secondary_phy = BLE_GAP_PHY_1MBPS,
        .scan_req_notification = 1,
    };

    adv_params.primary_phy     = BLE_GAP_PHY_CODED;
    adv_params.secondary_phy   = BLE_GAP_PHY_CODED;
	adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED;
	NRF_LOG_INFO(&amp;quot;set adv to CODED PHY.&amp;quot;);

    adv_params.duration        = APP_ADV_DURATION;    
    adv_params.p_peer_addr     = NULL;
    adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
    adv_params.interval        = APP_ADV_INTERVAL;

    err_code = sd_ble_gap_adv_set_configure(&amp;amp;m_adv_handle, &amp;amp;m_adv_data, &amp;amp;adv_params);
    APP_ERROR_CHECK(err_code);
		
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/thread/238166?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 06:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4aa6b15c-dfc8-4e22-8750-424409355774</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Sam&lt;/p&gt;
&lt;p&gt;Can you upload a snippet of your advertising_init() function so I can take a proper look, it seems like one of the advertising parameters are not set correctly, but it&amp;#39;s hard to guess which one without seeing it myself.&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: nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/thread/238070?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 14:21:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41487f4d-559b-420b-867e-66f539445e28</guid><dc:creator>SRall</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;I already have that flag set to the value you described as I believe that&amp;#39;s how it&amp;#39;s set in the Nordic Blinky example fresh from SDK16. I haven&amp;#39;t changed too much in the example code out of the box.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t really need to worry about the central right now because, as I mentioned, the peripheral example is still throwing an error. And therefore not advertising anyway.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK 16 Peripheral Blinky with CODED PHY</title><link>https://devzone.nordicsemi.com/thread/237959?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 09:14:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fb48a90-04dd-49de-9fdc-d0c8885cf2e8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Sam&lt;/p&gt;
&lt;p&gt;The following advertising flag is necessary for your Coded PHY application to be discovered:&amp;nbsp;&lt;strong&gt;adv_data.&lt;span&gt;flags&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;= BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;What device is the central that you&amp;#39;re trying to connect to? Are you sure that the central supports Coded PHY?&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>