30 |
set result -1 |
set result -1 |
31 |
|
|
32 |
if [board_info $hostname exists name] { |
if [board_info $hostname exists name] { |
33 |
set hostname [board_info ${hostname} name]; |
set hostname [board_info ${hostname} name] |
34 |
} |
} |
35 |
set port [board_info ${hostname} tipname] |
set port [board_info ${hostname} tipname] |
36 |
if [board_info ${hostname} exists shell_prompt] { |
if [board_info ${hostname} exists shell_prompt] { |
40 |
} |
} |
41 |
|
|
42 |
if [board_info ${hostname} exists fileid] { |
if [board_info ${hostname} exists fileid] { |
43 |
unset board_info(${hostname},fileid); |
unset board_info(${hostname},fileid) |
44 |
} |
} |
45 |
spawn tip -v $port |
spawn tip -v $port |
46 |
if { $spawn_id < 0 } { |
if { $spawn_id < 0 } { |
130 |
global expect_out |
global expect_out |
131 |
|
|
132 |
if [board_info $dest exists shell_prompt] { |
if [board_info $dest exists shell_prompt] { |
133 |
set shell_prompt [board_info $dest shell_prompt]; |
set shell_prompt [board_info $dest shell_prompt] |
134 |
} else { |
} else { |
135 |
set shell_prompt ".*>" |
set shell_prompt ".*>" |
136 |
} |
} |
138 |
set result "" |
set result "" |
139 |
if ![board_info $dest exists fileid] { |
if ![board_info $dest exists fileid] { |
140 |
perror "tip_download: no connection to $dest." |
perror "tip_download: no connection to $dest." |
141 |
return $result; |
return $result |
142 |
} |
} |
143 |
set shell_id [board_info $dest fileid]; |
set shell_id [board_info $dest fileid] |
144 |
|
|
145 |
if ![file exists $file] { |
if ![file exists $file] { |
146 |
perror "$file doesn't exist." |
perror "$file doesn't exist." |
159 |
} |
} |
160 |
-i $shell_id -re ".*lines transferred in.*minute.*seconds.*$shell_prompt.*$" { |
-i $shell_id -re ".*lines transferred in.*minute.*seconds.*$shell_prompt.*$" { |
161 |
verbose "Download $file successfully" 1 |
verbose "Download $file successfully" 1 |
162 |
set result $file; |
set result $file |
163 |
} |
} |
164 |
-i $shell_id -re ".*Invalid command.*$shell_prompt$" { |
-i $shell_id -re ".*Invalid command.*$shell_prompt$" { |
165 |
warning "Got an invalid command to the remote shell." |
warning "Got an invalid command to the remote shell." |