Question

I need to get a vendor id and device id from a known device path (like "D:\").
I need to do it in java but I could do it in c native code and call the function in java.
I've tried some java libraries such as javax.usb however I can't associate a device with it's path. Now I have finished all my ideas. Can someone help me or give me a way to do it? I need it for windows/macOS.

Était-ce utile?

La solution

Have a look at this post. You'll probably need to use JNA or JNI to interface with the native Windows SetupDi functions to parse through and find device paths that you care about.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top