diff --git a/examples/lua/pts.lua b/examples/lua/pts.lua new file mode 100644 index 0000000..446fd12 --- /dev/null +++ b/examples/lua/pts.lua @@ -0,0 +1,13 @@ +send("\n") +msleep(100) +read_ts(650, 60) -- main menu +send("S") -- S menu +msleep(30) +read_ts(650, 60) +send("t") -- Parallel Value Table +read_ts(650, 60) +while true do + msleep(970) + send("t") + read_ts(650, 50) -- repeat PVT forever +end diff --git a/man/tio.1.txt b/man/tio.1.txt index 7c872f5..69a30b5 100644 --- a/man/tio.1.txt +++ b/man/tio.1.txt @@ -375,6 +375,13 @@ SCRIPT API On success, returns read string as second return value. + read_ts(size, timeout) + Read from serial device. If timeout is 0 or not provided it will wait forever until data is ready to read. + + Returns number of bytes read on success, 0 on timeout, or -1 on error. + + On success, returns read string as second return value. Additionally, emit timestamp to stdout and log file per options.timestamp and options.log. + set{line=state, ...} Set state of one or multiple tty modem lines.