156 |
print $m if ($once->{$m} == 1); |
print $m if ($once->{$m} == 1); |
157 |
} |
} |
158 |
|
|
159 |
|
my $status = ''; |
160 |
|
|
161 |
|
sub status { |
162 |
|
my $m = join('', @_); |
163 |
|
if ($m ne $status) { |
164 |
|
print $m; |
165 |
|
$status = $m; |
166 |
|
} |
167 |
|
} |
168 |
|
|
169 |
local $SIG{ALRM} = sub { |
local $SIG{ALRM} = sub { |
170 |
mdap_send("ANT-SEARCH MDAP/1.1\r\n"); |
mdap_send("ANT-SEARCH MDAP/1.1\r\n"); |
171 |
alarm( $resend_search_delay ); |
alarm( $resend_search_delay ); |
234 |
"\n"; |
"\n"; |
235 |
$ant_flashing->{$ant} = 0; |
$ant_flashing->{$ant} = 0; |
236 |
my $waiting = 0; |
my $waiting = 0; |
237 |
|
my $count = 0; |
238 |
map { |
map { |
239 |
$waiting++ if ($ant_flashing->{$_}); |
$waiting++ if ($ant_flashing->{$_}); |
240 |
|
$count++; |
241 |
} keys %$ant_flashing; |
} keys %$ant_flashing; |
242 |
print "**** ALL ANTS FLASHED ****\n" if ($ant_flashing && $waiting == 0); |
if ($waiting == 0) { |
243 |
|
status "ALL $count ANTS FLASHED to $build\n"; |
244 |
|
$ant_flashing = undef; |
245 |
|
} else { |
246 |
|
status "$waiting of $count ants still flasing upto $build\n"; |
247 |
|
} |
248 |
} |
} |
249 |
} else { |
} else { |
250 |
once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update\n"; |
once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update\n"; |
251 |
} |
} |
252 |
} elsif ( $type eq 'REPLY-EXEC-CLI' && $h->{'SEQ-NR'} == 1 ) { |
} elsif ( $type eq 'REPLY-EXEC-CLI' && $h->{'SEQ-NR'} == 1 ) { |
253 |
print "+ $ant bootp mode re-flash started\n"; |
print "+ $ant bootp mode re-flash started\n" if ($verbose); |
254 |
mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nSEQ-NR:2\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); |
mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nSEQ-NR:2\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); |
255 |
forget_ant( $ant ); |
forget_ant( $ant ); |
256 |
$ant_flashing->{$ant}++; |
$ant_flashing->{$ant}++; |