3 if {[llength $argv] != 1} { error "need serial port arg" }
5 set port [lindex $argv 0]
7 set port_stty [exec stty -F $port -g]
8 set term_stty [exec stty -g]
11 exec stty min 0 time 0 -istrip -ocrnl -onlcr -onocr -opost \
12 -ctlecho -echo -echoe -echok -echonl -iexten -isig
13 exec stty -F $port min 0 time 0 -istrip -ocrnl -onlcr -onocr -opost \
14 -ctlecho -echo -echoe -echok -echonl -iexten -isig \
15 9600 clocal cread -crtscts -hup -parenb cs8 -cstopb \
16 -ixoff bs0 cr0 ff0 nl0 -ofill -olcuc -onlcr
17 set p [open $port {RDWR|NONBLOCK} 0]
18 fconfigure $p -blocking false -buffering none
19 fconfigure stdin -blocking false -buffering none
20 fconfigure stdin -blocking false -buffering none
23 fconfigure stdin -blocking true
25 exec stty -F $port $port_stty