Telnet and Control Break Key
Dar Scott
dsc at swcp.com
Wed Sep 4 10:34:01 EDT 2002
On Tuesday, September 3, 2002, at 07:54 PM, Luis Camou wrote:
> I was looking at Cisco's site
> http://www.Cisco.com/warp/public/701/61.html
What they require is what I was afraid of.
Are you wanting to do this in Revolution because you want to
automate part of this or make part of the whole process easier? If
you are simply needing a terminal, would Hyperterminal do? They
list Hyperterminal as being able to send the break.
> In their table at the end it seems that I can accomplish this by
> capturing
> the Ctrl-Break key and sending it through the serial port .
The problem is that these do not correspond to a character. Each
one causes some routine to do something special to wiggle that line
as needed. How that is done may be different on each application.
> They also
> describe how to do it with a lower speed and a spacekey combination to
> accomplish the same. The problem with this speed - spacekey
> combination is
> that it is unreliable ... sometimes works and some times it doesn't .
I looked at this on the page you mentioned. I don't know why they
have you hold down the space bar; that would only send multiples.
The ASCII code for space is 20 hex, 00100000 binary. Since this is
sent at quarter speed (1200 bps), the lower five zeros (in binary)
will look like a break at 9600 bps. You need at least 10 unit
times to make a break and this will generate 24 including the start
bit. However, the upper 2 bits will look like 80 hex; it generates
2*4 zeros at 9600, but one is needed for the start. So holding
down the space bar will send sets of break plus some non ascii
character. The weird extra character may be related to the
reliability problem.
That might work better if you use their procedure but type
control-@, that is, ctrl-shift-2, on a terminal program. Or write
a null, numToChar(0), to the port in your own program. This will
generate a single 36 unit break. You might want to check and see
if this is more reliable.
The reliability problem might be related to changes in the
handshake lines when you close the port and reopen at the higher
bit rate. You might want to look at what they say about cables. I
have a feeling that they ignore them, though.
If you want to automatically handle password recovery, you might
need something like this in your scripts:
open port at 9600 bps
read repeatedly waiting for boot message
wait some time until you are sure the router will see the break
close port
open port at 1200 bps
repeat for number of breaks required by router
send numToChar(0)
wait 10 ms
close port
open port at 9600
recover password
close port
Or maybe there is some better method in Revolution that I don't
know. Maybe someone will pipe up and tell us.
Dar Scott
More information about the use-livecode
mailing list