mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Add tty line configuration script API
On some platforms calling high()/low() to switch line states result in costly system calls whick makes it impossible to swith two or more tty lines simultaneously. To help solve this timing issue we introduce a tty line state configuration API which can be used instead of using high()/low(). Using config_low(line) and config_high(line) one can set up a new line state configuration for multiple lines and then use config_apply() to finally apply the configuration. This will result in only one system call to instruct the serial port drive to switch all the configured line states which should help ensure that the lines are switched simultaneously. Example: script = config_high(DTR); config_low(RTS); config_apply()
This commit is contained in:
parent
4369d5b66f
commit
3e50191107
4 changed files with 167 additions and 77 deletions
|
|
@ -383,6 +383,14 @@ Toggle the tty line.
|
|||
Sleep for seconds.
|
||||
.IP "\fBmsleep(ms)"
|
||||
Sleep for miliseconds.
|
||||
.IP "\fBconfig_high(line)"
|
||||
Set tty line state configuration to high.
|
||||
.IP "\fBconfig_low(line)"
|
||||
Set tty line state configuration to low.
|
||||
.IP "\fBapply_config()"
|
||||
Apply tty line state configuration. Using the line state configuration API
|
||||
instead of high()/low() will help to make the lines physically switch as
|
||||
simultaneously as possible. This may solve timing issues on some platforms.
|
||||
|
||||
.TP 0n
|
||||
Note: Line can be any of DTR, RTS, CTS, DSR, CD, RI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue