mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Clean up lua API
Rename modem_send() to send() Rename send to write()
This commit is contained in:
parent
4511d74a9e
commit
c49faa7337
6 changed files with 55 additions and 44 deletions
43
man/tio.1.in
43
man/tio.1.in
|
|
@ -428,7 +428,8 @@ Send ctrl-t character
|
|||
.PP
|
||||
Tio suppots Lua scripting to easily automate interaction with the tty device.
|
||||
|
||||
In addition to the Lua API tio makes the following functions available:
|
||||
In addition to the standard Lua API tio makes the following functions
|
||||
available:
|
||||
|
||||
.TP 6n
|
||||
|
||||
|
|
@ -441,26 +442,6 @@ Returns 1 on successful match, 0 on timeout, or -1 on error.
|
|||
|
||||
On successful match it also returns the match string as second return value.
|
||||
|
||||
.IP "\fBsend(string)"
|
||||
Send string.
|
||||
|
||||
Returns number of bytes written on success or -1 on error.
|
||||
|
||||
.IP "\fBmodem_send(file, protocol)"
|
||||
Send file using x/y-modem protocol.
|
||||
|
||||
Protocol can be any of XMODEM_1K, XMODEM_CRC, YMODEM.
|
||||
|
||||
.IP "\fBtty_search()"
|
||||
Search for serial devices.
|
||||
|
||||
Returns a table of number indexed tables, one for each serial device found.
|
||||
Each of these tables contains the serial device information accessible via the
|
||||
following string indexed elements "path", "tid", "uptime", "driver",
|
||||
"description".
|
||||
|
||||
Returns nil if no serial devices are found.
|
||||
|
||||
.IP "\fBread(size, timeout)"
|
||||
Read from serial device. If timeout is 0 or not provided it will wait forever
|
||||
until data is ready to read.
|
||||
|
|
@ -480,6 +461,26 @@ On success, returns the string that was read as second return value. Also
|
|||
emits a single timestamp to stdout and log file per options.timestamp
|
||||
and options.log.
|
||||
|
||||
.IP "\fBwrite(string)"
|
||||
Write string to serial device.
|
||||
|
||||
Returns number of bytes written on success or -1 on error.
|
||||
|
||||
.IP "\fBsend(file, protocol)"
|
||||
Send file using x/y-modem protocol.
|
||||
|
||||
Protocol can be any of XMODEM_1K, XMODEM_CRC, YMODEM.
|
||||
|
||||
.IP "\fBtty_search()"
|
||||
Search for serial devices.
|
||||
|
||||
Returns a table of number indexed tables, one for each serial device found.
|
||||
Each of these tables contains the serial device information accessible via the
|
||||
following string indexed elements "path", "tid", "uptime", "driver",
|
||||
"description".
|
||||
|
||||
Returns nil if no serial devices are found.
|
||||
|
||||
.IP "\fBset{line=state, ...}"
|
||||
Set state of one or multiple tty modem lines.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue