mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Lua API moved into a tio library table and names adjusted to Lua stdlib style. Regex in expect() replaced with Lua patterns so binary data can be handled. New tio.alwaysecho variable allows enabling and disabling echo to console. Read and write functions now manage complex retry and timeout logic internally, giving the user a simple "nil if fail" API like the rest of Lua. exit() was removed, os.exit() already exists in the Lua standard library.
13 lines
428 B
Lua
13 lines
428 B
Lua
io.write("Searching... ")
|
|
|
|
local device = tio.ttysearch()
|
|
|
|
io.write("done\r\n")
|
|
|
|
for i in ipairs(device) do
|
|
io.write("\r\n" .. device[i]["path"] .. "\r\n")
|
|
io.write(" tid = " .. device[i]["tid"] .. "\r\n")
|
|
io.write(" uptime = " .. device[i]["uptime"] .. "\r\n")
|
|
io.write(" driver = " .. device[i]["driver"] .. "\r\n")
|
|
io.write(" description = " .. device[i]["description"] .. "\r\n")
|
|
end
|