`lib/remote.exp' defines these functions, for establishing and managing communications:
Procedures to establish a connection: Each of these procedures
tries to establish the connection up to three times before returning.
Warnings (if retries will continue) or errors (if the attempt is
abandoned) report on communication failures. The result for any of
these procedures is either -1
, when the connection cannot be
established, or the spawn ID returned by the expect
command
spawn
.
It use the value of the connect
field in the target_info
array (was connectmode
as the type of connection to make. Current
supported connection types are tip, kermit, telnet, rsh, rlogin, and
netdata. If the --reboot
option was used on the runtest command
line, then the target is rebooted before the connection is made.
remote_open type
spawn_id
of the process that manages the
connection. This value can be used in expect
or exp_send
statements, or passed to other procedures that need the connection
process's id. This also sets the fileid
field in the
target_info
array.
remote_close shellid
remote_open
. This
closes the connection to the target so resources can be used by
others. This parameter can be left off if the fileid
field in the
target_info
array is set.
telnet hostname port
rlogin hostname
rsh hostname
netport
field in the target_info
array is used. (was $netport
) This value has two parts, the
hostname and the port number, seperated by a :. If host
or
target
is used in the hostname
field, than the config
array is used for all information.
tip port
tip
.
port must be a name from the tip
configuration file
`/etc/remote'. Often, this is called `hardwire', or something
like `ttya'. This file holds all the configuration data for
the serial port. The value of the serial
field in the
target_info
array is used. (was $serialport
) If
host
or target
is used in the port
field, than
the config array is used for all information.
kermit port bps
kermit
.
port is the device name, e.g. `/dev/ttyb'. bps is
the line speed to use (in bits per second) for the connection. The value
of the serial
field in the target_info
array is used. (was
$serialport
) If host
or target
is used in the
port
field, than the config array is used for all information.
Procedures to manage a connection:
tip_download spawnid file
~put
command under tip
. Most often used for single board computers
that require downloading programs in ASCII S-records. Returns
1
if an error occurs, 0
otherwise.
exit_remote_shell spawnid
download file [ spawnid ]
download
reads in file (object code in
S-record format) and writes it to the device controlling this
spawnid. (From the point of view of the target, the S-record file
comes in via standard input.)
If you have more than one target active, you can use the optional argument
spawnid to specify an alternative target (the default is the most
recently established spawnid.)
Go to the first, previous, next, last section, table of contents.