Changeset 87 for sans/utils/bt5/tilt
- Timestamp:
- Apr 16, 2007 7:41:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/utils/bt5/tilt/tilt
r86 r87 1 1 #!/usr/bin/expectk 2 2 3 ################################## 4 ## Talk to tilt controller on bt5 5 ## 6 ## Andrew Jackson, April 2007 7 ################################## 3 8 4 #Start up ICP 5 #log user 0 6 eval spawn -noecho "/usr/local/icp/bin/icp" 7 set icpid $spawn_id 9 proc exec_cmd {cmd_text} { 10 11 .mf.output insert end "$cmd_text\n" 12 exp_send "$cmd_text\r" 13 14 } 8 15 9 16 17 set port /dev/ttyS0 18 set serialid [spawn -noecho -open [open $port w+]] 19 set baud 19200 20 #stty ispeed $baud ospeed $baud -raw cs8 -parenb -cstopb < $port 21 stty -F $port ispeed $baud ospeed $baud raw icrnl 22 23 24 frame .mf 25 text .mf.output 26 entry .mf.cmdentry 27 button .mf.ver_but -text "Execute Command" -command { exec_cmd [.mf.cmdentry get] } 28 button .mf.init -text "Init" -command {exp_send "\r"} 29 pack .mf.output -fill both -anchor nw -expand true 30 pack .mf.cmdentry -side left 31 pack .mf.ver_but .mf.init -side left 32 pack .mf 33 34 #expect ">" 35 #exp_send "VER\r" 36 #expect ">" {.mf.output insert end $expect_out(buffer)} 37 38 expect_background { 39 -re ">" { 40 .mf.output insert end $expect_out(buffer) 41 } 42 -re "\\?" { 43 .mf.output insert end $expect_out(buffer) 44 } 45 } 46 47 exp_send "\r"
Note: See TracChangeset
for help on using the changeset viewer.