<?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>HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52328/hid-keyboard-custom-gatt</link><description>Hi, 
 I&amp;#39;m using SDK 15.2 &amp;amp; trying to combine hid keyboard with custom gatt service, but it was not advertising. When I debug, it got stuck on the line below with error code 12- 
 
 &amp;amp; the rtt logs showed 
 
 
 
 So after going through several tickets,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Sep 2019 07:18:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52328/hid-keyboard-custom-gatt" /><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/211687?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 07:18:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d14052a-0aa9-414a-8719-b0bfbef9d95d</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Yes, you are allowed to advertise the full device name. As long as there is enough space in the advertising packet, there is no problem advertising the full name.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&amp;nbsp;&lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/211686?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 07:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f35f7544-3b2a-4649-9716-1b4aff54fd96</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Thank you for your reply. I again changed the advertising_init() to accommodate the full device name. I this permissible?&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_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 = 1;//sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    //init.advdata.uuids_complete.p_uuids  = m_adv_uuids;
	//init.advdata.uuids_complete.p_uuids  = &amp;amp;m_adv_uuids[1];
	/*new*/
	init.config.ble_adv_whitelist_enabled          = false;//true;	
	init.srdata.name_type               = BLE_ADVDATA_NO_NAME;//BLE_ADVDATA_NO_NAME;
	init.srdata.uuids_complete.uuid_cnt = 1;//sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
	init.srdata.uuids_complete.p_uuids  = &amp;amp;m_adv_uuids[0];
	init.srdata.uuids_more_available.uuid_cnt = 1;
	init.srdata.uuids_more_available.p_uuids = &amp;amp;m_adv_uuids[1];
	/*new*/
	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.config.ble_adv_extended_enabled = true;
	
    advertising_config_get(&amp;amp;init.config);
    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;p&gt;Will it affect the scanning for services by host after the bluetooth connection?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/211682?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 06:34:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f8a3822-22a9-475c-9791-c5b98786dd1e</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Your advertising init looks ok. You don&amp;#39;t need to include the init.srdata.name_type in the srdata.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="bop123"][/quote]&lt;/p&gt;
&lt;p&gt;Is this: init.config.ble_adv_extended_enabled = true; required?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;It&amp;#39;s not required. Extended advertising is a BT5 feature which allows you to extend the advertising packet from 31 bytes and up to 255 bytes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="bop123"][/quote]&lt;/p&gt;
&lt;p&gt;, how do I add all of these to advertisement packet?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Both the Custom service and the DFU service is a 128-bit service. So unless extended advertising is used, the will use a lot of the available space in the advertising packet. As you effectively have 29 bytes of payload available in the advertising packet (or 29 x2 with scan response) you can only fit one 128-bit service in each advertising packet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&amp;nbsp;&lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/211388?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 23:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba621160-f5ab-47e5-ae38-4485ff04e853</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    uint32_t               err_code;
    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 = 1;//sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    //init.advdata.uuids_complete.p_uuids  = m_adv_uuids;
	init.advdata.uuids_complete.p_uuids  = &amp;amp;m_adv_uuids[0];
	/*new*/
	init.srdata.name_type               = BLE_ADVDATA_NO_NAME;
	init.srdata.uuids_complete.uuid_cnt = 1;//sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
	init.srdata.uuids_complete.p_uuids  = &amp;amp;m_adv_uuids[1];
	/*new*/
	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.config.ble_adv_extended_enabled = true;
	
    advertising_config_get(&amp;amp;init.config);
    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;p&gt;This seems to work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is this&lt;/p&gt;
&lt;p&gt;init.config.ble_adv_extended_enabled = true;&lt;/p&gt;
&lt;p&gt;required?&lt;/p&gt;
&lt;p&gt;What if I wanted to add&lt;/p&gt;
&lt;p&gt;1. Custom gatt service&lt;/p&gt;
&lt;p&gt;2. HID service&lt;/p&gt;
&lt;p&gt;3. DFU service&lt;/p&gt;
&lt;p&gt;, how do I add all of these to advertisement packet?&lt;/p&gt;
&lt;p&gt;Should the&amp;nbsp;uuids_more_available be used?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/211229?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 12:02:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bad9ae6-3a41-4ecb-9b6e-51da2b84964d</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void advertising_init(void)
{
    uint32_t               err_code;
    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;
	
	/*new*/
	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;
	
    advertising_config_get(&amp;amp;init.config);
    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;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_buttonless_5F00_dfu_5F00_custom.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_buttonless_5F00_dfu_5F00_custom.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have also attached the full code.&lt;/p&gt;
&lt;p&gt;Also what adjustments do I need to make in advertising data for the full device name to be visible with custom gatt &amp;amp; dfu service? I removed the hid service.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/211111?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 07:33:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:437808b0-4752-49f8-b92a-669b8b0f1ab2</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Ok, I misunderstood your question.&lt;/p&gt;
&lt;p&gt;Could you please upload your advertising_init() function so that I can see how you tried adding the scan response data.&lt;/p&gt;
&lt;p&gt;Best regards, &lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/210689?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 11:33:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df98cad1-53cf-4c13-b78a-b97cf0790a52</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Yes&amp;nbsp; know but according to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial"&gt;https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial,&lt;/a&gt;&amp;nbsp;there seems to be a workaround to extend the packet to 62 bytes. Can you please help me with that, that is what I was asking in my question above&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID Keyboard + Custom GATT</title><link>https://devzone.nordicsemi.com/thread/210680?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 11:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98ce1bc1-233a-4bd0-ba03-f07fd4472ceb</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems that your advertising packet is full, that is why you are seeing the shortened &amp;quot;Nord&amp;quot; advertising name.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the advertising packet will only fit 31 bytes of data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&amp;nbsp;&lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>