You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project trying to implement "vendor defined" HID data. I have it working sending 8 bytes of data in two directions but I can't seem to change the payload size as I want.
I'm using the HID_DESCRIPTOR_VENDOR macro but I'm finding the documentation a little confusing.
I understand that HID reports in general are quick confusing and I'm not looking for an explanation of that.
Specifically, I this extract from the docs is giving me pause:
The resulting report should be a uint8_t byte array of the specified length in both Device to Host (IN) and Host to Device (OUT) directions
Is the "specified length" the length of the resultant list of USB_Descriptor_HIDReport_Datatype_t?
How can a single length be specified in two places (IN and OUT)?
I'm also unclear on what each of the parameters does. The names DataINUsage and DataINUsage are relatively clear but not with NumBytes there too.
Well, I stayed up getting into the USB HID specifications and tried a couple more things. I'm not sure what I was doing wrong before but I can now increase the packet size as expected.EDIT: scratching my head as now it doesn't seem to be working. I must be doing something else silly but I can't find it. Ugh.EDIT Again: I had somehow been using REPORT_SIZE for Endpoint0Size which can apparently only be a power of 2.
After reading the documentation excerpt again, I believe I understand it now. Some thoughts:
The resulting reports will be uint8_t byte arrays of NumBytes length in both directions.
The references to IN/OUT I understood to mean related to the DataINUsage and DataInUsage arguments. In my naivety on the USB spec, I did not realize "Usage" has specific meanings.
I am working on a project trying to implement "vendor defined" HID data. I have it working sending 8 bytes of data in two directions but I can't seem to change the payload size as I want.
I'm using the
HID_DESCRIPTOR_VENDOR
macro but I'm finding the documentation a little confusing.I understand that HID reports in general are quick confusing and I'm not looking for an explanation of that.
Specifically, I this extract from the docs is giving me pause:
Is the "specified length" the length of the resultant list of
USB_Descriptor_HIDReport_Datatype_t
?How can a single length be specified in two places (IN and OUT)?
I'm also unclear on what each of the parameters does. The names
DataINUsage
andDataINUsage
are relatively clear but not withNumBytes
there too.The GenericHID demo suggests
NumBytes
is actually what controls the size of the packets but I've had trouble changing that. It looks like another person has had similar confusion: https://www.avrfreaks.net/forum/generichidlufahidapivisualc-not-working-hid-recordsIt's also not clear if I can mess with
CollectionUsage
but I suspect that is a deeper HID spec thing.I've tried looking at the
#defined
ofHID_DESCRIPTOR_VENDOR
but that jumble is quite confusing (as expected from the HID spec).Any pointers greatly appreciated.
The text was updated successfully, but these errors were encountered: