mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Simplify lua line manipulation API
Collapses lua high(), low(), toggle(), config_high(), config_low(),
config_apply() into one simple function:
set{<line>=<state>, ...}
Line can be any of DTR, RTS, CTS, DSR, CD, RI.
State is high, low, or toggle.
Example:
script = set{DTR=high, RTS=low}; msleep(100); set{DTR=low, RTS=high}; msleep(100); set{RTS=low}
Notice the use of {} instad of () when calling the set function. This is
required to pass parameters by name in lua.
This commit is contained in:
parent
eef0a15194
commit
6d77201ba0
6 changed files with 112 additions and 211 deletions
|
|
@ -1,7 +1,5 @@
|
|||
high(DTR)
|
||||
low(RTS)
|
||||
set{DTR=high, RTS=low}
|
||||
msleep(100)
|
||||
low(DTR)
|
||||
high(RTS)
|
||||
set{DTR=low, RTS=high}
|
||||
msleep(100)
|
||||
low(RTS)
|
||||
set{RTS=toggle}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue