Closed mmatloka closed 7 years ago
Sorry for the delay, just seen this message.
I've not tested this scenario, and would rely on the behaviour of the underlying hidapi library. If you are able to construct this as a test case I would be interested in the result.
Any update on this?
Finally I was not able to test such scenario.
OK. Thanks for the update. I might be in a position to test this myself now, so I'll leave this open to remind me.
Finally got around to testing this. Here are my observations:
null
for serial number caused the first device in the enumeration to be attached (a generally random choice). Overall it appears capable of supporting them but this would require comprehensive testing in a production environment to be certain.
Ready for review and close.
Reviewed. Looks ok.
Merged and closed.
What if the serialNumber is also the same for both devices? So far I know, device SN may or may not be unique. We are working with a vendor which produces devices for vets. We have 2 units of the same device for testing and development purposes and at some point, we realized that both devices had the same vid, pid and iSerial. Don't know if this is normal or we just stumbled upon a mediocre vendor.
The only different serial number we get is the one we get when we address some request to the device and it does respond with the serial number defined by software which is totally different from the one we get from the hardware.
Is there any other device attribute candidate to be UID?
In USB HID there are three main string descriptors: product
, manufacturer
and serial
. At a low level the iSerial
value is the index on to a device string which contains the actual serial number. However this index is dereferenced by Hidapi
into the actual device string so whatever hid4java
is returning is the actual serial
string within the device.
Attempting to dig further with, say, getIndexedString()
will fail (return code -1) as it isn't fully implemented within hidapi
(seems to be a TODO item for quite some time).
Hi, Thx for making this library, I have encountered a few issues with usb4java ;) I have a question - there can be attached multiple devices with the same vid and pid. How then
hidServices.getHidDevice
will react?