<?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 output report size and count</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46328/hid-output-report-size-and-count</link><description>Hello, 
 I am developing a simple HID device with output report to receive data from PC. I took keyboard example as base project and I want to increase output report size (count) up to 64 bytes. 
 I can successfully send data from PC to device when output</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Apr 2019 14:23:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46328/hid-output-report-size-and-count" /><item><title>RE: HID output report size and count</title><link>https://devzone.nordicsemi.com/thread/182938?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2019 14:23:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cff1e41-e973-4b1a-8527-1cccc2a19ffd</guid><dc:creator>ilia</dc:creator><description>&lt;p&gt;Ok, I found what causes such behavior.&lt;/p&gt;
&lt;p&gt;Apparently, changing REPORT_COUNT in HID descriptor is not enough. For example, there is a&amp;nbsp;app_usbd_hid_kbd_internal.h file for keyboard descriptor. In this file there is global definition of app_usbd_hid_kbd_t class:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define APP_USBD_HID_KBD_GLOBAL_DEF_INTERNAL(instance_name,                                        \
                                             interface_number,                                     \
                                             endpoint,                                             \
                                             user_ev_handler,                                      \
                                             subclass_boot)                                        \
    static app_usbd_hid_report_buffer_t CONCAT_2(instance_name, _in)[1];                           \
    static uint8_t CONCAT_2(instance_name, _ep) = {MACRO_MAP(APP_USBD_HID_KBD_INTERVAL,endpoint)}; \
    APP_USBD_HID_GENERIC_GLOBAL_OUT_REP_DEF(CONCAT_2(instance_name, _out), 1 + 1);                 \
    APP_USBD_CLASS_INST_GLOBAL_DEF(                                                                \
        instance_name,                                                                             \
        app_usbd_hid_kbd,                                                                          \
        &amp;amp;app_usbd_hid_kbd_class_methods,                                                           \
        APP_USBD_HID_KBD_CONFIG(interface_number, endpoint),                                       \
        (APP_USBD_HID_KBD_INST_CONFIG(CONCAT_2(instance_name, _in),                                \
                                      &amp;amp;CONCAT_2(instance_name, _out),                              \
                                      user_ev_handler,                                             \
                                      subclass_boot,                                               \
                                      &amp;amp;CONCAT_2(instance_name, _ep)))                              \
    )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The following line looks like definition of the output report:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;APP_USBD_HID_GENERIC_GLOBAL_OUT_REP_DEF(CONCAT_2(instance_name, _out), 1 + 1); &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;That &amp;quot;1 + 1&amp;quot; looks like size of this output report: 1 byte for Report_ID + 1 byte for data that was defined in descriptor.&lt;/p&gt;
&lt;p&gt;Thus, when I change Report_Count in descriptor, I can&amp;#39;t receive more data because I specified here only 2 byte buffer. And I also can&amp;#39;t receive same 1 byte data because my descriptor requires larger byte count.&lt;/p&gt;
&lt;p&gt;So, in the global definition for my custom hid class I changed that&amp;nbsp;&amp;quot;1 + 1&amp;quot; to &amp;quot;1 + 64&amp;quot; and updated my descriptor with 64 bytes output report count. And it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID output report size and count</title><link>https://devzone.nordicsemi.com/thread/182933?ContentTypeID=1</link><pubDate>Mon, 22 Apr 2019 12:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3a1360d-937a-43d9-949f-a0cb7eab9ed0</guid><dc:creator>ilia</dc:creator><description>&lt;p&gt;Hi. Yes, I tried different report length. I use HID over USB, not over BLE. I tried to use your descriptor, but I got the same failed result. When I changed report count to 1, data was sent successfully. I tried to use hidapi from c, and I got the same results.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Maybe I need to make some additional configuration in firmware on the device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID output report size and count</title><link>https://devzone.nordicsemi.com/thread/182904?ContentTypeID=1</link><pubDate>Sun, 21 Apr 2019 13:00:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e917cf74-2b85-4a10-b947-804bd923d444</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Have you tried report length lower than 64 bytes? Length of the report cannot be longer than length of a BLE packet (20 bytes by default, and we had no success to send larger reports even with increased packet length). Also note that HID report packet that comes from PC should have a length exactly as report count in your descriptor, first byte is a report ID that is 0x00 by default, so your report&amp;nbsp; will start from byte 0x00 and take (REPORT_COUNT-1) bytes of your data. Though I am not sure whether it is correct in case with c#, I use hidapi library that handles all this magic for me.&lt;/p&gt;
&lt;p&gt;Here is my working in-out HID descriptor:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	0x06, 0x00, 0xff,  // USAGE_PAGE (Vendor Defined)
	0x09, 0x01,        // USAGE (1)
	0xa1, 0x01,        // COLLECTION (Application)
	0x09, 0x20,        // USAGE (Input Report Data)
	0x15, 0x00,        // LOGICAL_MINIMUM (0)
	0x26, 0xff, 0x00,  // LOGICAL_MAXIMUM (255)
	0x75, 0x08,        // REPORT_SIZE (8)
	0x95, 0x14,        // REPORT_COUNT (20)
	0x81, 0x02,        // INPUT (Data,Var,Abs)
	0x09, 0x21,        // USAGE (Output Report Data)
	0x15, 0x00,        // LOGICAL_MINIMUM (0)
	0x26, 0xff, 0x00,  // LOGICAL_MAXIMUM (255)
	0x75, 0x08,        // REPORT_SIZE (8)
	0x95, 0x14,        // REPORT_COUNT (20)
	0x91, 0x02,        // OUTPUT (Data,Var,Abs)
	0xc0               // END_COLLECTION
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID output report size and count</title><link>https://devzone.nordicsemi.com/thread/182799?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2019 08:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d62f67dc-c023-4872-9a8d-f93473760cc0</guid><dc:creator>ilia</dc:creator><description>&lt;p&gt;What should I do to be able to receive reports from PC with size more than 1 byte?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>