add index option to burn-mac and changes burn-macs to use burn-mac.

This commit is contained in:
Mariano Alvira 2011-05-23 13:46:41 -04:00
parent 0d1cc63b04
commit be19096937
2 changed files with 5 additions and 2 deletions

View file

@ -6,10 +6,12 @@ my $oui;
my $addr = "0x1e000"; my $addr = "0x1e000";
my $iab; my $iab;
my $term = "/dev/ttyUSB1"; my $term = "/dev/ttyUSB1";
my $index = 0;
GetOptions ('iab=s' => \$iab, GetOptions ('iab=s' => \$iab,
'oui=s' => \$oui, 'oui=s' => \$oui,
'term=s' => \$term, 'term=s' => \$term,
'index=s' => \$index,
) or die 'bad options'; ) or die 'bad options';
my $bin = shift; my $bin = shift;
@ -59,7 +61,7 @@ reverse @words;
my $word1 = sprintf("%02X%02X%02X%02X",$words[4],$words[5],$words[6],$words[7]); my $word1 = sprintf("%02X%02X%02X%02X",$words[4],$words[5],$words[6],$words[7]);
my $word2 = sprintf("%02X%02X%02X%02X",$words[0],$words[1],$words[2],$words[3]); my $word2 = sprintf("%02X%02X%02X%02X",$words[0],$words[1],$words[2],$words[3]);
my $cmd = "mc1322x-load.pl -e -f $bin -z -t $term -c 'bbmc -l redbee-econotag reset' $addr,0x$word1,0x$word2 &"; my $cmd = "mc1322x-load.pl -e -f $bin -z -t $term -c 'bbmc -i $index -l redbee-econotag reset' $addr,0x$word1,0x$word2 &";
print "$cmd\n"; print "$cmd\n";
system($cmd); system($cmd);

View file

@ -44,7 +44,8 @@ for (my $t=0; $t<$terms; $t++) {
my $word2 = sprintf("%02X%02X%02X%02X",$words[0],$words[1],$words[2],$words[3]); my $word2 = sprintf("%02X%02X%02X%02X",$words[0],$words[1],$words[2],$words[3]);
my $ftdi_num = $terms - $t - 1; my $ftdi_num = $terms - $t - 1;
my $cmd = "mc1322x-load.pl -e -f $bin -z -t /dev/ttyUSB$dev_num -c 'bbmc -l redbee-econotag -i $ftdi_num reset' $addr,0x$word1,0x$word2 &";
my $cmd = "../burn-mac.pl --iab=a8c --term=/dev/ttyUSB$dev_num --index=$ftdi_num $bin $dev_num";
print "$cmd\n"; print "$cmd\n";
system($cmd); system($cmd);
} }