如何将COM端口号与USB通信设备相关联 [英] How to associated COM Port Number to USB Communication Device

查看:324
本文介绍了如何将COM端口号与USB通信设备相关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个嵌入式USB设备(即LPC15xx),带有描述符和支持代码(在端点),基于CDC /通信协议(工作正常)。



插入时,它枚举描述符并标识为USB标准中定义的通信设备或CDC。 Window OS实现了虚拟Com,如果生成了COM端口。在这种情况下,例如COM6。



我希望在COM6和USB设备之间建立包含(PID / VID /描述)的链接,到目前为止我在谷歌中看到的搜索,我只代码取出PID / VID /描述但没有与COM6的关联。



我在C#中使用.NET框架的Serial.Port在COM6下与USB设备通信。



如何在C#代码示例中链接它们?

I have an embedded USB device (ie LPC15xx) with Descriptor and supporting code (at the endpoints) that is based on CDC/Communication protocol (which is working fine).

When plugged, it enumerate the descriptor and identified as communication device or CDC as defined in USB standard. The Window OS implement Virtual Com which the COM Port if generated. In this case for example COM6.

I wish to establish link between COM6 and USB device that contain (PID/VID/Description), so far what I seen in google search, I only code that take out the PID/VID/Description but no association with COM6.

I'm using Serial.Port from .NET framework in C# to communicate with USB device under COM6.

How to link between them in C# code example?

推荐答案

我仍然不确定是什么问题是你正试图解决,但我记得我们曾经使用USB View来解决Windows XP上USB-RS232转换器的问题。

它显示了特定设备的端口的详细信息连接等等。



它似乎也适用于Windows 7,请参阅使用Microsoft USB View映射和排除USB端口故障 [ ^ ]



您还可以从MSDN获取此软件的源代码。但它是用C ++编写的,但也许你可以对缺失的链接有所了解。



不确定这是否是你想要的。
I am still not sure what the problems is you are trying to solve, but I remember that we used to use USB View to trouble shoot problems with USB-RS232 converters on Windows XP.
It shows detailed info about to which port a specific device is connected and much more.

It seems that it is available for Windows 7 too, see Map and troubleshoot your USB ports with Microsoft USB View[^]

You can also get the source code for this software from MSDN. It is in C++, though, but maybe you can some idea about the missing link.

Not sure if this is what you are looking for.

<

乔治......再次感谢你的回复,并对表达我的问题的困难道歉。



我希望给你发送图像,但不知道如何,



我发现了提供USB的LibUSBDotNet描述符和WMI细节暴露了COM号,窗口OS或LibUSBDotNet如何在它们之间建立链接,我不知道.....



序列号嵌入式设备可以通过描述符访问,该描述符在Win32_SerialPort,Win32_PnPEntity和Win32_USBHub下未在WMI中公开。但是MSDN网站确实在Win32_USBHub中提到了GetDescriptor,但不确定如何使用它。
George...thank again for the reply and apologise for difficulties in expressing my question.

I wish to send you image but not sure how,

I discovered the LibUSBDotNet which provide USB descriptor and WMI details where COM number is exposed, how the window OS or LibUSBDotNet link between them, I don't know.....

The serial number of the embedded device can be accessed via descriptor which is not exposed in WMI under Win32_SerialPort, Win32_PnPEntity and Win32_USBHub. However it MSDN website did mentioned GetDescriptor within Win32_USBHub but not sure how to use it.


这篇关于如何将COM端口号与USB通信设备相关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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