0

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.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Sceik
  • 275
  • 1
  • 3
  • 13

1 Answers1

0

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.

Community
  • 1
  • 1
Preston
  • 2,543
  • 1
  • 17
  • 26
  • Could i used this in java or is it better to write a script in c++? – Sceik Jan 22 '14 at 20:19
  • You should be able to call native APIs with JNA/JNI, but you could also use a script. The better one depends on what you are truly trying to accomplish here. – Preston Jan 22 '14 at 20:36