[Tinyos-beta-commits]
CVS: tinyos-1.x/beta/Drain/tools/java/net/tinyos/drain
Drain.java, 1.6, 1.7
Kamin Whitehouse
kaminw at users.sourceforge.net
Thu Jul 7 13:29:34 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/beta/Drain/tools/java/net/tinyos/drain
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2906/tools/java/net/tinyos/drain
Modified Files:
Drain.java
Log Message:
fixed to drain tool to work with tossim by allowing one to change the spaddress and the linksource
Index: Drain.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drain/tools/java/net/tinyos/drain/Drain.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Drain.java 5 Jul 2005 22:02:41 -0000 1.6
--- Drain.java 7 Jul 2005 20:29:32 -0000 1.7
***************
*** 29,32 ****
--- 29,33 ----
public int count = 1;
public boolean forever = false;
+ public boolean usingTosBase = true;
public int treeInstance = (int)((double)Math.random() * (double)255);
***************
*** 59,66 ****
children.add(new Integer(0));
- beaconMsg.set_linkSource(spAddr);
beaconMsg.set_treeInstance((byte)treeInstance);
beaconMsg.set_source(spAddr);
beaconMsg.set_parent(0xffff);
beaconMsg.set_cost(0);
beaconMsg.set_ttl(ttl);
--- 60,72 ----
children.add(new Integer(0));
beaconMsg.set_treeInstance((byte)treeInstance);
beaconMsg.set_source(spAddr);
beaconMsg.set_parent(0xffff);
+ if (usingTosBase){
+ beaconMsg.set_linkSource(spAddr);
+ }
+ else {
+ beaconMsg.set_linkSource(0x7e);
+ }
beaconMsg.set_cost(0);
beaconMsg.set_ttl(ttl);
***************
*** 249,254 ****
--- 255,267 ----
} else if (opt.equals("c")) {
drain.count = Integer.parseInt(args[++i]);
+ } else if (opt.equals("a")) {
+ drain.spAddr = Integer.parseInt(args[++i]);
+ } else if (opt.equals("b")) {
+ drain.usingTosBase = Boolean.valueOf(args[++i]).booleanValue();
} else if (opt.equals("n")) {
drain.forever = true;
+ } else if (opt.equals("s")) {
+ drain.spAddr = 0xfffe;
+ drain.usingTosBase = false;
} else if (opt.equals("h")) {
usage();
***************
*** 268,271 ****
--- 281,287 ----
System.err.println(" -c <number of beacons to transmit>");
System.err.println(" -n : Keep rebuilding the tree forever");
+ System.err.println(" -b <true|false> : TOSBase is connected or not");
+ System.err.println(" -a <spAddress> : the address of the root (default=0)");
+ System.err.println(" -s : Using with tossim (equivalent to '-b false -a 0xfffe'");
System.err.println(" -h, --help : This message.");
System.exit(1);
More information about the Tinyos-beta-commits
mailing list