简体   繁体   English

如何通过USB识别连接的设备

[英]How to identify the attached devices through USB

在此处输入图片说明 I am developing USB to serial app, where mobile will attached with USB hub, and this hub is connected with with other devices through CP2102 cable. 我正在开发USB到串行应用程序,其中移动设备将连接USB集线器,并且该集线器通过CP2102电缆与其他设备连接。 I am able to identify all devices and can read and write also. 我能够识别所有设备,并且还可以读写。 But the problem is all have same Vendor and product ID and other information also. 但是问题是所有的供应商和产品ID以及其他信息也都相同。 And USB port number is also changing if we disconnect and connect. 如果我们断开连接,USB端口号也会改变。 So is there any way to identify the attached devices. 因此,有什么方法可以识别连接的设备。 Let me know if any other information required here. 让我知道这里是否需要其他信息。 I am using this example for development. 我正在使用此示例进行开发。

http://code.google.com/p/usb-serial-for-android/ http://code.google.com/p/usb-serial-for-android/

Take a look at AN721 , there is a tool that goes with this document that Silicon Labs provides to so you can customize your device's VID and PID, serial number and device strings. 看一下AN721 ,Silicon Labs提供了一个随此文档一起提供的工具,您可以自定义设备的VID和PID,序列号和设备字符串。 Serial number might be the easiest way to make your development devices unique, if you change the VID/PID then you'll need to create a custom driver with those new settings to get your device back. 序列号可能是使开发设备唯一的最简单方法,如果更改了VID / PID,则需要使用这些新设置创建自定义驱动程序以恢复设备。

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

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