The current code for hid_enumerate does 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. However hidraw as written will only return devices matching both or all devices (if both are zero).
The current code for
hid_enumerate
does 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. Howeverhidraw
as written will only return devices matching both or all devices (if both are zero).