简体   繁体   English

如何在 Java 中为 USB 端口生成特定的 ID?

[英]How to generate specific IDs for USB ports in Java?

I am developing an application using Java.我正在使用 Java 开发应用程序。 I am connecting 10 USB devices through external USB ports.我正在通过外部 USB 端口连接 10 个 USB 设备。 I want a specific ID when I connect a device with a specific port.当我连接具有特定端口的设备时,我需要一个特定的 ID。 So, for example, if I connect a device on 10th port, I should get a specific ID for that port;因此,例如,如果我在第 10 个端口上连接一个设备,我应该获得该端口的特定 ID; which will help me in showing that device in 10th position only.这将帮助我仅在第 10 位显示该设备。 I tried Jusb and other similar third party APIs but they didn't work out.我尝试了 Jusb 和其他类似的第三方 API,但没有成功。 Please suggest some techniques to accomplish this.请提出一些技术来实现这一点。

你试过 JSR-80 API (javax.usb) 作为解释在这里http://www.ibm.com/developerworks/library/j-usb/index.html

Based on your comment on the previous answer you can download that jar from here. 根据您对先前答案的评论,您可以从此处下载该jar Then try following the steps given in this link 然后尝试按照此链接中给出的步骤进行操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM