From: ian Date: Thu, 8 Dec 2005 13:43:58 +0000 (+0000) Subject: hexbin-term wip X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=5e5e266be30ec4d7ee617638cf8253a160fd15b3;p=trains.git hexbin-term wip --- diff --git a/iwjpictest/hexterm b/iwjpictest/hexterm new file mode 100755 index 0000000..848312e --- /dev/null +++ b/iwjpictest/hexterm @@ -0,0 +1,25 @@ +#!/usr/bin/tclsh8.4 + +if {[llength $argv] != 1} { error "need serial port arg" } + +set port [lindex $argv 0] + +set port_stty [exec stty -F $port -g] +set term_stty [exec stty -g] + +set e [catch { + exec stty min 0 time 0 -istrip -ocrnl -onlcr -onocr -opost \ + -ctlecho -echo -echoe -echok -echonl -iexten -isig + exec stty -F $port min 0 time 0 -istrip -ocrnl -onlcr -onocr -opost \ + -ctlecho -echo -echoe -echok -echonl -iexten -isig \ + 9600 clocal cread -crtscts -hup -parenb cs8 -cstopb \ + -ixoff bs0 cr0 ff0 nl0 -ofill -olcuc -onlcr + set p [open $port {RDWR|NONBLOCK} 0] + fconfigure $p -blocking false -buffering none + fconfigure stdin -blocking false -buffering none + fconfigure stdin -blocking false -buffering none +}] + +fconfigure stdin -blocking true +exec stty $term_stty +exec stty -F $port $port_stty