4 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
5 |
# the Free Software Foundation; either version 2 of the License, or |
# the Free Software Foundation; either version 2 of the License, or |
6 |
# (at your option) any later version. |
# (at your option) any later version. |
7 |
# |
# |
8 |
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 |
# GNU General Public License for more details. |
# GNU General Public License for more details. |
12 |
# |
# |
13 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
14 |
# along with this program; if not, write to the Free Software |
# along with this program; if not, write to the Free Software |
15 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 |
|
|
17 |
# Please email any bugs, comments, and/or additions to this file to: |
# Please email any bugs, comments, and/or additions to this file to: |
18 |
# bug-dejagnu@gnu.org |
# bug-dejagnu@gnu.org |
19 |
|
|
20 |
# |
# |
21 |
# Connect to DEST using kermit. Note that we're just using kermit as a |
# Connect to DEST using kermit. Note that we're just using kermit as a |
22 |
# simple serial or network connect program; we don't actually use Kermit |
# simple serial or network connect program; we don't actually use Kermit |
23 |
# protocol to do downloads. |
# protocol to do downloads. |
24 |
# returns -1 if it failed, otherwise it returns |
# returns -1 if it failed, otherwise it returns |
41 |
set port [board_info ${dest} netport] |
set port [board_info ${dest} netport] |
42 |
set device "-j [board_info ${dest} netport]" |
set device "-j [board_info ${dest} netport]" |
43 |
} |
} |
44 |
|
|
45 |
set tries 0 |
set tries 0 |
46 |
set result -1 |
set result -1 |
47 |
verbose "kermit $device" |
verbose "kermit $device" |
52 |
} |
} |
53 |
|
|
54 |
expect { |
expect { |
55 |
-re ".*ermit.*>.*$" { |
-re ".*ermit.*>.*$" { |
56 |
send "c\n" |
send "c\n" |
57 |
expect { |
expect { |
58 |
-re "Connecting to.*$port.*Type the escape character followed by C to.*options.*\[\r\n\]$" { |
-re "Connecting to.*$port.*Type the escape character followed by C to.*options.*\[\r\n\]$" { |
78 |
exp_continue |
exp_continue |
79 |
} |
} |
80 |
} |
} |
81 |
timeout { |
timeout { |
82 |
warning "Timed out trying to connect." |
warning "Timed out trying to connect." |
83 |
set result -1 |
set result -1 |
84 |
incr tries |
incr tries |