[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua, and accessing nodes in /dev/ (Lua in Linux)...
- From: David Given <dg@...>
- Date: Thu, 9 Feb 2006 00:29:20 +0000
On Wednesday 08 February 2006 23:25, Matthew Percival wrote:
[...]
> tty = io.open("/dev/ttyS0", "rw")
> tty:write("AT\n")
> if (tty:read("*line") ~= "OK") then
Firstly, have you set up the serial port correctly --- baud rate an such like?
(You can use the stty command to do this from the command line.) Secondly,
you'll need to ensure that all output gets flushed before you start reading.
Does calling tty:flush() after that write help?
--
+- David Given --McQ-+
| dg@cowlark.com | "Home is where, when you have to go there, they
| (dg@tao-group.com) | have to take you in." --- Cordelia Naismith
+- www.cowlark.com --+
Attachment:
pgpnPGvNfVe1o.pgp
Description: PGP signature