[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/delugetools
TOSBootImage.java, 1.1, 1.2 ImageInjector.java, 1.1, 1.2
Jonathan Hui
jwhui at users.sourceforge.net
Tue Jan 18 12:47:12 PST 2005
Update of /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4934
Modified Files:
TOSBootImage.java ImageInjector.java
Log Message:
- Detects whether or not the image has Deluge compiled in and gives a
big warning if the user tries to inject an image without Deluge.
Index: TOSBootImage.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/TOSBootImage.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TOSBootImage.java 17 Jan 2005 19:48:18 -0000 1.1
--- TOSBootImage.java 18 Jan 2005 20:46:55 -0000 1.2
***************
*** 52,59 ****
--- 52,72 ----
private long userHash; // 4
+ private boolean delugeSupport = false;
+
private IhexReader image;
TOSBootImage(String filename) {
+ if (filename.equals("")) {
+ System.out.println("ERROR: No file specified.");
+ System.exit(0);
+ }
+
+ File file = new File(filename);
+ if (!file.exists()) {
+ System.out.println("ERROR: No such file: " + filename);
+ System.exit(0);
+ }
+
try {
***************
*** 84,87 ****
--- 97,104 ----
image = new IhexReader(imageStr);
+ nlist=doc.getElementsByTagName("deluge_support");
+ tmp = nlist.item(0).getFirstChild().getNodeValue();
+ delugeSupport = tmp.equals("yes");
+
} catch (Exception e) {
e.printStackTrace();
***************
*** 178,181 ****
--- 195,199 ----
public long getUnixTime() { return unixTime; }
public long getUserHash() { return userHash; }
+ public boolean getDelugeSupport() { return delugeSupport; }
}
\ No newline at end of file
Index: ImageInjector.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/ImageInjector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ImageInjector.java 17 Jan 2005 19:48:18 -0000 1.1
--- ImageInjector.java 18 Jan 2005 20:46:56 -0000 1.2
***************
*** 109,112 ****
--- 109,122 ----
}
+ if (!newTOSBootImage.getDelugeSupport()) {
+ System.out.println();
+ System.out.println("--------------------------------------------------");
+ System.out.println("| WARNING: New image does not include Deluge. |");
+ System.out.println("| Network programming will not be |");
+ System.out.println("| possible when running this app. |");
+ System.out.println("--------------------------------------------------");
+ System.out.println();
+ }
+
advMsg.set_imgDesc_vNum(newVersion);
More information about the Tinyos-beta-commits
mailing list