[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/delugetools
Deluge.java, 1.13, 1.14 Pinger.java, 1.10, 1.11 Rebooter.java,
1.6, 1.7
Jonathan Hui
jwhui at users.sourceforge.net
Wed Jun 29 14:08:35 PDT 2005
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/Deluge DelugeM.nc, 1.22,
1.23 DelugeMetadataM.nc, 1.19, 1.20 DelugeStorage.nc, 1.4,
1.5 DelugeStorageM.nc, 1.9, 1.10 NetProgM.nc, 1.8, 1.9
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge/TOSBoot
Makefile, 1.4, 1.5 TOSBootM.nc, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv879
Modified Files:
Deluge.java Pinger.java Rebooter.java
Log Message:
Added support for rebooting to the Golden Image even if the deluge
images do not mount properly. This is possible since the address of
the golden image in external flash is known and fixed for each flash
chip.
Index: Deluge.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/Deluge.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Deluge.java 21 Jun 2005 23:38:12 -0000 1.13
--- Deluge.java 29 Jun 2005 21:08:32 -0000 1.14
***************
*** 175,182 ****
Pinger pinger = null;
! // if (mode != S_DUMP) {
! pinger = new Pinger(moteif, verbose);
! pinger.ping();
! // }
System.out.println("--------------------------------------------------");
--- 175,180 ----
Pinger pinger = null;
! pinger = new Pinger(moteif, verbose);
! pinger.ping();
System.out.println("--------------------------------------------------");
***************
*** 186,189 ****
--- 184,192 ----
case S_PING:
+ if (pinger.existsError()) {
+ throw new IllegalArgumentException(
+ "Deluge is not running on one or more nodes" );
+ }
+
System.out.println(" Currently Executing:");
System.out.println(pinger.getExecutingIdent());
***************
*** 233,236 ****
--- 236,244 ----
case S_DUMP:
+ if (pinger.existsError()) {
+ throw new IllegalArgumentException(
+ "Deluge is not running on one or more nodes" );
+ }
+
Downloader downloader = new Downloader(pinger, imageNum, moteif, verbose, outfile);
***************
*** 241,244 ****
--- 249,257 ----
case S_INJECT:
+ if (pinger.existsError()) {
+ throw new IllegalArgumentException(
+ "Deluge is not running on one or more nodes" );
+ }
+
TOSBootImage newImage = new TOSBootImage(infile);
***************
*** 254,257 ****
--- 267,275 ----
case S_ERASE:
+ if (pinger.existsError()) {
+ throw new IllegalArgumentException(
+ "Deluge is not running on one or more nodes" );
+ }
+
Eraser eraser = new Eraser(pinger, imageNum, moteif, verbose, force);
***************
*** 262,265 ****
--- 280,288 ----
case S_RESET:
+ if (pinger.existsError()) {
+ throw new IllegalArgumentException(
+ "Deluge is not running on one or more nodes" );
+ }
+
Eraser resetter = new Eraser(pinger, imageNum, moteif, verbose, force);
Index: Pinger.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/Pinger.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Pinger.java 22 Jun 2005 22:38:35 -0000 1.10
--- Pinger.java 29 Jun 2005 21:08:32 -0000 1.11
***************
*** 73,76 ****
--- 73,77 ----
private int attempts = 0;
private String identString = "";
+ private boolean error = false;
public Pinger(MoteIF moteif, boolean verbose) {
***************
*** 127,132 ****
dest = MoteIF.TOS_BCAST_ADDR;
! if (advMsg.get_imgDesc_imgNum() >= numImages
! && numImages != -1)
break;
--- 128,134 ----
dest = MoteIF.TOS_BCAST_ADDR;
! if ((advMsg.get_imgDesc_imgNum() >= numImages
! && numImages != -1)
! || error )
break;
***************
*** 157,160 ****
--- 159,166 ----
}
+ public boolean existsError() {
+ return error;
+ }
+
public DelugeAdvMsg getPingReply(int imageNum) {
return (DelugeAdvMsg)pingReplies.get(new Integer(imageNum));
***************
*** 249,256 ****
if (verbose) System.out.print(pingReply);
! if ( pingReply.get_type() == DelugeConsts.DELUGE_ADV_ERROR ) {
! throw new IllegalArgumentException(
! "Deluge is not running on one or more nodes" );
! }
if (dest == MoteIF.TOS_BCAST_ADDR)
--- 255,260 ----
if (verbose) System.out.print(pingReply);
! if ( pingReply.get_type() == DelugeConsts.DELUGE_ADV_ERROR )
! error = true;
if (dest == MoteIF.TOS_BCAST_ADDR)
Index: Rebooter.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/Rebooter.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Rebooter.java 21 Jun 2005 23:38:12 -0000 1.6
--- Rebooter.java 29 Jun 2005 21:08:32 -0000 1.7
***************
*** 57,60 ****
--- 57,65 ----
}
+ if ( pinger.existsError() && imageNum > 0 ) {
+ throw new IllegalArgumentException(
+ "Deluge is not running on one or more nodes.");
+ }
+
this.pinger = pinger;
this.pingReply = pinger.getPingReply(imageNum);
***************
*** 65,69 ****
this.force = force;
this.moteif.registerListener(new DelugeAdvMsg(), this);
!
newVersion = (short)((short)pingReply.get_nodeDesc_vNum() + (short)1);
if (newVersion == DelugeConsts.DELUGE_INVALID_VNUM)
--- 70,74 ----
this.force = force;
this.moteif.registerListener(new DelugeAdvMsg(), this);
!
newVersion = (short)((short)pingReply.get_nodeDesc_vNum() + (short)1);
if (newVersion == DelugeConsts.DELUGE_INVALID_VNUM)
***************
*** 88,93 ****
TOSBootImage image = newImage;
System.out.println(" To Image: " + pingReply.get_imgDesc_imgNum());
! System.out.println(image);
!
if( !force )
--- 93,110 ----
TOSBootImage image = newImage;
System.out.println(" To Image: " + pingReply.get_imgDesc_imgNum());
! if ( !pinger.existsError() && pingReply.get_imgDesc_numPgs() != 0 ) {
! System.out.println(image);
! }
! else {
! System.out.println(" Golden Image.");
! System.out.println();
! System.out.println("--------------------------------------------------");
! System.out.println("| WARNING: No info for Golden Image is available |");
! System.out.println("| but reboot attempts to this image are |");
! System.out.println("| allowed. If no such image exists, |");
! System.out.println("| no reprogramming will occur. |");
! System.out.println("--------------------------------------------------");
! System.out.println();
! }
if( !force )
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/Deluge DelugeM.nc, 1.22,
1.23 DelugeMetadataM.nc, 1.19, 1.20 DelugeStorage.nc, 1.4,
1.5 DelugeStorageM.nc, 1.9, 1.10 NetProgM.nc, 1.8, 1.9
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge/TOSBoot
Makefile, 1.4, 1.5 TOSBootM.nc, 1.10, 1.11
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-beta-commits
mailing list