<?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 suspend request</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87044/hid-suspend-request</link><description>Hey, 
 I am using an HID keyboard + keyboard toggle in my project, 
 When the nrf connects an iOS phone, it takes control over the phone&amp;#39;s keyboard. 
 To release the kb we use toggle hid report send. 
 The problem is, if we send the hid, when the phone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Apr 2022 06:49:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87044/hid-suspend-request" /><item><title>RE: hid suspend request</title><link>https://devzone.nordicsemi.com/thread/365297?ContentTypeID=1</link><pubDate>Thu, 28 Apr 2022 06:49:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f53ea1fe-e265-454b-b916-e204ac4dd3d0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t think of seeing something like this before. Do you have a spare nRF52 series DK or a dedicated Bluetooth sniffer device? If so, you could try taking a sniffer trace of what is happening on the air with the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE"&gt;nRF Sniffer&lt;/a&gt; for example, so we can get a better idea of what is going on over the air, to see what the phone returns when it gets this toggle report.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hid suspend request</title><link>https://devzone.nordicsemi.com/thread/365129?ContentTypeID=1</link><pubDate>Wed, 27 Apr 2022 08:58:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c51f8391-0618-472e-8393-b18a228a9ffd</guid><dc:creator>kobinrf</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;the function is returned ok.&lt;/p&gt;
&lt;p&gt;Also, as I said, it the phone is in a text field, the toggle works as expected.&lt;/p&gt;
&lt;p&gt;When the phone is not in a text field, the function does return OK, and the report is sent, but the toggle does not take effect.&lt;/p&gt;
&lt;p&gt;Have someone ever encountered something like this?&lt;/p&gt;
&lt;p&gt;tnx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hid suspend request</title><link>https://devzone.nordicsemi.com/thread/364888?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 09:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1d8ac8b-dd78-4d84-96ca-7951e352b584</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;By the toggle report not taking effect at all, is the toggle report being called in your application at all, and if so does it return any error codes? Have you tried debugging to see what actually is going on with this function? I don&amp;#39;t see any glaring issues with it. But then again, it&amp;#39;s hard to spot just by looking at it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hid suspend request</title><link>https://devzone.nordicsemi.com/thread/364629?ContentTypeID=1</link><pubDate>Mon, 25 Apr 2022 08:23:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38a06992-bdd8-427c-89ea-a19b88beef39</guid><dc:creator>kobinrf</dc:creator><description>&lt;p&gt;Thanks for the reply.&lt;br /&gt;I am using the nRF5 SDK and not the nRF Connect SDK.&lt;/p&gt;
&lt;p&gt;What about the toggle report that does not take effect?&lt;/p&gt;
&lt;p&gt;could we do something about that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hid suspend request</title><link>https://devzone.nordicsemi.com/thread/364621?ContentTypeID=1</link><pubDate>Mon, 25 Apr 2022 08:05:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04d4b245-94ac-4098-a8fa-371dec63b267</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Are you using the nRF5 SDK or nRF Connect SDK for development? From the code snippets you have added&amp;nbsp;seems like the nRF5 SDK, but the links are from the nRF Connect SDK documentation. But yes, these seem helpful if you&amp;#39;re using the nRF Connect SDK for development, as it does not seem to be part of the nRF5 SDK. In which case you might need to disconnect/connect manually.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hid suspend request</title><link>https://devzone.nordicsemi.com/thread/364562?ContentTypeID=1</link><pubDate>Sun, 24 Apr 2022 07:06:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81c85ae3-3774-44ea-aff5-9e6ace1cc397</guid><dc:creator>kobinrf</dc:creator><description>&lt;p&gt;Hey Simon,&lt;/p&gt;
&lt;p&gt;1) This is how I initialize the HID:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;/**@brief Function for initializing HID Service.&lt;br /&gt; */&lt;br /&gt;static void hids_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;br /&gt; ble_hids_init_t hids_init_obj;&lt;br /&gt; ble_hids_inp_rep_init_t * p_input_report;&lt;br /&gt; ble_hids_outp_rep_init_t * p_output_report;&lt;br /&gt; ble_hids_feature_rep_init_t * p_feature_report;&lt;br /&gt; uint8_t hid_info_flags;&lt;/p&gt;
&lt;p&gt;static ble_hids_inp_rep_init_t input_report_array[2];&lt;br /&gt; static ble_hids_outp_rep_init_t output_report_array[1];&lt;br /&gt; static ble_hids_feature_rep_init_t feature_report_array[1];&lt;br /&gt; static uint8_t report_map_data[] =&lt;br /&gt; {&lt;br /&gt; 0x05, 0x01, // Usage Page (Generic Desktop)&lt;br /&gt; 0x09, 0x06, // Usage (Keyboard)&lt;br /&gt; 0xA1, 0x01, // Collection (Application)&lt;br /&gt; 0x85, 0x01, // Report Id (1)&lt;br /&gt; 0x05, 0x07, // Usage Page (Key Codes)&lt;br /&gt; 0x19, 0xe0, // Usage Minimum (224)&lt;br /&gt; 0x29, 0xe7, // Usage Maximum (231)&lt;br /&gt; 0x15, 0x00, // Logical Minimum (0)&lt;br /&gt; 0x25, 0x01, // Logical Maximum (1)&lt;br /&gt; 0x75, 0x01, // Report Size (1)&lt;br /&gt; 0x95, 0x08, // Report Count (8)&lt;br /&gt; 0x81, 0x02, // Input (Data, Variable, Absolute)&lt;/p&gt;
&lt;p&gt;0x95, 0x01, // Report Count (1)&lt;br /&gt; 0x75, 0x08, // Report Size (8)&lt;br /&gt; 0x81, 0x01, // Input (Constant) reserved byte(1)&lt;/p&gt;
&lt;p&gt;0x95, 0x05, // Report Count (5)&lt;br /&gt; 0x75, 0x01, // Report Size (1)&lt;br /&gt; 0x05, 0x08, // Usage Page (Page# for LEDs)&lt;br /&gt; 0x19, 0x01, // Usage Minimum (1)&lt;br /&gt; 0x29, 0x05, // Usage Maximum (5)&lt;br /&gt; 0x91, 0x02, // Output (Data, Variable, Absolute), Led report&lt;br /&gt; 0x95, 0x01, // Report Count (1)&lt;br /&gt; 0x75, 0x03, // Report Size (3)&lt;br /&gt; 0x91, 0x01, // Output (Data, Variable, Absolute), Led report padding&lt;/p&gt;
&lt;p&gt;0x95, 0x06, // Report Count (6)&lt;br /&gt; 0x75, 0x08, // Report Size (8)&lt;br /&gt; 0x15, 0x00, // Logical Minimum (0)&lt;br /&gt; 0x25, 0x65, // Logical Maximum (101)&lt;br /&gt; 0x05, 0x07, // Usage Page (Key codes)&lt;br /&gt; 0x19, 0x00, // Usage Minimum (0)&lt;br /&gt; 0x29, 0x65, // Usage Maximum (101)&lt;br /&gt; 0x81, 0x00, // Input (Data, Array) Key array(6 bytes)&lt;/p&gt;
&lt;p&gt;0x09, 0x05, // Usage (Vendor Defined)&lt;br /&gt; 0x15, 0x00, // Logical Minimum (0)&lt;br /&gt; 0x26, 0xFF, 0x00, // Logical Maximum (255)&lt;br /&gt; 0x75, 0x08, // Report Size (8 bit)&lt;br /&gt; 0x95, 0x02, // Report Count (2)&lt;br /&gt; 0xB1, 0x02, // Feature (Data, Variable, Absolute)&lt;/p&gt;
&lt;p&gt;0xC0, // End Collection (Application)&lt;br /&gt; // Report ID 2: Advanced buttons&lt;br /&gt; 0x05, 0x0C, // Usage Page (Consumer)&lt;br /&gt; 0xA1, 0x01, // Collection (Application)&lt;br /&gt; 0x85, 0x02, // Report Id (2)&lt;br /&gt; 0x15, 0x00, // Logical minimum (0)&lt;br /&gt; 0x25, 0x01, // Logical maximum (1)&lt;br /&gt; 0x0A, 0xAE, 0x01, // Usage (AL Keyboard Layout)&lt;br /&gt; 0x75, 0x01, // Report Size (1)&lt;br /&gt; 0x95, 0x01, // Report Count (1)&lt;br /&gt; 0x81, 0x06, // Input (Data,Value,Relative,Bit Field)&lt;br /&gt; 0xC0 // End Collection&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;memset((void *)input_report_array, 0, sizeof(ble_hids_inp_rep_init_t));&lt;br /&gt; memset((void *)output_report_array, 0, sizeof(ble_hids_outp_rep_init_t));&lt;br /&gt; memset((void *)feature_report_array, 0, sizeof(ble_hids_feature_rep_init_t));&lt;/p&gt;
&lt;p&gt;// Initialize HID Service&lt;br /&gt; p_input_report = &amp;amp;input_report_array[INPUT_REPORT_KEYS_INDEX];&lt;br /&gt; p_input_report-&amp;gt;max_len = INPUT_REPORT_KEYS_MAX_LEN;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_id = INPUT_REP_REF_ID;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_INPUT;&lt;/p&gt;
&lt;p&gt;p_input_report-&amp;gt;sec.cccd_wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;// Initialize HID Service&lt;br /&gt; p_input_report = &amp;amp;input_report_array[INPUT_REPORT_TOGGLE_INDEX];&lt;br /&gt; p_input_report-&amp;gt;max_len = INPUT_REPORT_KEYS_MAX_LEN;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_id = INPUT_REP_TOGGLE_ID;&lt;br /&gt; p_input_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_INPUT;&lt;/p&gt;
&lt;p&gt;p_input_report-&amp;gt;sec.cccd_wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;br /&gt; p_input_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;br /&gt; p_input_report = &amp;amp;input_report_array[INPUT_REPORT_KEYS_INDEX];&lt;/p&gt;
&lt;p&gt;p_output_report = &amp;amp;output_report_array[OUTPUT_REPORT_INDEX];&lt;br /&gt; p_output_report-&amp;gt;max_len = OUTPUT_REPORT_MAX_LEN;&lt;br /&gt; p_output_report-&amp;gt;rep_ref.report_id = OUTPUT_REP_REF_ID;&lt;br /&gt; p_output_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_OUTPUT;&lt;/p&gt;
&lt;p&gt;p_output_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;br /&gt; p_output_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;p_feature_report = &amp;amp;feature_report_array[FEATURE_REPORT_INDEX];&lt;br /&gt; p_feature_report-&amp;gt;max_len = FEATURE_REPORT_MAX_LEN;&lt;br /&gt; p_feature_report-&amp;gt;rep_ref.report_id = FEATURE_REP_REF_ID;&lt;br /&gt; p_feature_report-&amp;gt;rep_ref.report_type = BLE_HIDS_REP_TYPE_FEATURE;&lt;/p&gt;
&lt;p&gt;p_feature_report-&amp;gt;sec.rd = SEC_JUST_WORKS;&lt;br /&gt; p_feature_report-&amp;gt;sec.wr = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hid_info_flags = HID_INFO_FLAG_REMOTE_WAKE_MSK | HID_INFO_FLAG_NORMALLY_CONNECTABLE_MSK;&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;hids_init_obj, 0, sizeof(hids_init_obj));&lt;/p&gt;
&lt;p&gt;hids_init_obj.evt_handler = on_hids_evt;&lt;br /&gt; hids_init_obj.error_handler = service_error_handler;&lt;br /&gt; hids_init_obj.is_kb = true;&lt;br /&gt; hids_init_obj.is_mouse = false;&lt;br /&gt; hids_init_obj.inp_rep_count = 2;&lt;br /&gt; hids_init_obj.p_inp_rep_array = input_report_array;&lt;br /&gt; hids_init_obj.outp_rep_count = 1;&lt;br /&gt; hids_init_obj.p_outp_rep_array = output_report_array;&lt;br /&gt; hids_init_obj.feature_rep_count = 1;&lt;br /&gt; hids_init_obj.p_feature_rep_array = feature_report_array;&lt;br /&gt; hids_init_obj.rep_map.data_len = sizeof(report_map_data);&lt;br /&gt; hids_init_obj.rep_map.p_data = report_map_data;&lt;br /&gt; hids_init_obj.hid_information.bcd_hid = BASE_USB_HID_SPEC_VERSION;&lt;br /&gt; hids_init_obj.hid_information.b_country_code = 0;&lt;br /&gt; hids_init_obj.hid_information.flags = hid_info_flags;&lt;br /&gt; hids_init_obj.included_services_count = 0;&lt;br /&gt; hids_init_obj.p_included_services_array = NULL;&lt;/p&gt;
&lt;p&gt;hids_init_obj.rep_map.rd_sec = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.hid_information.rd_sec = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hids_init_obj.boot_kb_inp_rep_sec.cccd_wr = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.boot_kb_inp_rep_sec.rd = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hids_init_obj.boot_kb_outp_rep_sec.rd = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.boot_kb_outp_rep_sec.wr = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;hids_init_obj.protocol_mode_rd_sec = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.protocol_mode_wr_sec = SEC_JUST_WORKS;&lt;br /&gt; hids_init_obj.ctrl_point_wr_sec = SEC_JUST_WORKS;&lt;/p&gt;
&lt;p&gt;err_code = ble_hids_init(&amp;amp;m_hids, &amp;amp;hids_init_obj);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;2) This is how we send the Toggle report:&lt;/p&gt;
&lt;p&gt;uint8_t release[] = {0};&lt;br /&gt; uint8_t keyboard_toggle[] = {1};&lt;br /&gt; uint32_t err_code = ble_hids_inp_rep_send(&amp;amp;m_hids, HID_TOGGLE_REPORT_INDEX, sizeof(keyboard_toggle), keyboard_toggle, innerConHandle);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; ble_hids_inp_rep_send(&amp;amp;m_hids, HID_TOGGLE_REPORT_INDEX, sizeof(release), release, innerConHandle);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;3) I searched some in the nrf and saw this:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;bt_hogp_suspend&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;&lt;em&gt;struct&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bluetooth_services/services/hogp.html#c.bt_hogp"&gt;&lt;span&gt;bt_hogp&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;*hogp&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;int&amp;nbsp;bt_hogp_exit_suspend(&lt;em&gt;struct&lt;/em&gt;&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bluetooth_services/services/hogp.html#c.bt_hogp"&gt;bt_hogp&lt;/a&gt;&amp;nbsp;*hogp)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;Would this help with my requierment?&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span&gt;Tnx a lot&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;Kobi&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: hid suspend request</title><link>https://devzone.nordicsemi.com/thread/363804?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 08:54:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f79a0397-13d5-4a2c-823f-079936720ce6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kobi&lt;/p&gt;
&lt;p&gt;I assume this HID keyboard you&amp;#39;re making is going to use HID over GATT since it&amp;#39;s connecting to a phone, instead of HID over USB. The HID over GATT don&amp;#39;t have anything like the suspend feature you&amp;#39;re mentioning here as far as I know. Can you show me the &amp;quot;toggle HID report&amp;quot; you use to release the keyboard now? I don&amp;#39;t see why this shouldn&amp;#39;t work when the phone isn&amp;#39;t in a text field, as it should still be connected to the keyboard.&lt;/p&gt;
&lt;p&gt;An alternative would be to manually disconnect/connect when you want to release the phone from the board, and then connect when you want to use it again. This shouldn&amp;#39;t require anything from the iOS phone as long as the devices are bonded.&lt;/p&gt;
&lt;p&gt;What SDK and SDK version are you using?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>