<?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>ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20750/add-uuid-128-custom-service-to-advertising-packet</link><description>Hi all, 
 is there an example to add the uuid 128 of a custom service on advertising data?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Mar 2017 11:45:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20750/add-uuid-128-custom-service-to-advertising-packet" /><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80985?ContentTypeID=1</link><pubDate>Mon, 27 Mar 2017 11:45:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1644c289-e05e-4123-a3d9-e66b188305a6</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Appearance allows you device to appear as a predefined type for your computer/phone etc. when scanning for Bluetooth devices. Some more information can be found &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/group___b_l_e___a_p_p_e_a_r_a_n_c_e_s.html?resultof=%22%61%70%70%65%61%72%61%6e%63%65%22%20%22%61%70%70%65%61%72%22%20"&gt;here&lt;/a&gt; and &lt;a href="https://devzone.nordicsemi.com/tutorials/5/"&gt;here&lt;/a&gt;. It is no problem to turn this off if you do not require this feature.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80984?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2017 16:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29528f73-ba6c-4804-9103-4138a2402b6a</guid><dc:creator>annapalu</dc:creator><description>&lt;p&gt;thx, very helpful. For use a UIID 128 i set the advdata.include_appearance = false; because the size is limited. I think that is not a problem- But i would understand what means.&lt;/p&gt;
&lt;p&gt;Thanks,
Anna&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80983?ContentTypeID=1</link><pubDate>Fri, 24 Mar 2017 07:27:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e06979a-b705-4e3d-9b0f-67d1d6c2839f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The BLE UART UUID is also 128 bit. This is described in &lt;a href="https://devzone.nordicsemi.com/question/116707/how-to-set-service-uuid-for-central-and-peripheral/"&gt;this thread&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80982?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 21:59:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b6e2909-791c-42a5-9192-248c81ca346b</guid><dc:creator>annapalu</dc:creator><description>&lt;p&gt;Hi jorgen,&lt;/p&gt;
&lt;p&gt;thanks for the answer.  i see the uart example, it&amp;#39;s very simple.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static ble_uuid_t                       m_adv_uuids[] = {{BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}};  

/**&amp;lt; Universally unique service identifier. */

/**@brief Function for initializing the Advertising functionality.
 */

static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advdata_t          advdata;
    ble_advdata_t          scanrsp;
    ble_adv_modes_config_t options;

// Build advertising data struct to pass into @ref ble_advertising_init.
memset(&amp;amp;advdata, 0, sizeof(advdata));
advdata.name_type          = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance = false;
advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

memset(&amp;amp;scanrsp, 0, sizeof(scanrsp));
scanrsp.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
scanrsp.uuids_complete.p_uuids  = m_adv_uuids;

memset(&amp;amp;options, 0, sizeof(options));
options.ble_adv_fast_enabled  = true;
options.ble_adv_fast_interval = APP_ADV_INTERVAL;
options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;

err_code = ble_advertising_init(&amp;amp;advdata, &amp;amp;scanrsp, &amp;amp;options, on_adv_evt, NULL);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;my problem is the define of BLE_UUID_NUS_SERVICE is not simple 0xXXXX but it&amp;#39;s somethink like that&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_uuid128_t bds_base_uuid = {{0xB6, 0x9D, 0x21, 0x57, 0xA7, 0xA3, 0xFA, 0xA0, 0x97, 0x4A, 0x72, 0xA7, 0x00, 0x00, 0x20, 0xF3}};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and i don&amp;#39;t know how meange it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80981?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 19:54:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78b92e62-3d3c-432b-8cc3-181bc7e60fa6</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The BLE UART example shows how to add a custom UUID to the scan response data. You can also find a detailed explanation of how you do this in the &lt;a href="https://devzone.nordicsemi.com/tutorials/8/"&gt;BLE Services, a beginner&amp;#39;s tutorial&lt;/a&gt;. Note that you can add it to the advertising data if you have enough available space, but the maximum payload of one advertising packet is 27 bytes.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80980?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 16:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84d0f6d6-f0d5-4c7e-a96f-46ed47502343</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry unfortunately can&amp;#39;t help you with that. I just did it the way Nordic did it in the examples. Maybe you can post your code / find out what error you get from the return of ble_advertising_init.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80979?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 16:05:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2df20e9f-4c1d-4034-8343-bb549240e5fe</guid><dc:creator>annapalu</dc:creator><description>&lt;p&gt;Mmmhh.&lt;/p&gt;
&lt;p&gt;i use a ble devloper studio and uuid of my service created is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ble_uuid128_t bds_base_uuid = {{0xB6, 0x9D, 0x21, 0x57, 0xA7, 0xA3, 0xFA, 0xA0, 0x97, 0x4A, 0x72, 0xA7, 0x00, 0x00, 0x20, 0xF3}};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But i don&amp;#39;t understand how pass this value to advdata.uuids_complete.p_uuids  =&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADD UUID 128 custom service to advertising packet</title><link>https://devzone.nordicsemi.com/thread/80978?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 15:43:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fff1e2c9-4b3e-4027-9a67-68e1f0a60d14</guid><dc:creator>Moritz</dc:creator><description>&lt;p&gt;If you want you can use this one.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/open?id=0B7DY23RhOjEkZXZsek5JWlk5cHM"&gt;drive.google.com/open&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Its an example I made which is based on the ble_app_template (SDK12.2)
If you are on CodeLimitation just disable LRF_LOG in the config.
If you only fokus on the advertising part it should be fine. I build this out of the template and the blinky app from their github&lt;/p&gt;
&lt;p&gt;If your code uses ble_advertising_init basically all you have to do is to add your service to the second parameter. If you get Error 0x07 it is often the case that you want to initialize advertising before the services are initialized. You have to change the order in the main of the ble_app_template from advertising_init(); services_init();
to services_init(); advertising_init();
Hope that helps you a little bit&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t               err_code;
ble_advdata_t          advdata;
ble_adv_modes_config_t options;

// Build advertising data struct to pass into @ref ble_advertising_init.
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;
advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
advdata.uuids_complete.p_uuids  = m_adv_uuids;

memset(&amp;amp;options, 0, sizeof(options));
options.ble_adv_fast_enabled  = true;
options.ble_adv_fast_interval = APP_ADV_INTERVAL;
options.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;

ble_uuid_t adv_uuids[] = {{LUXS_UUID_SERVICE, m_luxs.uuid_type}};

ble_advdata_t srdata;
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_advertising_init(&amp;amp;advdata, &amp;amp;srdata, &amp;amp;options, on_adv_evt, NULL);
NRF_LOG_ERROR(&amp;quot;%d\r\n&amp;quot;, err_code);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>