I want to simulate hyperterminal by TCL/TK programming.And I connected com3 to Console of my router via console cable.But I met some problems.I used a package named tcl-dp. I used "dp_connect -device com3" command to open Serial3,and used fconfigure -charsize 8,-bits 1,-baudrate 9600,stop "none"" command to configure
the serial, and used "dp_send $com3 string" to send commands to the router, and used "dp_recv $com3" to receive the results which the router displayed.Here's source codes:
lappend auto_path .
package require dp 4.0
catch {console show}
##### main #######
puts "This is a test!"
set com3 [dp_connect serial -device serial3]
fconfigure $com3 -charsize 8 -stopbits 1 -baudrate 9600 -parity "none"
dp_send $com3 "show run"
after 500
puts [dp_recv $com3]
But I got wrong results. The router could execute commands correctly that I send to it but could not echo the results on my console. But when I opened hyperterminal and keystroked Enter, I found the results was displayed on the
console. I have struggled for it for 1 month, but gotten nothing. I have to ask for your help, because I think my boss is killing me if I have no answer in time. By the way, My platform is win95/NT.
the serial, and used "dp_send $com3 string" to send commands to the router, and used "dp_recv $com3" to receive the results which the router displayed.Here's source codes:
lappend auto_path .
package require dp 4.0
catch {console show}
##### main #######
puts "This is a test!"
set com3 [dp_connect serial -device serial3]
fconfigure $com3 -charsize 8 -stopbits 1 -baudrate 9600 -parity "none"
dp_send $com3 "show run"
after 500
puts [dp_recv $com3]
But I got wrong results. The router could execute commands correctly that I send to it but could not echo the results on my console. But when I opened hyperterminal and keystroked Enter, I found the results was displayed on the
console. I have struggled for it for 1 month, but gotten nothing. I have to ask for your help, because I think my boss is killing me if I have no answer in time. By the way, My platform is win95/NT.