[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/delugetools
ImageInjector.java, 1.6, 1.7 TOSBootImage.java, 1.4, 1.5
Jonathan Hui
jwhui at users.sourceforge.net
Mon Jun 27 15:38:23 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3076
Modified Files:
ImageInjector.java TOSBootImage.java
Log Message:
Allow supplement section of tos_image.xml to be arbitrarily large and
check the entire deluge image size when attempting to inject. The
limit should be dependent on the platform and will be so when deluge
2.0 support for other platforms is brought up.
Index: ImageInjector.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/ImageInjector.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ImageInjector.java 21 Jun 2005 23:38:12 -0000 1.6
--- ImageInjector.java 27 Jun 2005 22:38:18 -0000 1.7
***************
*** 72,75 ****
--- 72,79 ----
this.verbose = verbose;
this.force = force;
+
+ if (delugeImage.getNumPages() > 58) {
+ throw new IllegalArgumentException( "tos image is too large" );
+ }
advMsg = (DelugeAdvMsg)pingReply.clone();
***************
*** 83,86 ****
--- 87,91 ----
imageBytes = delugeImage.getBytes();
+
}
***************
*** 336,339 ****
--- 341,345 ----
try {
transmitPacket();
+ Thread.sleep(8);
} catch (Exception e) {
e.printStackTrace();
Index: TOSBootImage.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/TOSBootImage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TOSBootImage.java 21 Jun 2005 23:38:12 -0000 1.4
--- TOSBootImage.java 27 Jun 2005 22:38:19 -0000 1.5
***************
*** 44,48 ****
private final static int UNIX_TIME_SIZE = 4;
private final static int USER_HASH_SIZE = 4;
- private final static int MAX_SUPPLEMENT_SIZE = 10*1024;
private String name; // 16
--- 44,47 ----
***************
*** 106,110 ****
if (nlist.item(0) != null) {
String supplementStr = nlist.item(0).getFirstChild().getNodeValue().trim();
! supplement = new byte[MAX_SUPPLEMENT_SIZE];
supplementSize = 0;
for ( int i = 0; i < supplementStr.length(); i++ ) {
--- 105,114 ----
if (nlist.item(0) != null) {
String supplementStr = nlist.item(0).getFirstChild().getNodeValue().trim();
! for ( int i = 0; i < supplementStr.length(); i++ ) {
! if (supplementStr.charAt(i) == '\n') continue;
! supplementSize++;
! i++;
! }
! supplement = new byte[supplementSize];
supplementSize = 0;
for ( int i = 0; i < supplementStr.length(); i++ ) {
More information about the Tinyos-beta-commits
mailing list