Faced the question. I have enumerated USB devices and got symbolic link and handle to each. Then I need to get their DEVICE_DESCRIPTOR’s. This is done by enumerating all ports/nodes for each HUB, and retrieving descriptor for each plugged device on each node/port. The problem comes here - how to know which USB deivce is sitting on which node/port ? Or othrevise which descriptor belongs to which device identified by symbolic link or hande? Solution can be vendorID, but if there 2 devices of same type?
Martin McKeen wrote:
The problem comes here - how to know which USB deivce is
sitting on which node/port ?
This has been asked a few times, and the answer always is “you can’t”.
This poses no shortage of problems to a variety of applications, but…
wrote in message news:xxxxx@ntdev…
> Faced the question. I have enumerated USB devices and got symbolic link
> and handle to each. Then I need to get their DEVICE_DESCRIPTOR’s. This is
> done by enumerating all ports/nodes for each HUB, and retrieving
> descriptor for each plugged device on each node/port. The problem comes
> here - how to know which USB deivce is sitting on which node/port ? Or
> othrevise which descriptor belongs to which device identified by symbolic
> link or hande? Solution can be vendorID, but if there 2 devices of same
> type?
>
Or, if you are lucky, the serial number might be different.
Yep, not good. In this case I think I need to issue and ERROR in my app if there 2 devices of same vendor_ID found and request to unplug one. Then having just one device with unique VendorID I can know its DEVICE_DESCRIPTOR.