Hello, I'm trying to send data my usb device using simpleHIDWrite tool, but I'm getting this error: access violation at address 00000, read of address 00000 Does anyone have an idea about what could be the source of this problem.
Here is my report descriptor:
0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined Page 1) 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, 0x40, // REPORT_COUNT (64) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x81, 0x02, // INPUT (Data,Var,Abs) 0x95, 0x40, // REPORT_COUNT (64) 0x09, 0x01, // USAGE (Vendor Usage 1) 0x91, 0x02, // OUTPUT (Data,Var,Abs) 0x95, 0x01, // REPORT_COUNT (1) 0x09, 0x01, // USAGE (Vendor Usage 1) 0xB1, 0x02, // FEATURE (Data,Var,Abs) 0xc0 // END_COLLECTION
> it seems that I always start by sending a zero even that the first byte is not defined to be zero.
It's the Windows way how MS implement PC HID driver. When your report descriptor on the device has no report ID, the default report ID (0) is assumed by the HID spec. On the firmware side, no report ID is preceded on the reports, exchanged by the device. But Windows application has to add the report ID: 0 before every type of reports. This report ID is deleted by the PC HID driver, when it is sent to the device. Also, this report ID is added by the HID PC driver, when it comes from the device.
Tsuneo
I'm really grateful for your help sir, Every thing is clear, but it is weird that this matter is not mentioned in the HID spec, or not very highlighted to attract my attention.