Skip to content

Fixed the iManufacturer and iProduct HID string descriptor functions #275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

gigaj0ule
Copy link

iManucaturer and iProduct were not properly written for HID devices, as the setup.wlength struct element did not represent the real length of the string descriptor.

This caused HID driver errors on Windows AMD_64.

String descriptors are supposed to be in unicode, so 2*sizeof(string) gives the proper length.

iManucaturer and iProduct were not properly written for HID devices, as the setup.wlength struct element did not represent the real length of the string descriptor.

This caused HID driver errors on Windows AMD_64.

String descriptors are supposed to be in unicode, so 2*sizeof(string) gives the proper length.
@gigaj0ule gigaj0ule changed the title Fix iManufacturer and iProduct string descriptors Fixed the iManufacturer and iProduct string descriptor functions Nov 10, 2017
@gigaj0ule gigaj0ule changed the title Fixed the iManufacturer and iProduct string descriptor functions Fixed the iManufacturer and iProduct HID string descriptor functions Nov 10, 2017
@facchinm
Copy link
Member

facchinm commented Nov 13, 2017

LGTM, testing it!

edit: the second parameter of sendStringDescriptor is maxlen, not the actual length; it actually sends the right length of the string (when "Unicoded") IF the string is \0 terminated. Probably the HID problem arises from a missing termination that makes the sting longer than expected.
Could you post the problematic sketch/library in #274 ? Thanks! Closing this one in the meantime, will reopen if needed.

@facchinm facchinm closed this Nov 13, 2017
boseji pushed a commit to go-ut/combined-ArduinoCore-samd that referenced this pull request Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants