简体   繁体   English

获取产品ID和供应商ID

[英]Get product ID and Vendor ID

大家好,有一种方法可以使用Java或C#获取供应商ID,而产品是USB设备的

Did you take a look at jUSB ? 您看过jUSB吗? Granted, it is quite old and not updated, but it seems usb.core API is working for both Linux and Windows. 当然,它很旧并且没有更新,但是usb.core API似乎可以在Linux和Windows上运行。

It's worth taking note I think, how conveniently the DeviceDesriptor class, residing in just the mentioned usb.core package provides getVendorId() and getDeviceId() methods. 值得一提的是,我认为,仅位于提到的usb.core包中的DeviceDesriptor类提供了getVendorId()和getDeviceId()方法有多方便。

USB device are identified by their vendor id and product id . USB设备由其供应商ID产品ID标识 Those IDs are consisting of a prefix ( vid_ for vendor id or pid_ for product id) and a 4 digit HEX number. 这些ID被由前缀(的vid_为厂商ID或pid_产品ID)和4位十六进制数。 The MAX3420E for example has the vendor id vid_06ba and the product id pid_5346 . 例如, MAX3420E的供应商ID为vid_06ba ,产品ID为pid_5346

for C# see these useful articles: 对于C#请参阅以下有用的文章:

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

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