[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Drip/tools Drip.java, 1.2, 1.3

Gilman Tolle gtolle at users.sourceforge.net
Wed Feb 16 17:26:14 PST 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/Drip/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15573/tools

Modified Files:
	Drip.java 
Log Message:
Final test of Drip, completed README.

Index: Drip.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/tools/Drip.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Drip.java	15 Feb 2005 06:46:23 -0000	1.2
--- Drip.java	17 Feb 2005 01:26:12 -0000	1.3
***************
*** 25,29 ****
    int sendCount = 0;
  
!   Timer trickle = new Timer();
  
    MoteIF moteIF;
--- 25,29 ----
    int sendCount = 0;
  
!   Timer trickle;
  
    MoteIF moteIF;
***************
*** 46,49 ****
--- 46,50 ----
  
    public synchronized void send(Message msg, int msgSize) {
+     trickle = new Timer();
      dripMsg = new DripMsg(DripMsg.DEFAULT_MESSAGE_SIZE + msgSize);
      dripMsg.dataSet(msg.dataGet(), 0, dripMsg.offset_data(0),
***************
*** 66,77 ****
    public void run() {
  
!     if (hasMessage) {
! 
!       sendCount++;
  
!       if (sendCount > 6) {
! 	sendDone();
!       }
  	
        if (sendCount > 5 && seqno == DripConsts.DRIP_SEQNO_OLDEST) {
  	seqno = DripConsts.DRIP_SEQNO_NEWEST;
--- 67,79 ----
    public void run() {
  
!     sendCount++;
  
!     if (sendCount > 6) {
!       trickle.cancel();
!       sendDone();
!     }
  	
+     if (hasMessage) {
+ 
        if (sendCount > 5 && seqno == DripConsts.DRIP_SEQNO_OLDEST) {
  	seqno = DripConsts.DRIP_SEQNO_NEWEST;
***************
*** 142,154 ****
      
    public static void main(String[] args) {
!     String period = "1000";
      if (args.length > 0)
!       period = args[0];
  
      Drip drip = new Drip(254);
      TestDripMsg msg = new TestDripMsg();
!     msg.set_data((short)Integer.parseInt(period));
  
      drip.send(msg, TestDripMsg.DEFAULT_MESSAGE_SIZE);
    }
  }
--- 144,157 ----
      
    public static void main(String[] args) {
!     String data = "1000";
      if (args.length > 0)
!       data = args[0];
  
      Drip drip = new Drip(254);
      TestDripMsg msg = new TestDripMsg();
!     msg.set_data((short)Integer.parseInt(data));
  
      drip.send(msg, TestDripMsg.DEFAULT_MESSAGE_SIZE);
+     System.exit(0);
    }
  }



More information about the Tinyos-beta-commits mailing list