<?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>Can&amp;#39;t read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19403/can-t-read-characteristics-of-ble-hid-service-example</link><description>I&amp;#39;m trying to implement the HID service on a custom nrf52832 board, unfortunately I&amp;#39;m running into problems. 
 Here&amp;#39;s what happens: Advertising, connecting to the board, service discovery, GPIOs (buttons &amp;amp; LEDs), reading the battery level, etc. all work</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Jan 2019 08:42:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19403/can-t-read-characteristics-of-ble-hid-service-example" /><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/163662?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 08:42:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1e9872f-2461-40a3-9154-ba0093da5f54</guid><dc:creator>GK</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;whats need to change for random passkey please help me i modified the code like below but central is not connecting.&lt;/p&gt;
&lt;p&gt;#define SEC_PARAM_BOND 1 /**&amp;lt; Perform bonding. */&lt;br /&gt;#define SEC_PARAM_MITM 1 /**&amp;lt; Man In The Middle protection not required. */&lt;br /&gt;#define SEC_PARAM_LESC 1 /**&amp;lt; LE Secure Connections not enabled. */&lt;br /&gt;#define SEC_PARAM_KEYPRESS 0 /**&amp;lt; Keypress notifications not enabled. */&lt;br /&gt;#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_KEYBOARD_ONLY&lt;/p&gt;
&lt;p&gt;#define SEC_PARAM_OOB 0 /**&amp;lt; Out Of Band data not available. */&lt;br /&gt;#define SEC_PARAM_MIN_KEY_SIZE 7 /**&amp;lt; Minimum encryption key size. */&lt;br /&gt;#define SEC_PARAM_MAX_KEY_SIZE 16&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;static void gap_params_init(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;br /&gt; ble_gap_conn_params_t gap_conn_params;&lt;br /&gt; ble_gap_conn_sec_mode_t sec_mode;&lt;/p&gt;
&lt;p&gt;// BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);&lt;br /&gt; BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(&amp;amp;sec_mode); &lt;br /&gt; &lt;br /&gt; err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode,&lt;br /&gt; (const uint8_t *) DEVICE_NAME,&lt;br /&gt; strlen(DEVICE_NAME));&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;gap_conn_params, 0, sizeof(gap_conn_params));&lt;/p&gt;
&lt;p&gt;gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;&lt;br /&gt; gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;&lt;br /&gt; gap_conn_params.slave_latency = SLAVE_LATENCY;&lt;br /&gt; gap_conn_params.conn_sup_timeout = CONN_SUP_TIMEOUT;&lt;/p&gt;
&lt;p&gt;err_code = sd_ble_gap_ppcp_set(&amp;amp;gap_conn_params);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;ble_gap_opt_t gap_opt;&lt;br /&gt; &lt;br /&gt; gap_opt.passkey.p_passkey = (uint8_t *)NULL; &lt;br /&gt; &lt;br /&gt; err_code = sd_ble_opt_set(BLE_GAP_OPT_PASSKEY,(const ble_opt_t *)&amp;amp;gap_opt); &lt;br /&gt; APP_ERROR_CHECK(err_code); &lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75293?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2017 10:06:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbbfdbb7-4a4c-4be8-afe9-f4736e8750a2</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Yes, the commented NRF_LOG(...) in app_error.h seems to be commented by a mistake.  I think they can be uncommented.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75292?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 00:43:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:886b6b93-21b1-4b90-9889-e62ee6fbb212</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Did you look into the NRF_LOG problem I mentioned?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75291?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 00:43:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e22434e-4988-4ef8-b8fa-74842f4f3158</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Anyway, thank you again for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75290?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 00:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb860d88-c86e-4194-b807-cd067744d8a7</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Hey Kristin, sorry for the long delay. I was eventually able to get the HID service running. Nice catch with those &amp;quot;protected services&amp;quot;. Android could&amp;#39;ve definitely made that more clear. For some reason I didn&amp;#39;t get the disconnect in the log, quite the opposite, the battery level notifications kept coming in. Looks like the BLE stack on my phone is a little flaky, it doesn&amp;#39;t like changing HID descriptors at all (e.g. when switching from a keyboard to a mouse or gamepad). That&amp;#39;s why I couldn&amp;#39;t get your hex file to work, simply reconnecting or unbonding isn&amp;#39;t enough, I have to reboot the phone for it to work... The step by step guide in the examples should probably be updated with a remark about those limitations on Android. That&amp;#39;s what confused me in the first place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75285?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 12:08:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:514bc511-1390-45f6-b275-4d27286b9913</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I have updated my answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75289?ContentTypeID=1</link><pubDate>Sun, 05 Feb 2017 16:32:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06184693-eb08-4267-86e0-e18cd3ea955e</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Okay, I haven&amp;#39;t made myself clear enough. Your hex not working on my hardware does point to a hardware problem, but I really don&amp;#39;t see how that would happen. I&amp;#39;m using a OnePlus 3T with Android 7.0. Service discovery works fine, nRF Connect lists all the services on my device (battery service, device information service, a custom service, etc.) and can read all characteristics, except for the HID service. I.e. I click the read symbol of a HID characteristic and never get a result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75288?ContentTypeID=1</link><pubDate>Sun, 05 Feb 2017 16:24:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27051264-9889-4206-b9c4-fbaec95cc4f4</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Regarding the scheduler, yes that&amp;#39;s exactly why I&amp;#39;m asking. As I wrote the example doesn&amp;#39;t work for me, so it&amp;#39;s a bit hard to check. (But it&amp;#39;s more of a side question for me, I don&amp;#39;t really care about it.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75287?ContentTypeID=1</link><pubDate>Sun, 05 Feb 2017 16:23:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afb83378-b38a-4ed2-8cae-83773f18d000</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Okay, so maybe you could have a look at &lt;code&gt;components/libraries/util/app_error.h&lt;/code&gt;, the &lt;code&gt;app_error_log&lt;/code&gt; function has all the &lt;code&gt;NRF_LOG&lt;/code&gt; calls commented out, clearly by mistake. Looks like some debug work has made it into the release. It&amp;#39;s in both the 12.2 and 12.0 SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75286?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2017 07:45:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5302f0d3-1fb4-4eca-ad77-fffd5e343d20</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Okay, so at least the problem is not related to the firmware on the nRF52. If I understand correctly, it is service discovery that is failing (spinning). Which Android version and device are you using for the testing?&lt;/p&gt;
&lt;p&gt;Unfortunately, we don&amp;#39;t have a &amp;quot;formal&amp;quot; way of reporting bugs in the SDK. The best way is to post it here on devzone, someone from Nordic will pick it up here, and when it is a confirmed bug, it can be put on &lt;a href="https://devzone.nordicsemi.com/question/93241/what-are-sdk-12x0-known-issues/"&gt;this&lt;/a&gt; list.&lt;/p&gt;
&lt;p&gt;I see that the scheduler is being used in the ble_app_hids_keyboard example, so I guess there is a reason why it&amp;#39;s there. You can try to remove it, and check how the example behave, if it changes anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75284?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 14:09:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:183b6c5c-9f1c-4566-9257-120f63f207da</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;While this points to a hardware problem, I really have a hard time imagining what it could be. Especially since only the HID service makes problems, the battery service, device information service, etc. all work flawless. I disabled the external LFCLK in my sdk_config.h, but it doesn&amp;#39;t help. I&amp;#39;d be happy to show my schematic (via mail or so), but there&amp;#39;s not much to it except for a Fanstel BT832 module, external crystal and some buttons/LEDs.&lt;/p&gt;
&lt;p&gt;Also some quick questions, is the scheduler needed to use the HID service? And is there a good place to report bugs/problems with the SDK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75283?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 13:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f70816fe-eab1-4181-976f-9b20d7935343</guid><dc:creator>Sven</dc:creator><description>&lt;p&gt;Hey, thanks a lot for you effort. Unfortunately I still have the same problem (e.g. reading &lt;code&gt;0x2A4B&lt;/code&gt; report map). I flashed the file with &lt;code&gt;nrfjprog --program ~/Downloads/ble_app_hids_keyboard.hex -f nrf52 --sectorerase&lt;/code&gt; and it advertises as &lt;code&gt;K_KEYBOARD&lt;/code&gt; now. I also tried a full erase first and then reflashed the softdevice and hex file afterwards with the same result. There is a 32.768kHz crystal on my board.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't read characteristics of BLE HID service example</title><link>https://devzone.nordicsemi.com/thread/75282?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 12:58:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c92ecad9-4841-47de-9f35-65c91c9432e7</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;When I test here, the HID example, ble_app_hids_keyboard (SDK 12.2.0, S132, v3.0.0), works fine. I don&amp;#39;t see the behavior that you describe. Could you try the same hex file as I am using, and check if that hex file results in the same problem on your side: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0456.ble_5F00_app_5F00_hids_5F00_keyboard.hex"&gt;ble_app_hids_keyboard.hex&lt;/a&gt; (the hex file uses external LFCLK crystal as LFCLK clock source)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 06.02.2017:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After a closer look at the keyboard example, I see that the scheduler is only being used for the simulated battery measurement updates..&lt;/p&gt;
&lt;p&gt;I now think I understand what you mean. I re-tested: I connected my phone to the advertising keyboard using nRF Connect. When I then enabled  the &amp;quot;report&amp;quot; characteristics, there was a disconnect. Looking at the log in nRF Connect, the disconnect occured due to a &amp;quot;Blueooth priviledged&amp;quot; permission. From &lt;a href="https://devzone.nordicsemi.com/blogs/1046/what-to-keep-in-mind-when-developing-your-ble-andr/"&gt;this&lt;/a&gt; blog post, chapter 4.6, it happened because HID is in-built in Android naively.&lt;/p&gt;
&lt;p&gt;Therefore, please try the following: Connect to the keyboard device from the Bluetooth setting in the Settings menu on the phone. At the top bar on the phone there will be instructions on how to proceed (connect properly).&lt;/p&gt;
&lt;p&gt;To test that the keyboard is working (using a nRF52-DK), put the phone cursor in a search window, press button 1, and see that &amp;#39;hello&amp;#39; will be written.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>