可以在物理USB端口,在Windows设备编程确定了吗? [英] Can the physical USB port be identified programatically for a device in Windows?

查看:280
本文介绍了可以在物理USB端口,在Windows设备编程确定了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有吩咐做,当使用不同的接口,VID,PID和序列号列举USB设备,我想保持物理设备的轨迹发生这种变化后。我的想法是由它的枢纽和端口位置跟踪它。

I have a USB device that enumerates with a different interface, VID, PID and serial number when commanded to do so, and I'd like to keep track of the physical device after this change occurs. My thought was to track it by its hub and port location.

借助 Win32_PnPSignedDriver 类有一个位置字段,似乎是完美的(如 Port_#0001.Hub_#0010 ),但它仅包含首次加载驱动程序时,该设备的位置。堵硬件到一个不同的端口不更新域。

The Win32_PnPSignedDriver class has a "Location" field that seemed perfect (e.g. Port_#0001.Hub_#0010), but it only contains the location of the device when the driver was first loaded. Plugging the hardware into a different port does not update that field.

然而,该信息可用的地方,因为通过设备管理器查看设备时,有详细​​信息选项卡下一个位置信息栏。这可以通过信息 WMI查询或一些其它的方法?是否有解决这个问题的一个更好的方法?

However, the information is available somewhere because there is a "Location information" field under the "Details" tab when viewing the device via the Device Manager. Can this information be retrieve through WMI queries or some other method? Is there a better approach to solving this problem?

编辑:我知道这听起​​来像一个奇怪的场景。这些装置中的微控制器含有枚举作为CDC设备(即串行口),并允许编程的ROM。在制造过程中,这将是有益的跟踪设备,因为它的制造商的ROM(独特VID / PID /序列号)和我的定制固件接口(不同VID / PID /序列号)之间的变化。

I know this sounds like a strange scenario. The microcontroller in these devices contains a ROM that enumerates as a CDC device (i.e. serial port) and allows programming. During manufacturing, it would be beneficial to track a device as it changes between the manufacturer's ROM (unique VID/PID/serial number) and my custom firmware interface (different VID/PID/serial number).

推荐答案

是最好的,我可以告诉大家,一个USB设备与物理端口关联是不可能在Windows中。请随时来证明我错了。

As best as I can tell, correlating a USB device with a physical port is not possible in Windows. Please feel free to prove me wrong.

这篇关于可以在物理USB端口,在Windows设备编程确定了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆