[libhid-discuss] Matching usb devices
arnold at psilent.net
Thu Oct 9 03:31:49 UTC 2008
Hi all, good work on this project..
I was wondering if anyone knows why the hid_compare_usb_device function does
a bitwise AND of the vendor and product IDs? For example, the product ID is
matched with the following code..
if (dev->descriptor.idVendor > 0 && (dev->descriptor.idVendor &
match->vendor_id) == match->vendor_id)
The problem I'm having is this. If all the 1s in the descriptor.idVendor
match the 1s in the vendor_id I'm looking for, it will register as a match
when in fact they are different IDs. I can work around this by taking
advantage of the custom match function but wanted to run this by somebody.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the libhid-discuss