<?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>cant add a custom description to ble hid</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66084/cant-add-a-custom-description-to-ble-hid</link><description>hi , 
 im try to add some consumer keys and system keys to the project: 
 nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_hids_keyboard 
 and my code of hids_init() like this: 
 
 send key code : 
 
 
 
 in the pca10056,i press the button1,and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Sep 2020 11:36:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66084/cant-add-a-custom-description-to-ble-hid" /><item><title>RE: cant add a custom description to ble hid</title><link>https://devzone.nordicsemi.com/thread/270815?ContentTypeID=1</link><pubDate>Tue, 22 Sep 2020 11:36:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f02824d3-3523-424f-aaed-08aeedf3e874</guid><dc:creator>Edvin</dc:creator><description>[quote user="pipixia_8_8"]if press the key0,the api&amp;nbsp;cmd_ble_start_advertising will be called. and i prees the key0 and see the nrf connect .the device advertise disappear .[/quote]
&lt;p&gt;&amp;nbsp;Is this an issue, or is it the behavior that you desire?&lt;/p&gt;
&lt;p&gt;If it is an issue, have you tried debugging it? Does the log say anything? Do you see any logs at all?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="pipixia_8_8"]the device reset.so what shoul i do in the project&amp;nbsp;&amp;nbsp;&lt;span&gt;ble_app_hids_keyboard to change the mac of advertisement?&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;I struggle a bit to understand the flow here, but if you want to change the BLE address, look into the functions sd_ble_gap_addr_get() and sd_ble_gap_addr_set().&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cant add a custom description to ble hid</title><link>https://devzone.nordicsemi.com/thread/270728?ContentTypeID=1</link><pubDate>Tue, 22 Sep 2020 06:52:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04ac22cd-66cf-463e-8593-f22cc9a79b2d</guid><dc:creator>pipixia_8_8</dc:creator><description>&lt;p&gt;hi,thank for your reply.i have solve this problem .the problem is the value of&amp;nbsp;erase_bonds in init.&lt;/p&gt;
&lt;p&gt;and now i want to modify the advertise when runing.&lt;/p&gt;
&lt;p&gt;and my code like this in the&amp;nbsp;BSP_EVENT_KEY_0 of project&amp;nbsp;&lt;span&gt;nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_hids_keyboard&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void cmd_ble_start_advertising(uint8_t para,uint32_t pointer,uint8_t *data)
{
	
	if(para&amp;gt;2)
		return;
	
	
	
		ble_gap_addr_t ble_addr;
	  sd_ble_gap_adv_stop(m_advertising.adv_handle);
	

	
  uint32_t err_code = sd_ble_gap_addr_get(&amp;amp;ble_addr);
  APP_ERROR_CHECK(err_code);

	NRF_LOG_INFO(&amp;quot;ble_addr.addr[0] =%d.&amp;quot;,ble_addr.addr[0]);
//  ble_addr.addr[0] =0xff;// ble_addr.addr[0]+para;
  err_code = sd_ble_gap_addr_set(&amp;amp;ble_addr);
	NRF_LOG_INFO(&amp;quot;err_code =%d.&amp;quot;,err_code);
  APP_ERROR_CHECK(err_code);

	
	/*
	if (m_conn_handle == BLE_CONN_HANDLE_INVALID)
	{
			uint32_t err_code = ble_advertising_restart_without_whitelist(&amp;amp;m_advertising);
			if (err_code != NRF_ERROR_INVALID_STATE)
			{
					APP_ERROR_CHECK(err_code);
			}
	}
*/

    advertising_start(0);


}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;if press the key0,the api&amp;nbsp;cmd_ble_start_advertising will be called. and i prees the key0 and see the nrf connect .the device advertise disappear . and than i press the key0 again.the device reset.so what shoul i do in the project&amp;nbsp;&amp;nbsp;&lt;span&gt;ble_app_hids_keyboard to change the mac of advertisement?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cant add a custom description to ble hid</title><link>https://devzone.nordicsemi.com/thread/270607?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 13:06:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6511b72f-40ea-4c3c-b69e-81b617ccca1d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Perhaps one of your devices has old bonding data stored, while the other one doesn&amp;#39;t? Try to erase the bonding information from both sides. On the phone, use the &amp;quot;forget device&amp;quot; option, and on the nRF, erase the entire chip using &amp;quot;nrfjprog --eraseall&amp;quot;, and then reprogram it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If the issue seems to be related to some button functionality, perhaps you erase the bonding information based on some of your button status during startup?&lt;br /&gt;Does your advertising_init() function in main.c have an erase_bonds parameter as input?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cant add a custom description to ble hid</title><link>https://devzone.nordicsemi.com/thread/270543?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 10:31:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0eb8987-cbb9-40f5-8e03-478346281a1b</guid><dc:creator>pipixia_8_8</dc:creator><description>&lt;p&gt;hi，Edvin&lt;/p&gt;
&lt;p&gt;i have solve this problem ,the reason is the report id should be start with 1,and the&amp;nbsp;report_index of&amp;nbsp;ble_hids_inp_rep_send should be start with 0,becuase the frist element of arry&amp;nbsp;input_report_array is&amp;nbsp;input_report_array[0],but now the other problem is the bond problem.&lt;/p&gt;
&lt;p&gt;i comment the code&amp;nbsp; buttons_leds_init(&amp;amp;erase_bonds) in the main duncation. and find the once connect the pc ,and than reset nrf52840,and the jlink will report erro:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;00&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Encryption, error: 4102
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising.
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Disconnected
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Connected
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Encryption, error: 4102
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising.
00&amp;gt; 
00&amp;gt; &amp;lt;info&amp;gt; app: Disconnected&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the device in the status betwen connect and disconnect.&lt;/p&gt;
&lt;p&gt;and i seek the source api .i find the reason is the funcation : nrf_drv_gpiote_in_init&lt;/p&gt;
&lt;p&gt;in the project&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_hids_keyboard&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;if i conment the api&amp;nbsp;nrf_drv_gpiote_in_init in&amp;nbsp;app_button_init,the erro 4102 will report,&amp;nbsp;otherwise the device work well.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;so i dont konw why the pins input funcation will infulence the funcation of bond?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cant add a custom description to ble hid</title><link>https://devzone.nordicsemi.com/thread/270494?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 08:38:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e10ef52-5efd-40e3-90d2-7ce30d8cf071</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What is located around line 1786 in your main.c? What function returned 12 [NRF_ERROR_DATA_SIZE] ?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know exactly how to add a custom descriptor to the HID table, but if it leads to an increased HID report, then you probably need to increase the MTU size, or the characteristic value size. Try to debug to figure out why the function that returned 12 returned it. Was there a check inside the function that returned it, or the softdevice call (sd_...() )?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>