From 5981fb5397fae424a3b04ca28c8e849abb294ce8 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Mon, 6 Sep 2010 11:32:08 -0400 Subject: [PATCH] add scripts to help load a bunch of econotags --- tools/test-grid/erase-all.pl | 17 ++++++++++++ tools/test-grid/load-all.pl | 18 +++++++++++++ tools/test-grid/open-terms.pl | 49 +++++++++++++++++++++++++++++++++++ tools/test-grid/reset-all.pl | 17 ++++++++++++ 4 files changed, 101 insertions(+) create mode 100755 tools/test-grid/erase-all.pl create mode 100755 tools/test-grid/load-all.pl create mode 100755 tools/test-grid/open-terms.pl create mode 100755 tools/test-grid/reset-all.pl diff --git a/tools/test-grid/erase-all.pl b/tools/test-grid/erase-all.pl new file mode 100755 index 000000000..634c94b1a --- /dev/null +++ b/tools/test-grid/erase-all.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl +use strict; + +my $terms = shift; + +if (! $terms) { + print "Usage: num-devices\n"; + die; +} + +for (my $t=0; $t<$terms; $t++) { + my $dev_num = 2 * $t + 1; + my $ftdi_num = $terms - $t - 1; + my $cmd = "bbmc -l redbee-econotag -i $ftdi_num erase &"; + print "$cmd\n"; + system($cmd); +} diff --git a/tools/test-grid/load-all.pl b/tools/test-grid/load-all.pl new file mode 100755 index 000000000..d01ed1c08 --- /dev/null +++ b/tools/test-grid/load-all.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl +use strict; + +my $bin = shift; +my $terms = shift; + +if (! $terms) { + print "Usage: $0 file.bin num-devices\n"; + die; +} + +for (my $t=0; $t<$terms; $t++) { + my $dev_num = 2 * $t + 1; + my $ftdi_num = $terms - $t - 1; + my $cmd = "mc1322x-load.pl -e -f $bin -t /dev/ttyUSB$dev_num -c 'bbmc -l redbee-econotag -i $ftdi_num reset' &"; + print "$cmd\n"; + system($cmd); +} diff --git a/tools/test-grid/open-terms.pl b/tools/test-grid/open-terms.pl new file mode 100755 index 000000000..28718f22d --- /dev/null +++ b/tools/test-grid/open-terms.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +use strict; +use integer; + +my $start = shift; +my $end = shift; + +if (! $end) { + print "Usage: $0 first-term-num last-term-num\n"; + die; +} + +my $COLS = 4; + +my $index = 0; + +for (my $n=$start; $n <= $end; $n += 2) { + #print "$n\n"; + + open(OUT, ">/tmp/USB$n.ini"); + my $dev = "/dev/ttyUSB$n"; +print OUT <