USB HID generic example questions

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by emanuelj on Fri Oct 03 02:00:23 MST 2014
Hello everyone,

I'm a beginner in USB-programming and have some questions about USB-communication.
I'm using the usbd_lib_hid_generic-example (lpcopen v2.10) with the LPC1769 microcontroller and would like to make it communicating with a host-pc.
It already works fine, but what I don't understand is that I get an error when I want to send less (and more) than 8 bytes (which I configured in hid_desc.c) from PC to the device.

hid_desc.c is configured as it follows:

#define HID_INPUT_REPORT_BYTES       8/* size of report in Bytes */
#define HID_OUTPUT_REPORT_BYTES      8/* size of report in Bytes */
#define HID_FEATURE_REPORT_BYTES     8/* size of report in Bytes */

Means this that I have to transmit 8 bytes, no more, no less, to the device?
Would it be possible to change the code that this is only the MAXIMUM number of bytes, so that I can transmit less than 8 bytes?

Furthermore I don't know what FEATURE_REPORT means. Whats the purpose of a feature-report?

Thank you for your answers!