[Tinyos-commits]
CVS: tinyos-1.x/tools/scripts write_tos_image, 1.4, 1.5
Cory Sharp
cssharp at users.sourceforge.net
Tue Jun 21 01:49:58 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/tools/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27389
Modified Files:
write_tos_image
Log Message:
Take an optional --supplement command line parameter that specifies a binary
file to be included in tos_image.xml in a <supplement> tag as ascii hex.
Index: write_tos_image
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tools/scripts/write_tos_image,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** write_tos_image 17 May 2005 20:37:50 -0000 1.4
--- write_tos_image 21 Jun 2005 08:49:55 -0000 1.5
***************
*** 17,20 ****
--- 17,21 ----
my $objdump = "avr-objdump";
my $platform = "";
+ my $supplement = "";
for my $arg (@ARGV) {
***************
*** 37,40 ****
--- 38,44 ----
$platform = $1;
}
+ elsif ($arg =~ /^--supplement=(.+)$/) {
+ $supplement = $1;
+ }
}
***************
*** 66,68 ****
--- 70,83 ----
print " </image>\n";
+
+ if( $supplement ) {
+ open( SUPP, "< $supplement" ) or die "Cannot open supplement file: $!\n";
+ my $hex = unpack( "h*", do{local $/;<SUPP>} );
+ $hex =~ s/(.{64})/$1\n/g;
+ $hex =~ s/\s+$//;
+ close(SUPP);
+ print " <supplement format=\"hex\">\n$hex\n </supplement>\n";
+ }
+
print "</tos_image>\n";
+
More information about the Tinyos-commits
mailing list