From be190969376c80886143dbda2a80eff383632a1c Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Mon, 23 May 2011 13:46:41 -0400 Subject: [PATCH] add index option to burn-mac and changes burn-macs to use burn-mac. --- tools/burn-mac.pl | 4 +++- tools/test-grid/burn-macs.pl | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/burn-mac.pl b/tools/burn-mac.pl index 6ea201309..69bcd9dc6 100755 --- a/tools/burn-mac.pl +++ b/tools/burn-mac.pl @@ -6,10 +6,12 @@ my $oui; my $addr = "0x1e000"; my $iab; my $term = "/dev/ttyUSB1"; +my $index = 0; GetOptions ('iab=s' => \$iab, 'oui=s' => \$oui, 'term=s' => \$term, + 'index=s' => \$index, ) or die 'bad options'; 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 $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"; system($cmd); diff --git a/tools/test-grid/burn-macs.pl b/tools/test-grid/burn-macs.pl index 311bac768..8dd9ac543 100755 --- a/tools/test-grid/burn-macs.pl +++ b/tools/test-grid/burn-macs.pl @@ -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 $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"; system($cmd); }