Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested

This commit is contained in:
Mariano Alvira 2009-05-08 18:05:48 -04:00
commit 04286f8aa7

View file

@ -43,62 +43,65 @@ $ob->stopbits(1);
$ob->handshake("rts"); $ob->handshake("rts");
$ob->read_const_time(1000); # 1 second per unfulfilled "read" call $ob->read_const_time(1000); # 1 second per unfulfilled "read" call
<<<<<<< HEAD:mc1322x-load.pl
my $s = 0; my $s = 0;
SEND: while(1) {
do {
my $c; my $c; my $count; my $ret = ''; my $test='';
my $count;
my $ret = '';
if($s == 1) { print "performing secondary send\n"; } if($s == 1) { print "performing secondary send\n"; }
$ob->write(pack('C','0')); $ob->write(pack('C','0'));
my $ret = ''; if($s == 1) {
my $test; $test = 'ready';
} else {
$test = 'CONNECT';
}
if($s == 1) { until($ret eq $test) {
$test = 'ready'; ($count,$c) = $ob->read(1);
} else { if ($count == 0) {
$test = 'CONNECT'; print '.';
} $ob->write(pack('C','0'));
next;
until($ret eq $test) {
($count,$c) = $ob->read(1);
if ($count == 0) {
print '.';
$ob->write(pack('C','0'));
next;
}
$ret .= $c;
} }
$ret .= $c;
print $ret . "\n"; print $ret . "\n";
}
print $ret . "\n";
if (-e $filename) { if (-e $filename) {
my $size = -s $filename; my $size = -s $filename;
print ("Size: $size bytes\n"); print ("Size: $size bytes\n");
$ob->write(pack('V',$size)); $ob->write(pack('V',$size));
open(FILE, $filename) or die($!); open(FILE, $filename) or die($!);
print "Sending $filename\n"; print "Sending $filename\n";
my $i = 1; my $i = 1;
while(read(FILE, $c, 1)) { while(read(FILE, $c, 1)) {
print unpack('H',$c) . unpack('h',$c) if $verbose; $i++;
$i++; usleep(50); # this is as fast is it can go...
usleep(50); # this is as fast is it can go... usleep(25) if ($s==1);
$ob->write($c); $ob->write($c);
} # if($s==1) {
# ($count, $c) = $ob->read(1);
# print $c;
# }
} }
}
if(-e $second) {$s=1; $filename = $second; next SEND; } last if ($s==1);
if((-e $second)) {
$s=1; $filename = $second;
} else {
last;
}
}; }
print "done.\n"; print "done.\n";