lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I have tried to communicate to modem with the IO library but without success, maybe something is wrong, it would be possible with some code like this I attach?
I prefer this first method but if itsn't possible how I should use the luaX?
---------
local file="/dev/ttyS1"
local r

local function write_read(fd,cmd)
   fd:write(cmd)
   fd:flush()
   print("write: ",cmd)
   r = fd:read()  --read default mode
   print("read: ",r)
end

local fd=assert(io.open(file,"rw"))

fd:flush()
fd:setvbuf("no")

write_read(fd,"at\r")

fd:close()
---------

----- Mensaje original ----
De: Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
Para: Lua list <lua@bazar2.conectiva.com.br>
Enviado: miércoles, 24 de octubre, 2007 16:59:35
Asunto: Re: How to use serial port to communications

> or is it necesary some kind of extension or addon?

An external library is needed. LuaX, by Asko Kauppi, had one I think.




Sé un Mejor Amante del Cine
¿Quieres saber cómo? ¡Deja que otras personas te ayuden! .