I want to read only 8 bytes from the device using hidtool.
My descriptor is (I changed only REPORT_COUNT):
Code: Select all
PROGMEM const char usbHidReportDescriptor[] = { /* USB report descriptor */
0x06, 0x00, 0xff, // USAGE_PAGE (Generic Desktop)
0x09, 0x01, // USAGE (Vendor Usage 1)
0xa1, 0x01, // COLLECTION (Application)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x08, // REPORT_COUNT (8) // was 128
0x09, 0x00, // USAGE (Undefined)
0xb2, 0x02, 0x01, // FEATURE (Data,Var,Abs,Buf)
0xc0 // END_COLLECTION
};
When using hidtool from the demo I always get 128 bytes:
Code: Select all
$ ./hidtool read
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x19
The numbers from 0x11 to 0x19 are hardcoded for testing, I return 8 at usbFunctionRead.
I have not found any hardcoded numbers in hidtool so I suspect that transfer sizes are taken from the operating system.
I always do a clean compile.
How can I read just 8 bytes using hidtool?