[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: termios-lua, a binding to the POSIX APIs for terminal and serial devices
- From: Sam Roberts <vieuxtech@...>
- Date: Mon, 24 Oct 2011 15:33:45 -0700
termios are the POSIX APIs for manipulating terminal devices, such as
serial devices:
https://github.com/sam-github/termios-lua
It doesn't support all the bazillions of bits that can be twiddled
(feel free to submit patches), but it supports what we've needed to
use serial devices on linux.
I haven't seen an implementation of these, and they aren't in
luaposix, though I'd be happy to see them merged:
http://lua-users.org/lists/lua-l/2011-09/msg00690.html
In the past, I've used them with the lua io library moderately
successfully, but the stdio library's buffering needs to be disabled
when the underlying device is not a file, and the io library doesn't
support timeouts and non-blocking read/write.
It turns out that serial devices are much more like stream sockets
than the file objects offered by the io library.
So, more recently, we've added serial support to luasocket and used
termios with that:
https://github.com/sam-github/luasocket/tree/add-serial-support
https://github.com/sam-github/luasocket
Enjoy,
Sam