小编chr*_*ris的帖子

Mac 上的 USB 串行端口使用 socat

我有一个通过 Prolific Serial 转 USB 电缆连接的硬件,我需要使用 socat 向该端口和 TCP 端口发送/接收流量。到目前为止,它已经安装完毕并且可以与 minicom 一起正常工作,使用:

minicom -D /dev/tty.usbserial -b 9600

Socat 使用以下方式在一个方向上工作到 TCP 端口:

socat /dev/tty.usbserial,clocal=1,nonblock=1,cread=1,cs8,ixon=1,ixoff=1 TCP4:localhost:8080

我如何让它以两种方式工作?我经常看到重复的字符或双线,这表明串行设置不正确,对吗?

谢谢!克里斯

编辑:一些示例代码(实际上并不以双向方式工作)。

Chris-MacBookAir:~ chrisbridges$ socat -d -d - /dev/tty.usbserial,clocal=1,nonblock=1,cs8,ixon=1,ixoff=1,ispeed=9600,ospeed=9600,icanon=1
2013/01/09 13:13:34 socat[8501] N reading from and writing to stdio
2013/01/09 13:13:34 socat[8501] N opening character device "/dev/tty.usbserial" for reading and writing
2013/01/09 13:13:34 socat[8501] N starting data transfer loop with FDs [0,1] and [3,3]
Run Code Online (Sandbox Code Playgroud)

macos usb serial-port tty socat

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

macos ×1

serial-port ×1

socat ×1

tty ×1

usb ×1