获取串口连接的设备名称

Get the device name connected to the serial port(获取串口连接的设备名称)
本文介绍了获取串口连接的设备名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索如何获取串口连接的素材的设备名称.

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)

如何区分这两种材料?

谢谢.

推荐答案

没有通用的识别串口(UART RS232)设备的方法.

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.

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

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

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)