--- mdap-server.pl 2007/11/18 01:29:04 67 +++ mdap-server.pl 2007/11/18 10:27:37 69 @@ -101,6 +101,12 @@ return $hash; } +sub _dump_data { + my $data = shift; + $data =~ s/\s+/ /gs; + return substr($data,0,150); +} + sub mdap_send { my $data = shift; @@ -112,8 +118,7 @@ if ($debug) { warn ">> ${GROUP}:${PORT} >> ", dump( $data ), $/; } elsif( ! $quiet ) { - $data =~ s/\s+/ /gi; - warn ">> ", substr($data,0,70), $/; + warn ">> ",_dump_data($data),$/; } } @@ -194,7 +199,7 @@ my $client_version = $h->{'MDAP-VERSION'}; $mdap_ver = $client_version if ($client_version); - print "<< $type $proto/$mdap_ver << ", length($data), " bytes\n" unless $quiet; + print "<< $type $proto/$mdap_ver << ", length($data), " bytes: ",_dump_data($data),$/ unless $quiet; warn dump( $data, $h ),$/ if ($debug); @@ -231,12 +236,12 @@ my $build = $h->{'_BUILD'} || die "no _BUILD?"; my $new_build = fw_build( $board ); if ( $build ne $new_build ) { - print "+ $ant version $build -> $new_build\n"; + print "+ $ant $board version $build -> $new_build\n"; mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:software upgrade\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); $ant_flashing->{$ant}++; next; } else { - once "$ant OK version $build", + once "$ant $board OK version $build", $ant_unknown_password->{$ant} ? ' with unknown password' : $ant_passwd->{$ant} ? ' password protected' : ''; @@ -251,10 +256,10 @@ $count++; } keys %$ant_flashing; if ($waiting == 0) { - status "ALL $count ANTS FLASHED to $build\n"; + status "ALL $count ANTS FLASHED\n"; $ant_flashing = undef; } else { - status "$waiting of $count ants still flasing upto $build\n"; + status "$waiting of $count ants still flasing\n"; } } @@ -263,7 +268,7 @@ warn "## calling $plugin\n" if $debug; if ( my $command = $plugin->check( $h ) ) { - warn ">> $plugin $ant ", + warn ">> $plugin $ant $board ", $h->{'ANT-NAME'}, " ", $h->{'_BUILD'}, " ", "\t:$command\n";