-
Notifications
You must be signed in to change notification settings - Fork 408
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
mac: Set a valid interface number on hid_device_info for USB HID dev… #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have my mac available right now, so I cannot try and verify the update.
Otherwise - the change looks good.
Previously the interface would never be set on Mac. This presents a big pain because retrieving interface numbers can be the only way to distinguish between the interfaces returned by HIDAPI. This change makes it possible to retrieve interface number from an hid_device_info on Mac for USB HID devices only. It is unclear if the macOS IOKit library returns valid interface numbers for non-HID USB devices. Because of this, I have opted to simply skip that case - leave it initialised to `-1`. In the future, we can easily relax this restriction if it turns out IOKit correctly returns interface number with non-HID USB devices. For now, this commit brings 90% of the value at 5% of the risk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a few quick tests on MacOS 10.14.5 on a few HID Raw devices and nothing seems amiss. Thanks!
Thanks @todbot for merging this. However, can we use "rebase & merge" strategy to keep linear history? There are many advantages, the most important for me is possibility to |
A good start. Try also: @Qbicz I suggest also allowing |
@todbot yes, it's a good place. Basically, you apply your commits on top of the existing history and resolve any conflicts in your commit that introduces the change. I have changed settings to allow |
…ices
Previously the interface would never be set on Mac.
This presents a big pain because retrieving interface numbers can be the
only way to distinguish between the interfaces returned by HIDAPI.
This change makes it possible to retrieve interface number from an
hid_device_info on Mac for USB HID devices only.
It is unclear if the Mac OS IOKit library returns valid interface numbers for non-HID USB devices. Because of this, I have opted to simply skip that case - leave it initialised to
-1
.In the future, we can easily relax this restriction if it turns out IOKit correctly returns interface number with non-HID USB devices. For now, this PR brings 90% of the value at 5% of the risk.
Re-open of signal11/hidapi#380