hidraw hid_enumerate issue with vendor / product IDs #609
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#609
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current code for
hid_enumeratedoes not properly handle zero value product and vendor IDs. At present the code will check both product and vendor IDs for matches if either of them is non-zero, due to this conditional:vendor_id != 0 || product_id != 0. However the public header documentation implies they should be considered separately and not as a group. This is to allow you to get all devices matching the vendor id, product id, or both, or all devices period. Howeverhidrawas written will only return devices matching both or all devices (if both are zero).I don't believe that's true.
There lines are making sure of that.
Is your observation based on visual code analysys or a result of your testing?
Nevermind, I got the impression because of the outer conditional.