Hello,
I'm trying to make a report descriptor that contains many report IDs with different size, some with 1 byte and some with 2 bytes. At first is that possible?
I supposed that it's possible, and changed the wMaxPacketSize to 3 bytes (the max of bytes to send + one byte for the report ID) , but when I send data from the host to my stm32 I only receive the first 2 bytes the report ID and the next byte. Am I missing something? Is there something else that I have to change in the descriptor file?
Thanks,
> I'm trying to make a report descriptor that contains many report IDs with different size, some with 1 byte and some with 2 bytes. At first is that possible?
Of course, it's possible. But is the report ID really required for your application?
As all of your reports are just one or two bytes, - Define single 3 bytes report on the report descriptor. - The first byte is used as an "identifier" specific to your application. - ONE byte data is placed at the second byte, the third byte is filled with 0 (padding) - TWO bytes data occupies the second and the third bytes of the report.
After all, there is no difference on your application code from those in which report ID is applied, on both side, firmware and the PC application.
Tsuneo
I get rid of report ID and just want to try a simple example sending two bytes.
0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xa1, 0x01, // COLLECTION (Application) 0x09, 0x02, // USAGE (Vendor Usage 1) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) 0x95, 0x02, // REPORT_COUNT (2) 0x75, 0x08, // REPORT_SIZE (8) 0x91, 0x86, // OUTPUT (Data,Var,Rel,Vol) 0x09, 0x02, // USAGE (Vendor Usage 2) 0x15, 0x00, // LOGICAL_MINIMUM (0) 0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255) 0x95, 0x02, // REPORT_COUNT (2) 0x75, 0x08, // REPORT_SIZE (8) 0xb1, 0x86, // FEATURE (Data,Var,Rel,Vol) 0xc0 // END_COLLECTION
I'm using usb HID demonstrator for sending data and usblyzer to visualize the data. It seems that data just wont send.