[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Drip/tools/java/net/tinyos/drip Drip.java, 1.7, 1.8

Gilman Tolle gtolle at users.sourceforge.net
Thu Aug 4 20:18:41 PDT 2005


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

Modified Files:
	Drip.java 
Log Message:
Drip.send() no longer attempts to inject the message unreliably after hitting the maximum number of attempts at reliable sending. This was causing messages to be sent twice occasionally, if the new message was injected but the response was never received.

Index: Drip.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/tools/java/net/tinyos/drip/Drip.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Drip.java	16 Jul 2005 21:24:13 -0000	1.7
--- Drip.java	5 Aug 2005 03:18:39 -0000	1.8
***************
*** 55,59 ****
      log.info("Started id=" + id);
      try {
!       moteIF = new MoteIF((Messenger)null);
        moteIF.registerListener(new DripMsg(), this);
      } catch (Exception e) {
--- 55,59 ----
      log.info("Started id=" + id);
      try {
!       moteIF = new MoteIF();
        moteIF.registerListener(new DripMsg(), this);
      } catch (Exception e) {
***************
*** 87,91 ****
  		    msgSize);
      sendCount = 0;
- 
    }
  
--- 87,90 ----
***************
*** 112,115 ****
--- 111,115 ----
      state = PROBING;
      wakeupMsg = false;
+     sendCount = 0;
      maxSendCount = SEND_COUNT;
      trickle.schedule(trickleTask, 0, SEND_RATE);
***************
*** 132,135 ****
--- 132,136 ----
      state = SENDING_NEW;
      wakeupMsg = false;
+     sendCount = 0;
      maxSendCount = 1;
      trickle.schedule(trickleTask, 0, SEND_RATE);
***************
*** 152,155 ****
--- 153,157 ----
      state = SENDING_NEW;
      wakeupMsg = true;
+     sendCount = 0;
      maxSendCount = WAKEUP_SEND_COUNT;
      trickle.schedule(trickleTask, 0, WAKEUP_SEND_RATE);
***************
*** 172,176 ****
        boolean stopSending = false;
  
!       log.debug("DripSender.run()");
  
        dripMsg.set_metadata_id((short)id);
--- 174,178 ----
        boolean stopSending = false;
  
!       log.debug("DripSender.run(state=" + state + " sendCount= " + sendCount + ")");
  
        dripMsg.set_metadata_id((short)id);
***************
*** 183,187 ****
  	} else {
  	  log.debug("probing finished");
- 	  dripMsg.set_metadata_seqno((byte)DripConsts.DRIP_SEQNO_NEWEST);
  	  stopSending = true;
  	}
--- 185,188 ----
***************
*** 193,197 ****
  	} else {
  	  log.debug("sending finished");
- 	  dripMsg.set_metadata_seqno((byte)DripConsts.DRIP_SEQNO_NEWEST);
  	  stopSending = true;
  	}
--- 194,197 ----
***************
*** 201,208 ****
  	  log.debug("sending unreliably");
  	  dripMsg.set_metadata_seqno((byte)DripConsts.DRIP_SEQNO_NEWEST);
! 	  if (sendCount == maxSendCount-1) {
! 	    log.debug("sending unreliably finished");
! 	    stopSending = true;
! 	  }
  	}
  	break;
--- 201,207 ----
  	  log.debug("sending unreliably");
  	  dripMsg.set_metadata_seqno((byte)DripConsts.DRIP_SEQNO_NEWEST);
! 	} else {
! 	  log.debug("sending unreliably finished");
! 	  stopSending = true;
  	}
  	break;
***************
*** 218,229 ****
        }
  
-       log.info("Sending Msg " + sendCount + ": id=" + id + ",seqno=" + dripMsg.get_metadata_seqno());
-       send(dripMsg);
-       sendCount++;
- 
        if (stopSending) {
  	trickle.cancel();
  	trickleTask.cancel();
  	sendDone();
        }
      }
--- 217,228 ----
        }
  
        if (stopSending) {
  	trickle.cancel();
  	trickleTask.cancel();
  	sendDone();
+       } else {
+ 	log.info("Sending Msg " + sendCount + ": id=" + id + ",seqno=" + dripMsg.get_metadata_seqno());
+ 	send(dripMsg);
+ 	sendCount++;
        }
      }



More information about the Tinyos-beta-commits mailing list