Commit ffb52b97 authored by Robert Ricci's avatar Robert Ricci

Change to handle the fact that motes are now subnodes of thier hosts.

parent 182ee5a4
...@@ -89,28 +89,48 @@ MOTE: foreach my $mote (@motes) { ...@@ -89,28 +89,48 @@ MOTE: foreach my $mote (@motes) {
# #
my @uisp_args; my @uisp_args;
my ($type, $class) = TBNodeType($mote); #
if ($class ne "mote") { # Make sure they gave us an actual mote
#
my ($motetype, $moteclass) = TBNodeType($mote);
if ($moteclass ne "mote") {
warn "$mote is not a mote - skipping\n"; warn "$mote is not a mote - skipping\n";
$errors++; $errors++;
next MOTE; next MOTE;
} }
#
# Find out the type of the mote's host, which we use for actual programming
#
my $host;
if (!TBPhysNodeID($mote,\$host)) {
warn "Error getting host for $mote - skipping\n";
$errors++;
next MOTE;
}
if ($host eq $mote) {
warn "Error - no host found for $mote - skipping\n";
$errors++;
next MOTE;
}
my ($hosttype, $hostclass) = TBNodeType($host);
# #
# Figure out how we talk to the programming board, and what chipset it has # Figure out how we talk to the programming board, and what chipset it has
# #
TSWITCH: for ($type) { TSWITCH: for ($hosttype) {
/^emote$/ && do { /^emote$/ && do {
# Crossbow MIB600CA # Crossbow MIB600CA
# The name of the host to communicate with # The name of the host to communicate with
push @uisp_args, "-dhost=$mote"; push @uisp_args, "-dhost=$host";
# The type of programming board on a emote # The type of programming board on a emote
push @uisp_args, "-dprog=stk500"; push @uisp_args, "-dprog=stk500";
last TSWITCH; last TSWITCH;
}; };
# Default # Default
warn "Mote $mote has unsupported type $type - skipping"; warn "Mote host $host for $mote has unsupported type $hosttype " .
"- skipping";
$errors++; $errors++;
next MOTE; next MOTE;
} }
...@@ -118,7 +138,7 @@ MOTE: foreach my $mote (@motes) { ...@@ -118,7 +138,7 @@ MOTE: foreach my $mote (@motes) {
# #
# Find the name of the microcontroller on the board # Find the name of the microcontroller on the board
# #
my ($proc, $speed) = TBNodeTypeProcInfo($type); my ($proc, $speed) = TBNodeTypeProcInfo($motetype);
PSWITCH: for ($proc) { PSWITCH: for ($proc) {
/^ATmega128/i && do { /^ATmega128/i && do {
push @uisp_args, "-dpart=ATmega128"; push @uisp_args, "-dpart=ATmega128";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment