我目前正在尝试访问连接到应用程序的串行端口的两个方向上的数据。
我想做的是:
ttymxc0 socat sniff ttyV0 应用程序
ttymxc0 是真实端口,ttyV0 是虚拟端口。
我发现 socat 命令适用于 Ubuntu 16.04:http://www.iheartrobotics.com/2010/02/debugginng-serial-interfaces.html http://www.iheartrobotics.com/2010/02/debugginng-serial-interfaces.html
但是当我使用 buildroot 在嵌入式系统上使用它时,我收到此错误:
socat -d /dev/ttymxc0,raw,echo=0 SYSTEM:'tee input.txt | socat - "PTY,link=/tmp/ttyV0,raw,echo=0,waitslave" | tee output.txt'
socat[3167.1996369920] E address "GOPEN..." in intermediate context, leftdirs=4, rightdirs=7, with 1 parameter(s) is not available
socat[3167.1996369920] W cannot restore terminal settings on fd 3: Bad file descriptor
我尝试查看文件的访问属性,但没有成功。当您不要求打印输入和输出时它可以工作,但这对我的使用没有用
在这种情况下,buildroot 和 Ubuntu 之间有什么不同吗?