linux 虚拟串口 socat,ubuntu linux上的虚拟socat串口和c#
发布日期:2021-06-24 16:43:51 浏览次数:2 分类:技术文章

本文共 502 字,大约阅读时间需要 1 分钟。

出于测试目的,我正在尝试编写一个连接到使用socat创建的虚拟串行端口的简单程序.

我用这个命令创建了串口:

socat -d -d PTY,b9600 PTY,link=ttyVS1,b9600

得到这个输出:

2011/11/08 18:26:31 socat[32708] N PTY is /dev/pts/1

2011/11/08 18:26:31 socat[32708] N PTY is /dev/pts/2

2011/11/08 18:26:31 socat[32708] N starting data transfer loop with FDs [3,3] and [5,5]

当我尝试以这种方式连接时:

System.IO.Ports.SerialPort _port;

_port = new SerialPort("/dev/pts/1", 9600);

_port.Open();

我得到一个“文件名未知”的System.IO.IOException.

我错过了设置DataBits,StopBits或其他参数?我怎样才能发现socat建立的房产?或者这段代码有什么问题?

转载地址:https://blog.csdn.net/weixin_33917663/article/details/116823484 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:linux下堆栈溢出实例,堆栈溢出在Linux上沉默?
下一篇:开发笔记本linux驱动程序,笔记本自带读卡器linux驱动

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年04月22日 09时38分27秒