[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/delugetools
DelugeCrc.java, NONE, 1.1 DelugeImage.java, NONE,
1.1 Eraser.java, NONE, 1.1 IhexReader.java, NONE,
1.1 ImageInjector.java, NONE, 1.1 Pinger.java, NONE,
1.1 Rebooter.java, NONE, 1.1 TOSBootImage.java, NONE,
1.1 Deluge.java, 1.3, 1.4
Jonathan Hui
jwhui at users.sourceforge.net
Mon Jan 17 11:48:34 PST 2005
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/TestDeluge/GoldenImage
GoldenImage.nc, NONE, 1.1 GoldenImageM.nc, NONE, 1.1 Makefile,
1.1, 1.2 GoldenImageWriter.nc, 1.1, NONE GoldenImageWriterM.nc,
1.3, NONE
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge README.txt, 1.17,
1.18
- 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-serv27566
Modified Files:
Deluge.java
Added Files:
DelugeCrc.java DelugeImage.java Eraser.java IhexReader.java
ImageInjector.java Pinger.java Rebooter.java TOSBootImage.java
Log Message:
- Long overdue rewrite of java-side app for Deluge. The single class
file was getting out of hand.
- Parses tos_image.xml file.
- Now shows all image metadata information and asks the user to
confirm the operation before continuing (abort is default). For
example, erasing an image shows the program name, compile time,
etc. for that image, then asks the user to confirm erasing the image.
--- NEW FILE: DelugeCrc.java ---
// $Id: DelugeCrc.java,v 1.1 2005/01/17 19:48:17 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
public class DelugeCrc {
public static short crcByte(short crc, byte b) {
int i;
crc = (short)(crc ^ b << 8);
i = 8;
do {
if ((crc & 0x8000) != 0)
crc = (short)(crc << 1 ^ 0x1021);
else
crc = (short)(crc << 1);
} while (--i > 0);
return crc;
}
public static DelugeAdvMsg computeAdvCrc(DelugeAdvMsg advMsg) {
// calc crc of adv message
byte[] tmpBytes = advMsg.dataGet();
short crc;
int start = DelugeAdvMsg.offset_nodeDesc_vNum();
int stop = DelugeAdvMsg.offset_nodeDesc_crc();
crc = 0;
for ( int i = start; i < stop; i++ )
crc = DelugeCrc.crcByte(crc, tmpBytes[i]);
advMsg.set_nodeDesc_crc(crc);
start = DelugeAdvMsg.offset_imgDesc_vNum();
stop = DelugeAdvMsg.offset_imgDesc_crc();
crc = 0;
for ( int i = start; i < stop; i++ )
crc = DelugeCrc.crcByte(crc, tmpBytes[i]);
advMsg.set_imgDesc_crc(crc);
return advMsg;
}
}
--- NEW FILE: DelugeImage.java ---
// $Id: DelugeImage.java,v 1.1 2005/01/17 19:48:18 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
public class DelugeImage {
private static final int MAX_SIZE = 1024*512;
private short image[] = new short[MAX_SIZE];
private short numPages;
private int byteCount;
private int size;
private short crcByte(short crc, byte b) {
int i;
crc = (short)(crc ^ b << 8);
i = 8;
do {
if ((crc & 0x8000) != 0)
crc = (short)(crc << 1 ^ 0x1021);
else
crc = (short)(crc << 1);
} while (--i > 0);
return crc;
}
public DelugeImage(byte[] tmpBytes, int length) {
short bytes[] = new short[length];
size = 2*DelugeConsts.DELUGE_MAX_PAGES;
for ( int i = 0; i < length; i++ )
bytes[i] = (short)(tmpBytes[i] & 0xff);
short crc = 0;
for ( int i = 0; i < length; i++ ) {
if ((size % DelugeConsts.DELUGE_BYTES_PER_PAGE) == 0) {
int offset = 2*((size-1)/DelugeConsts.DELUGE_BYTES_PER_PAGE);
image[offset+0] = (short)((crc >> 0x0) & 0xff);
image[offset+1] = (short)((crc >> 0x8) & 0xff);
crc = 0;
}
crc = crcByte(crc, (byte)bytes[i]);
image[size++] = bytes[i];
}
// finish out rest of page and calculate CRC
while((size % DelugeConsts.DELUGE_BYTES_PER_PAGE) != 0) {
crc = crcByte(crc, (byte)0x0);
image[size++] = 0;
}
int offset = 2*((size-1)/DelugeConsts.DELUGE_BYTES_PER_PAGE);
image[offset+0] = (short)((crc >> 0x0) & 0xff);
image[offset+1] = (short)((crc >> 0x8) & 0xff);
numPages = (short)(((size-1)/(DelugeConsts.DELUGE_PKTS_PER_PAGE*DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE))+1);
}
private void printByte(int byteVal) {
if (byteVal >= 0 && byteVal < 16)
System.out.print("0");
System.out.print(Integer.toHexString(byteVal).toUpperCase() + " " );
byteCount++;
if (byteCount >= 16) {
System.out.println();
byteCount = 0;
}
}
public void dump() {
byteCount = 0;
for (int i = 0; i < size; i++ )
printByte(image[i]);
System.out.println();
}
public short[] getBytes() { return image; }
public short getNumPages() { return numPages; }
}
--- NEW FILE: Eraser.java ---
// $Id: Eraser.java,v 1.1 2005/01/17 19:48:18 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
import net.tinyos.message.*;
import java.io.*;
public class Eraser implements MessageListener {
private DelugeAdvMsg advMsg;
private DelugeAdvMsg pingReply;
private MoteIF moteif;
private TOSBootImage oldTOSBootImage;
private boolean verbose;
private boolean injectAcked = false;
public Eraser(DelugeAdvMsg pingReply,
TOSBootImage oldTOSBootImage,
short pcAddr, MoteIF moteif, boolean verbose) {
this.pingReply = pingReply;
this.oldTOSBootImage = oldTOSBootImage;
this.moteif = moteif;
this.verbose = verbose;
advMsg = (DelugeAdvMsg)pingReply.clone();
advMsg.set_sourceAddr(pcAddr);
advMsg.set_type(DelugeConsts.DELUGE_ADV_PC);
advMsg.set_imgDesc_vNum(DelugeConsts.DELUGE_INVALID_VNUM);
advMsg.set_imgDesc_numPgs((short)0);
advMsg.set_imgDesc_numPgsComplete((short)0);
}
public void erase() {
short newVersion;
if (pingReply.get_imgDesc_numPgsComplete() == 0) {
System.out.println("ERROR: Image already erased.");
return;
}
else {
System.out.println("Erase image:");
System.out.println(" Image: " + pingReply.get_imgDesc_imgNum());
System.out.println(oldTOSBootImage);
newVersion = (short)((short)pingReply.get_imgDesc_vNum() + (short)1);
if (newVersion == DelugeConsts.DELUGE_INVALID_VNUM)
newVersion = 0;
}
System.out.print("Continue operation? (y/[n]) " );
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try {
for (;;) {
String ans = in.readLine();
ans = ans.toLowerCase();
if (ans.equals("") || ans.equals("n") || ans.equals("no")) {
System.out.println("Operation canceled.");
System.exit(0);
}
if (ans.equals("y") || ans.equals("yes"))
break;
System.out.print("Please enter yes or no: ");
}
} catch (IOException e) {
e.printStackTrace();
}
advMsg.set_imgDesc_vNum(newVersion);
moteif.registerListener(new DelugeAdvMsg(), this);
while(!injectAcked) {
try {
advMsg = DelugeCrc.computeAdvCrc(advMsg);
send(advMsg);
if (verbose) System.out.print(advMsg);
Thread.currentThread().sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
private void send(Message m) {
try {
moteif.send(MoteIF.TOS_BCAST_ADDR, m);
} catch (Exception e) {
e.printStackTrace();
}
}
public void messageReceived(int to, Message m) {
switch(m.amType()) {
case DelugeAdvMsg.AM_TYPE:
DelugeAdvMsg rxAdvMsg = (DelugeAdvMsg)m;
if (verbose) System.out.print(rxAdvMsg);
if (advMsg.get_imgDesc_vNum() == rxAdvMsg.get_imgDesc_vNum()
&& advMsg.get_imgDesc_numPgs() == rxAdvMsg.get_imgDesc_numPgsComplete()) {
// ALL DONE, QUIT!
injectAcked = true;
}
break;
}
}
}
--- NEW FILE: IhexReader.java ---
// $Id: IhexReader.java,v 1.1 2005/01/17 19:48:18 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
import java.io.*;
import java.util.*;
public class IhexReader {
private static final int MAX_SIZE = 1024*512;
private static final int RECTYP_DATA = 0;
private static final int RECTYP_EOF = 1;
private static final int RECTYP_EXTSEG = 2;
private static final int RECTYP_STARTSEG = 3;
private byte ihexdata[] = new byte[MAX_SIZE];
private int imageOffset = 0;
public IhexReader(String str) throws IOException {
int totalBytes = 0;
int physicalAddr = 0;
int sectionBaseAddr = 0;
int sectionCount = 0;
int imgStartOffset = 0;
int upperSegBaseAddr = 0;
try {
StringTokenizer strtok = new StringTokenizer(str, "\n");
String line;
int rectyp = RECTYP_DATA;
while(strtok.hasMoreTokens() && rectyp != RECTYP_EOF) {
line = strtok.nextToken();
char bline[] = line.toUpperCase().toCharArray();
if (bline[0] != ':')
throw new IOException("Parse error in ihex file.");
int reclen = Integer.parseInt(Character.toString(bline[1]) +
Character.toString(bline[2]),
16);
int offset = Integer.parseInt(Character.toString(bline[3]) +
Character.toString(bline[4]) +
Character.toString(bline[5]) +
Character.toString(bline[6]),
16);
rectyp = Integer.parseInt(Character.toString(bline[7]) +
Character.toString(bline[8]),
16);
switch(rectyp) {
case RECTYP_DATA:
if ((upperSegBaseAddr+offset) != physicalAddr) {
int sectionLen = physicalAddr - sectionBaseAddr;
for ( int i = 0; i < 4; i++ )
ihexdata[imgStartOffset+4+i] = (byte)((sectionLen >> (i*8)) & 0xff);
}
if (imageOffset == 0 || (upperSegBaseAddr+offset) != physicalAddr) {
sectionCount++;
physicalAddr = (upperSegBaseAddr+offset);
sectionBaseAddr = (upperSegBaseAddr+offset);
imgStartOffset = imageOffset;
ihexdata[imageOffset+0] = (byte)((physicalAddr >> 0) & 0xff);
ihexdata[imageOffset+1] = (byte)((physicalAddr >> 8) & 0xff);
imageOffset += 8;
}
for ( int i = 0; i < reclen; i++ ) {
ihexdata[imageOffset++] = (byte)Integer.parseInt(Character.toString(bline[2*i+9]) +
Character.toString(bline[2*i+10]),
16);
totalBytes++;
physicalAddr++;
}
break;
case RECTYP_EXTSEG:
upperSegBaseAddr = Integer.parseInt(Character.toString(bline[9]) +
Character.toString(bline[10]) +
Character.toString(bline[11]) +
Character.toString(bline[12]),
16);
upperSegBaseAddr <<= 4;
break;
case RECTYP_EOF:
int sectionLen = physicalAddr - sectionBaseAddr;
for ( int i = 0; i < 4; i++ )
ihexdata[imgStartOffset+4+i] = (byte)((sectionLen >> (i*8)) & 0xff);
for ( int i = 0; i < 8; i++ )
ihexdata[imageOffset++] = 0x0;
break;
case RECTYP_STARTSEG:
break;
default:
System.out.println(bline);
throw new IOException("Parse error in ihex file (unexpected type " + rectyp + ")");
}
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Ihex read complete:");
System.out.println(" Total bytes = " + totalBytes);
System.out.println(" Sections = " + sectionCount);
}
public int getSize() { return imageOffset; }
public byte[] getBytes() { return ihexdata; }
}
--- NEW FILE: ImageInjector.java ---
// $Id: ImageInjector.java,v 1.1 2005/01/17 19:48:18 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
import net.tinyos.message.*;
import java.io.*;
public class ImageInjector implements MessageListener {
private DelugeAdvMsg advMsg;
private DelugeAdvMsg pingReply;
private MoteIF moteif;
private TOSBootImage oldTOSBootImage, newTOSBootImage;
private DelugeImage delugeImage;
private short[] imageBytes;
private Thread pageInjectorThread;
private PageInjector pageInjector;
private boolean verbose;
private boolean injectAcked = false;
public ImageInjector(DelugeAdvMsg pingReply,
TOSBootImage oldTOSBootImage,
TOSBootImage newTOSBootImage,
short pcAddr, MoteIF moteif, boolean verbose) {
byte[] tbimageBytes = newTOSBootImage.getBytes();
this.pingReply = pingReply;
this.oldTOSBootImage = oldTOSBootImage;
this.newTOSBootImage = newTOSBootImage;
this.delugeImage = new DelugeImage(tbimageBytes, tbimageBytes.length);
this.moteif = moteif;
this.verbose = verbose;
advMsg = (DelugeAdvMsg)pingReply.clone();
advMsg.set_sourceAddr(pcAddr);
advMsg.set_type(DelugeConsts.DELUGE_ADV_PC);
advMsg.set_imgDesc_vNum(DelugeConsts.DELUGE_INVALID_VNUM);
advMsg.set_imgDesc_numPgs(delugeImage.getNumPages());
advMsg.set_imgDesc_numPgsComplete(delugeImage.getNumPages());
imageBytes = delugeImage.getBytes();
}
public void inject() {
short newVersion;
if (pingReply.get_imgDesc_numPgsComplete() == 0) {
System.out.println("Replace empty image with:");
System.out.println(" Image: " + pingReply.get_imgDesc_imgNum());
System.out.println(newTOSBootImage);
newVersion = (short)((short)pingReply.get_imgDesc_vNum() + (short)1);
if (newVersion == DelugeConsts.DELUGE_INVALID_VNUM)
newVersion = 0;
}
else if (oldTOSBootImage.equalTo(newTOSBootImage)) {
if (pingReply.get_imgDesc_numPgsComplete() == pingReply.get_imgDesc_numPgs()) {
System.out.println("ERROR: Image already injected:");
System.out.println(" Image: " + pingReply.get_imgDesc_imgNum());
System.out.println(oldTOSBootImage);
return;
}
else {
System.out.println("Resume injection of image:");
System.out.println(" Image: " + pingReply.get_imgDesc_imgNum());
System.out.println(oldTOSBootImage);
newVersion = pingReply.get_imgDesc_vNum();
}
}
else {
System.out.println("Replace image:");
System.out.println(" Image: " + pingReply.get_imgDesc_imgNum());
System.out.println(oldTOSBootImage);
System.out.println("With image:");
System.out.println(" Image: " + pingReply.get_imgDesc_imgNum());
System.out.println(newTOSBootImage);
newVersion = (short)((short)pingReply.get_imgDesc_vNum() + (short)1);
if (newVersion == DelugeConsts.DELUGE_INVALID_VNUM)
newVersion = 0;
}
advMsg.set_imgDesc_vNum(newVersion);
System.out.print("Continue operation? (y/[n]) " );
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try {
for (;;) {
String ans = in.readLine();
ans = ans.toLowerCase();
if (ans.equals("") || ans.equals("n") || ans.equals("no")) {
System.out.println("Operation canceled.");
System.exit(0);
}
if (ans.equals("y") || ans.equals("yes"))
break;
System.out.print("Please enter yes or no: ");
}
} catch (IOException e) {
e.printStackTrace();
}
moteif.registerListener(new DelugeAdvMsg(), this);
moteif.registerListener(new DelugeReqMsg(), this);
pageInjector = new PageInjector();
pageInjectorThread = new Thread(pageInjector);
pageInjectorThread.start();
while(!injectAcked) {
try {
advMsg = DelugeCrc.computeAdvCrc(advMsg);
send(advMsg);
if (verbose) System.out.print(advMsg);
Thread.currentThread().sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
private void send(Message m) {
try {
moteif.send(MoteIF.TOS_BCAST_ADDR, m);
} catch (Exception e) {
e.printStackTrace();
}
}
public void messageReceived(int to, Message m) {
switch(m.amType()) {
case DelugeAdvMsg.AM_TYPE:
DelugeAdvMsg rxAdvMsg = (DelugeAdvMsg)m;
if (verbose) System.out.print(rxAdvMsg);
if (advMsg.get_imgDesc_vNum() == rxAdvMsg.get_imgDesc_vNum()
&& advMsg.get_imgDesc_numPgs() == rxAdvMsg.get_imgDesc_numPgsComplete()) {
// ALL DONE, QUIT!
System.out.println();
injectAcked = true;
}
break;
case DelugeReqMsg.AM_TYPE:
DelugeReqMsg req = (DelugeReqMsg)m;
boolean pktsToSend[] = new boolean[DelugeConsts.DELUGE_PKTS_PER_PAGE];
if (verbose) System.out.print(req);
if (advMsg.get_imgDesc_vNum() != req.get_vNum()
|| advMsg.get_imgDesc_imgNum() != req.get_imgNum())
return;
for ( int i = 0; i < DelugeConsts.DELUGE_PKTS_PER_PAGE; i++ ) {
short[] tmp = req.get_requestedPkts();
if ((tmp[i/8]&(1 << (i%8))) != 0)
pktsToSend[i] = true;
}
pageInjector.transmitPage(req.get_pgNum(), pktsToSend);
break;
}
}
private class PageInjector implements Runnable {
private boolean pktsToSend[] = new boolean[DelugeConsts.DELUGE_PKTS_PER_PAGE];
private int pageToSend = DelugeConsts.DELUGE_INVALID_PGNUM;
private boolean transmittingPage = false;
private int curPkt = 0;
public PageInjector() {
}
public boolean isTransmitting() {
return transmittingPage;
}
synchronized public void transmitPage(int pgNum, boolean pktsToSend[]) {
if (pgNum > pageToSend)
return;
if (pgNum < pageToSend) {
for ( int i = 0; i < this.pktsToSend.length; i++ )
this.pktsToSend[i] = false;
this.pageToSend = pgNum;
curPkt = 0;
}
for ( int i = 0; i < this.pktsToSend.length; i++ )
this.pktsToSend[i] |= pktsToSend[i];
notifyAll();
}
private boolean arePacketsToSend() {
for ( int i = 0; i < DelugeConsts.DELUGE_PKTS_PER_PAGE; i++ ) {
if (pktsToSend[i])
return true;
}
return false;
}
synchronized private void transmitPacket() {
DelugeDataMsg dataMsg = new DelugeDataMsg();
short packet[] = new short[DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE];
while ( !arePacketsToSend() ) {
pageToSend = DelugeConsts.DELUGE_INVALID_PGNUM;
try {
transmittingPage = false;
wait();
transmittingPage = true;
System.out.print("\rInjecting page [" + (pageToSend+1) + "] of [" + delugeImage.getNumPages() + "] ...");
} catch (Exception e) {
e.printStackTrace();
}
}
dataMsg.set_vNum(advMsg.get_imgDesc_vNum());
dataMsg.set_imgNum(advMsg.get_imgDesc_imgNum());
dataMsg.set_pgNum((short)pageToSend);
while (!pktsToSend[curPkt])
curPkt = (curPkt+1) % DelugeConsts.DELUGE_PKTS_PER_PAGE;
System.arraycopy(imageBytes, pageToSend*(DelugeConsts.DELUGE_PKTS_PER_PAGE*DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE)
+ curPkt*DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE,
packet, 0,
DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE);
dataMsg.set_pktNum((short)curPkt);
dataMsg.set_data(packet);
if (verbose) System.out.print(dataMsg);
send(dataMsg);
pktsToSend[curPkt] = false;
curPkt = (curPkt + 1) % DelugeConsts.DELUGE_PKTS_PER_PAGE;
}
synchronized private void send(Message m) {
try {
moteif.send(MoteIF.TOS_BCAST_ADDR, m);
} catch (Exception e) {
e.printStackTrace();
}
}
public void run() {
for(;;) {
try {
transmitPacket();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
--- NEW FILE: Pinger.java ---
// $Id: Pinger.java,v 1.1 2005/01/17 19:48:18 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
import net.tinyos.message.*;
import net.tinyos.util.*;
import java.util.*;
public class Pinger implements MessageListener {
private static final short TOS_UART_ADDR = 0x007e;
private static final int START_PKT = DelugeConsts.DELUGE_CRC_BLOCK_SIZE/DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE;
private static final int END_PKT = DelugeConsts.DELUGE_IDENT_SIZE/DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE;
private MoteIF moteif;
private boolean verbose;
private short curImage = -1;
private DelugeAdvMsg advMsg = new DelugeAdvMsg();
private Hashtable pingReplies = new Hashtable();
private Hashtable images = new Hashtable();
private short pcAddr = 0x7e;
private short pktsToReceive[] = new short[DelugeReqMsg.totalSize_requestedPkts()];
private short imageData[] = new short[DelugeConsts.DELUGE_PKTS_PER_PAGE*DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE];
private int pktsReceived = 0;
private boolean resolvedNodeType = false;
public Pinger(MoteIF moteif, boolean verbose) {
this.moteif = moteif;
this.verbose = verbose;
this.moteif.registerListener(new DelugeAdvMsg(), this);
this.moteif.registerListener(new DelugeDataMsg(), this);
}
public void ping() {
advMsg.set_sourceAddr(pcAddr);
advMsg.set_version(DelugeConsts.DELUGE_VERSION);
advMsg.set_type((short)DelugeConsts.DELUGE_ADV_PC);
advMsg.set_nodeDesc_vNum(DelugeConsts.DELUGE_INVALID_VNUM);
advMsg.set_nodeDesc_imgNum(DelugeConsts.DELUGE_INVALID_IMGNUM);
advMsg.set_imgDesc_vNum(DelugeConsts.DELUGE_INVALID_VNUM);
System.out.println("Pinging node ...");
setupNewImage();
for(;;) {
try {
Thread.currentThread().sleep(1000);
if (advMsg.get_imgDesc_imgNum() >= DelugeConsts.DELUGE_NUM_IMAGES)
break;
advMsg = DelugeCrc.computeAdvCrc(advMsg);
send(advMsg);
if (verbose) System.out.print(advMsg);
} catch (Exception e) {
e.printStackTrace();
}
}
moteif.deregisterListener(new DelugeAdvMsg(), this);
moteif.deregisterListener(new DelugeDataMsg(), this);
}
public DelugeAdvMsg getPingReply(int imageNum) {
return (DelugeAdvMsg)pingReplies.get(new Integer(imageNum));
}
public TOSBootImage getImage(int imageNum) {
return (TOSBootImage)images.get(new Integer(imageNum));
}
public short getPCAddr() {
return pcAddr;
}
public int getNumImages() {
return curImage;
}
private void send(Message m) {
try {
moteif.send(MoteIF.TOS_BCAST_ADDR, m);
} catch (Exception e) {
e.printStackTrace();
}
}
private void setupNewImage() {
for ( int i = START_PKT; i < START_PKT+END_PKT; i++ )
pktsToReceive[i/8] |= (0x1 << (i%8));
pktsReceived = 0;
curImage++;
advMsg.set_imgDesc_imgNum(curImage);
advMsg = DelugeCrc.computeAdvCrc(advMsg);
send(advMsg);
if (verbose) System.out.print(advMsg);
}
public void messageReceived(int toAddr, Message m) {
// figure out what type of node we're connected to
if (!resolvedNodeType) {
if (toAddr != TOS_UART_ADDR) {
pcAddr = (short)MoteIF.TOS_BCAST_ADDR;
resolvedNodeType = true;
System.out.println("Connected to TOSBase node.");
}
else if (toAddr == TOS_UART_ADDR) {
pcAddr = TOS_UART_ADDR;
resolvedNodeType = true;
System.out.println("Connected to Deluge node.");
}
}
switch(m.amType()) {
case DelugeAdvMsg.AM_TYPE:
DelugeAdvMsg pingReply = (DelugeAdvMsg)m;
int imgNum = pingReply.get_imgDesc_imgNum();
if (pingReplies.get(new Integer(imgNum)) == null) {
pingReplies.put(new Integer(imgNum), pingReply);
if (pingReply.get_imgDesc_numPgsComplete() == 0) {
setupNewImage();
return;
}
}
if (verbose) System.out.print(pingReply);
DelugeReqMsg reqMsg = new DelugeReqMsg();
reqMsg.set_sourceAddr(pcAddr);
reqMsg.set_dest(pingReply.get_sourceAddr());
reqMsg.set_vNum(pingReply.get_imgDesc_vNum());
reqMsg.set_imgNum(pingReply.get_imgDesc_imgNum());
reqMsg.set_pgNum((short)0);
reqMsg.set_requestedPkts(pktsToReceive);
if (verbose) System.out.print(reqMsg);
send(reqMsg);
break;
case DelugeDataMsg.AM_TYPE:
DelugeDataMsg dataMsg = (DelugeDataMsg)m;
short pktNum = dataMsg.get_pktNum();
if (verbose) System.out.print(dataMsg);
pingReply = (DelugeAdvMsg)pingReplies.get(new Integer(curImage));
if (pingReply == null
|| dataMsg.get_vNum() != pingReply.get_imgDesc_vNum()
|| dataMsg.get_imgNum() != curImage
|| dataMsg.get_pgNum() != 0
|| dataMsg.get_pktNum() >= DelugeConsts.DELUGE_PKTS_PER_PAGE)
return;
if ((pktsToReceive[pktNum/8] & (0x1 << (pktNum%8))) != 0) {
pktsToReceive[pktNum/8] &= ~(0x1 << (pktNum%8));
System.arraycopy(dataMsg.get_data(), 0, imageData,
pktNum*DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE,
DelugeConsts.DELUGE_PKT_PAYLOAD_SIZE);
pktsReceived++;
if (pktsReceived >= END_PKT) {
byte[] bytes = new byte[TOSBootImage.METADATA_SIZE];
for ( int i = 0; i < bytes.length; i++ )
bytes[i] = (byte)(imageData[i+256] & 0xff);
images.put(new Integer(curImage), new TOSBootImage(bytes));
setupNewImage();
}
}
break;
}
}
}
--- NEW FILE: Rebooter.java ---
// $Id: Rebooter.java,v 1.1 2005/01/17 19:48:18 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
import net.tinyos.message.*;
import net.tinyos.util.*;
import java.io.*;
import java.util.*;
public class Rebooter implements MessageListener {
private MoteIF moteif;
private boolean verbose;
private DelugeAdvMsg pingReply;
private TOSBootImage newImage;
private short pcAddr;
private short newVersion;
private boolean rebootAcked = false;
private DelugeAdvMsg advMsg = new DelugeAdvMsg();
public Rebooter(DelugeAdvMsg pingReply, TOSBootImage newImage,
short pcAddr, MoteIF moteif, boolean verbose) {
this.pingReply = pingReply;
this.newImage = newImage;
this.pcAddr = pcAddr;
this.moteif = moteif;
this.verbose = verbose;
this.moteif.registerListener(new DelugeAdvMsg(), this);
newVersion = (short)((short)pingReply.get_nodeDesc_vNum() + (short)1);
if (newVersion == DelugeConsts.DELUGE_INVALID_VNUM)
newVersion = 0;
}
public void reboot() {
if (pingReply.get_imgDesc_imgNum() != 0) {
if (pingReply.get_imgDesc_numPgs() != pingReply.get_imgDesc_numPgsComplete()) {
System.out.println("ERROR: Cannot reboot to an incomplete image.");
System.exit(0);
}
else if (pingReply.get_imgDesc_numPgs() == 0) {
System.out.println("ERROR: Cannot reboot to an empty image.");
System.exit(0);
}
}
System.out.println("Reboot to image:");
TOSBootImage image = newImage;
System.out.println(" Image: " + pingReply.get_imgDesc_imgNum());
System.out.println(image);
System.out.print("Continue operation? (y/[n]) " );
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try {
for (;;) {
String ans = in.readLine();
ans = ans.toLowerCase();
if (ans.equals("") || ans.equals("n") || ans.equals("no")) {
System.out.println("Operation canceled.");
System.exit(0);
}
if (ans.equals("y") || ans.equals("yes"))
break;
System.out.print("Please enter yes or no: ");
}
} catch (IOException e) {
e.printStackTrace();
}
advMsg.set_sourceAddr(pcAddr);
advMsg.set_version(DelugeConsts.DELUGE_VERSION);
advMsg.set_type((short)DelugeConsts.DELUGE_ADV_PC);
advMsg.set_nodeDesc_vNum(newVersion);
advMsg.set_nodeDesc_imgNum(pingReply.get_imgDesc_imgNum());
advMsg.set_imgDesc_vNum(DelugeConsts.DELUGE_INVALID_VNUM);
advMsg.set_imgDesc_imgNum(pingReply.get_imgDesc_imgNum());
System.out.println("Sending reboot message ...");
while(!rebootAcked) {
try {
advMsg = DelugeCrc.computeAdvCrc(advMsg);
send(advMsg);
if (verbose) System.out.print(advMsg);
if (advMsg.get_nodeDesc_vNum() == newVersion) {
advMsg.set_nodeDesc_vNum(DelugeConsts.DELUGE_INVALID_VNUM);
advMsg.set_nodeDesc_imgNum(DelugeConsts.DELUGE_INVALID_IMGNUM);
}
else {
advMsg.set_nodeDesc_vNum(newVersion);
advMsg.set_nodeDesc_imgNum(pingReply.get_imgDesc_imgNum());
}
Thread.currentThread().sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
private void send(Message m) {
try {
moteif.send(MoteIF.TOS_BCAST_ADDR, m);
} catch (Exception e) {
e.printStackTrace();
}
}
public void messageReceived(int to, Message m) {
DelugeAdvMsg rxAdvMsg = (DelugeAdvMsg)m;
if (verbose) System.out.print(rxAdvMsg);
if (newVersion == rxAdvMsg.get_nodeDesc_vNum()) {
System.out.println("Reboot message sent.");
rebootAcked = true;
}
}
}
--- NEW FILE: TOSBootImage.java ---
// $Id: TOSBootImage.java,v 1.1 2005/01/17 19:48:18 jwhui Exp $
/* tab:2
*
*
* "Copyright (c) 2000-2004 The Regents of the University of California.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
*
*/
/**
* @author Jonathan Hui <jwhui at cs.berkeley.edu>
*/
package net.tinyos.deluge;
import java.io.*;
import java.lang.*;
import java.util.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
public class TOSBootImage {
public final static int METADATA_SIZE = 128;
private final static int STRING_SIZE = 16;
private final static int SIZE_SIZE = 4;
private final static int UNIX_TIME_SIZE = 4;
private final static int USER_HASH_SIZE = 4;
private String name; // 16
private String userid; // 16
private String hostname; // 16
private int size; // 4
private long unixTime; // 4
private long userHash; // 4
private IhexReader image;
TOSBootImage(String filename) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = factory.newDocumentBuilder();
Document doc = parser.parse(filename);
String tmp;
NodeList nlist=doc.getElementsByTagName("program_name");
name = nlist.item(0).getFirstChild().getNodeValue();
nlist=doc.getElementsByTagName("unix_time");
tmp = nlist.item(0).getFirstChild().getNodeValue();
unixTime = Long.parseLong(tmp.substring(0,tmp.indexOf('L')),16);
nlist=doc.getElementsByTagName("user_id");
userid = nlist.item(0).getFirstChild().getNodeValue();
nlist=doc.getElementsByTagName("hostname");
hostname = nlist.item(0).getFirstChild().getNodeValue();
nlist=doc.getElementsByTagName("user_hash");
tmp = nlist.item(0).getFirstChild().getNodeValue();
userHash = Long.parseLong(tmp.substring(0,tmp.indexOf('L')),16);
nlist=doc.getElementsByTagName("image");
String imageStr = nlist.item(0).getFirstChild().getNodeValue();
image = new IhexReader(imageStr);
} catch (Exception e) {
e.printStackTrace();
}
}
TOSBootImage(byte[] bytes) {
int curOffset = 0;
byte tmpBytes[] = new byte[STRING_SIZE];
for ( int i = 0; i < STRING_SIZE; i++ )
tmpBytes[i] = (byte)(bytes[curOffset++] & 0xff);
name = new String(tmpBytes);
if (name.indexOf('\0') != -1)
name = name.substring(0, name.indexOf('\0'));
for ( int i = 0; i < STRING_SIZE; i++ )
tmpBytes[i] = (byte)(bytes[curOffset++] & 0xff);
userid = new String(tmpBytes);
if (userid.indexOf('\0') != -1)
userid = userid.substring(0, userid.indexOf('\0'));
if (userid.length() == 0)
userid = "N/A";
for ( int i = 0; i < STRING_SIZE; i++ )
tmpBytes[i] = (byte)(bytes[curOffset++] & 0xff);
hostname = new String(tmpBytes);
if (hostname.indexOf('\0') != -1)
hostname = hostname.substring(0, hostname.indexOf('\0'));
if (hostname.length() == 0)
hostname = "N/A";
unixTime = 0;
for ( int i = 0; i < UNIX_TIME_SIZE; i++ )
unixTime |= (long)(bytes[curOffset++] & 0xff) << (i*8);
userHash = 0;
for ( int i = 0; i < USER_HASH_SIZE; i++ )
userHash |= (long)(bytes[curOffset++] & 0xff) << (i*8);
}
public byte[] getBytes() {
byte bytes[] = new byte[METADATA_SIZE + image.getSize()];
int curOffset = 0;
byte tmpBytes[] = name.getBytes();
System.arraycopy(tmpBytes, 0, bytes, curOffset, tmpBytes.length);
curOffset += STRING_SIZE;
tmpBytes = userid.getBytes();
System.arraycopy(tmpBytes, 0, bytes, curOffset, tmpBytes.length);
curOffset += STRING_SIZE;
tmpBytes = hostname.getBytes();
System.arraycopy(tmpBytes, 0, bytes, curOffset, tmpBytes.length);
curOffset += STRING_SIZE;
for ( int i = 0; i < 4; i++ )
bytes[curOffset++] = (byte)((unixTime >> (8*i)) & 0xff);
for ( int i = 0; i < 4; i++ )
bytes[curOffset++] = (byte)((userHash >> (8*i)) & 0xff);
System.arraycopy(image.getBytes(), 0, bytes, METADATA_SIZE, image.getSize());
return bytes;
}
public boolean equalTo(TOSBootImage cmp) {
return (name.compareTo(cmp.getName()) == 0
&& unixTime == cmp.getUnixTime()
&& userHash == cmp.getUserHash());
}
public String toString() {
Date date = new Date(unixTime*1000);
return (" Prog Name: " + name + "\n" +
" Compiled On: " + date + "\n" +
" User ID: " + userid + "\n" +
" Hostname: " + hostname + "\n" +
" User Hash: 0x" + Long.toHexString(userHash));
}
public String getName() { return name; }
public int getSize() { return size; }
public long getUnixTime() { return unixTime; }
public long getUserHash() { return userHash; }
}
Index: Deluge.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/delugetools/Deluge.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Deluge.java 26 Nov 2004 18:59:11 -0000 1.3
--- Deluge.java 17 Jan 2005 19:48:14 -0000 1.4
***************
*** 1,5 ****
// $Id$
! /* tab:4
*
*
--- 1,5 ----
// $Id$
! /* tab:2
*
[...1366 lines suppressed...]
! System.out.println("ERROR: Unknown mode.");
! break;
}
! System.out.println("--------------------------------------------------");
! System.out.println("DONE!");
}
public static void main(String[] args) {
! Deluge deluge = new Deluge(args);
! deluge.execute();
! System.exit(0);
}
- Previous message: [Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Deluge/TestDeluge/GoldenImage
GoldenImage.nc, NONE, 1.1 GoldenImageM.nc, NONE, 1.1 Makefile,
1.1, 1.2 GoldenImageWriter.nc, 1.1, NONE GoldenImageWriterM.nc,
1.3, NONE
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge README.txt, 1.17,
1.18
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-beta-commits
mailing list