获取连接到串行端口的设备名称 [英] Get the device name connected to the serial port

查看:239
本文介绍了获取连接到串行端口的设备名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索如何获得连接串口材料的设备名称。



我有两种不同类型的材料,可以在其连接。<打印机(只接收数据并发送任何回报)
第二个:一个平衡点(仅发送数据和接收无)

$ / p>

b
$ b

我怎样才能区分这两种类型的材料?



感谢。


解决方案

有是识别串口(UART RS232)设备没有万能的方法。



除非设备有特殊命令你可以发送到设备,并将它与识别信息作出回应没有什么可以做。



这依赖于串行端口上典型的应用将有一个标准的设定画面,用户将使用配置串行端口的设备连接,对于像端口配置波特率,奇偶校验位,停止位和数据位。如果多发设备可以在同一端口上进行切换,操作者就会负责与设备通信之前选择目标设备的正确配置。



这是优势,如USB等较新的技术,其中设备标识是内置标准的。


I search how to get the device name of the material connected to the serial port.

I've two different types of material that can connect on it.

First one : a printer (only receives data and send nothing back) Second one : a balance (only send data and receives nothing)

How can I distinguish this two types of material?

Thanks.

解决方案

There is no univeral way of identifying serial port (UART RS232) devices.

Unless the devices have special commands that you can send to the device and have it respond with identifying information there is not much you can do.

Typically application that rely on the serial port will have a standard setting screen that the user would use to configure the serial port the device is connected to, port configuration for things like baud rate, parity bits, stop bits and data bits. If mutiple devices can be switched on the same port, the operator would then be responsible for selecting the correct configuration for the target device before communicating with the device.

This is the advantage of newer technologies like USB etc. where device identification is built into the standard.

这篇关于获取连接到串行端口的设备名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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