<?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>Advertising sevices SDK15.2 LBS and HRS advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42991/advertising-sevices-sdk15-2-lbs-and-hrs-advertising</link><description>Hello everyone! 
 I am trying unsuccessfully to advertise a custom UUID as LBS along whit HRS but the examples use different functions to handle the advertising. 
 The blink example use: 
 
 ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Feb 2019 08:14:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42991/advertising-sevices-sdk15-2-lbs-and-hrs-advertising" /><item><title>RE: Advertising sevices SDK15.2 LBS and HRS advertising</title><link>https://devzone.nordicsemi.com/thread/169653?ContentTypeID=1</link><pubDate>Wed, 06 Feb 2019 08:14:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2873fff7-7c7e-4ce1-bc5b-e5c5b15387b7</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Sorry for the late response. In C you must initialize global variables with a constant expression. I suggest that you read our tutorials on how to setup &lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial"&gt;advertising &lt;/a&gt;,&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;characteristics &lt;/a&gt;and &lt;a href="https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-services-a-beginners-tutorial"&gt;services&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising sevices SDK15.2 LBS and HRS advertising</title><link>https://devzone.nordicsemi.com/thread/168036?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 21:30:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:329d0811-197c-4636-adf5-cfd64325a359</guid><dc:creator>Jaksquare</dc:creator><description>&lt;p&gt;Hi, thank you for your answer.&lt;/p&gt;
&lt;p&gt;I tried that, but doesn&amp;#39;t work. I don&amp;rsquo;t complelly understand how it works because in one case the adv_uuid[] vector is created static as a global variable, in the other case it is declared in the function&amp;nbsp;advertising_init(). When you try to add&amp;nbsp;{LBS_UUID_SERVICE, m_lbs.uuid_type} to the global static declaration I get an error that said &amp;quot;the variable must be contsnt&amp;quot;. In addition, I think that you can&amp;#39;t mix custom uuid and generic services in the same vector.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    ret_code_t    err_code;
    ble_uuid_t m_adv_uuids[] = {
        {LBS_UUID_SERVICE, m_lbs.uuid_type},
        {BLE_UUID_HEART_RATE_SERVICE,        BLE_UUID_TYPE_BLE}
    };

    ble_advertising_init_t init;

    memset(&amp;amp;init, 0, sizeof(init));

    init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance      = true;
    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.advdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;

    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&amp;amp;m_advertising, APP_BLE_CONN_CFG_TAG);

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Advertising sevices SDK15.2 LBS and HRS advertising</title><link>https://devzone.nordicsemi.com/thread/167979?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 14:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07c59379-b831-4530-8f47-7ae05779fa19</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The two methods are in essence doing the same things, namely populating the advertising and scan response data fields. But they have different features, in that the encode function can be used to create a payload for NFC message. The blink example does also use softdevice calls directly, I would rather recommend using the HRS method of using the API call&amp;nbsp;&lt;span&gt;ble_advertising_start().&amp;nbsp; You should integrate the two projects into the ble_template project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jared&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>