Erlang串口IO [英] Erlang serial IO

查看:33
本文介绍了Erlang串口IO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 erlang 与我的调制解调器通话.它安装为/dev/ttyUSB 并且完全理解 AT 命令.

I want to talk to my modem with erlang. It is mounted as /dev/ttyUSB and perfectly understands AT-commands.

  • 我可以使用标准文件模块从设备读取和写入吗?

  • Can I read and write from the device with the standard file module?

波特率、字节大小、奇偶校验、RTS/CTS、DSR/DTR 等怎么样?

How about baudrate, bytesize, parity, RTS/CTS, DSR/DTR and the like?

您有使用 tonyg-erlang-serial-1.0 的经验吗?(我不太相信这个包,因为它在自述文件中说:这是一个带有用于串行通信的 erlang 驱动程序的端口程序,最初由 Johan Bevemyr 于 1996 年撰写,偶尔出现由 Tony Garnock-Jones 从 2007 年开始维护."

Have you any experiences with tonyg-erlang-serial-1.0? (I am not too convinced of this package as it says in the readme: "This is a port program with erlang driver for serial communication, originally written by Johan Bevemyr in 1996 and sporadically maintained by Tony Garnock-Jones from 2007 onwards."

erlang 中串行 I/O 的常见做法是什么?

What is the common practice for serial I/O in erlang?

推荐答案

所以显然 erlang 没有串行通信库.我现在不得不再次挖掘 python,使用 pyserial,从 erlang 生成 python 线程并通过 stdin 进行通信.

So there is apparently no serial communication library for erlang. I now had to dig up python again, use pyserial, spawn the python threads from erlang and communicate via stdin.

如果有人知道得更好,请证明我错了.我很想拥有 erlang 原生串行 I/O.

If anyone knows better, please proof me wrong. I would love to have erlang native serial I/O.

这篇关于Erlang串口IO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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