com端口上的设备信息c#
我遇到了这样的问题:在三个 com 端口中都有我在软件中使用的设备。没有安装驱动程序。问题是:如何找出哪个端口与哪个设备连接?提前致谢
I had such a problem: in the three com ports have devices with which I work in software. Not installed drivers. The problem is: How can I find out which of the ports is connected with which of device? Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能无法识别 COM 端口中的设备。设备名称没有行业标准或要求。某些协议(例如 SCSI、ATAPI 和 USB)具有可用于识别设备的命令。对于标准RS232,没有这样的要求。
您必须识别哪些类型的设备?绘图仪、拇指驱动器、磁带驱动器等?
You may not be able to identify the devices in the COM ports. There is no industry standard nor requirement for device names. Some protocols such as SCSI, ATAPI and USB have commands that you can use to identify the device. For standard RS232, there is no such requirement.
What kind of devices do you have to identify? Plotters, thumbdrives, tape drives, etc?
没有可靠的方法可以做到这一点。您可以轮询 COM 端口,但许多设备甚至不响应它们收到的命令。 COM 端口只能连接 Tx 和 Gnd,因此连接的设备甚至可能无法响应。在处理 RS232 时,您几乎不需要做任何工作。
There is no reliable way to do this. You can poll the COM ports, but many devices don't even respond to commands they receive. A COM port could only have Tx and Gnd wired up, so the connected device might not even be able to respond. You have very little to work with when dealing with RS232.