[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Drip Drip.h, 1.5, 1.6 DripM.nc, 1.7, 1.8 DripStateM.nc, 1.6, 1.7

Gilman Tolle gtolle at users.sourceforge.net
Thu Aug 18 23:22:47 PDT 2005


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

Modified Files:
	Drip.h DripM.nc DripStateM.nc 
Log Message:
Added a new special seqno to Drip: DRIP_SEQNO_UNKNOWN. Drip used to boot up with standard seqno 2, which may be greater or may be less than a normal seqno. If a node rebooted to seqno 2, it could possibly overwrite the whole network if 2 happens to be larger than the network's current state. Now, nodes boot up with DRIP_SEQNO_UNKNOWN, which won't be copied by any node, and can only be overwritten by another node's number. Java tools have been changed to match.

Index: Drip.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/Drip.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Drip.h	15 Jul 2005 22:23:18 -0000	1.5
--- Drip.h	19 Aug 2005 06:22:44 -0000	1.6
***************
*** 65,69 ****
  
    DRIP_SEQNO_NEWEST = 0,
!   DRIP_SEQNO_FIRST = 2,
    DRIP_TIMER_PERIOD = 100,
    DRIP_MIN_SEND_INTERVAL = 0,
--- 65,70 ----
  
    DRIP_SEQNO_NEWEST = 0,
!   DRIP_SEQNO_UNKNOWN = 2,
!   DRIP_SEQNO_FIRST = DRIP_SEQNO_UNKNOWN, //DRIP_SEQNO_OLDEST, //2,
    DRIP_TIMER_PERIOD = 100,
    DRIP_MIN_SEND_INTERVAL = 0,

Index: DripM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/DripM.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DripM.nc	15 Jul 2005 22:23:19 -0000	1.7
--- DripM.nc	19 Aug 2005 06:22:45 -0000	1.8
***************
*** 129,133 ****
      if (!msgBufBusy)
        return FAIL;
!     
      call DripState.fillMetadata[id](&dripMsg->metadata);
  
--- 129,133 ----
      if (!msgBufBusy)
        return FAIL;
! 
      call DripState.fillMetadata[id](&dripMsg->metadata);
  
***************
*** 145,148 ****
--- 145,149 ----
        call DripState.entrySent[id]();
      } else {
+       dbg(DBG_USR1, "DripM: radio busy\n");
        msgBufBusy = FALSE;
      }
***************
*** 154,160 ****
  				  result_t success) {
  
!     if (pMsg == &msgBuf &&
! 	msgBufBusy == TRUE) {
!       
        msgBufBusy = FALSE;      
      }
--- 155,160 ----
  				  result_t success) {
  
! //    if (pMsg == &msgBuf &&
!     if (msgBufBusy == TRUE) {
        msgBufBusy = FALSE;      
      }
***************
*** 166,172 ****
  					result_t success) {
      
!     if (pMsg == &msgBuf &&
! 	msgBufBusy == TRUE) {
!       
        msgBufBusy = FALSE;      
      }
--- 166,171 ----
  					result_t success) {
      
! //    if (pMsg == &msgBuf &&
!     if (msgBufBusy == TRUE) {
        msgBufBusy = FALSE;      
      }

Index: DripStateM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drip/DripStateM.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DripStateM.nc	15 Jul 2005 22:23:19 -0000	1.6
--- DripStateM.nc	19 Aug 2005 06:22:45 -0000	1.7
***************
*** 113,117 ****
  	   ||
  	   ((dripEntry->metadata.seqno & ~DRIP_WAKEUP_BIT) == 
! 	    DRIP_SEQNO_NEWEST)) {
        dripEntry->metadata.seqno++;
        dripEntry->metadata.seqno++;
--- 113,121 ----
  	   ||
  	   ((dripEntry->metadata.seqno & ~DRIP_WAKEUP_BIT) == 
! 	    DRIP_SEQNO_NEWEST) 
! 	   ||
! 	   ((dripEntry->metadata.seqno & ~DRIP_WAKEUP_BIT) == 
! 	    DRIP_SEQNO_UNKNOWN))
!     {
        dripEntry->metadata.seqno++;
        dripEntry->metadata.seqno++;
***************
*** 132,138 ****
      uint8_t currentSeqno = dripEntry->metadata.seqno & ~DRIP_WAKEUP_BIT;
   
!     if (incomingSeqno != DRIP_SEQNO_OLDEST && 
! 	((int8_t)(incomingSeqno - currentSeqno) > 0 ||
! 	 incomingSeqno == DRIP_SEQNO_NEWEST)) {
        
        /* my entry is older. save new data. */
--- 136,147 ----
      uint8_t currentSeqno = dripEntry->metadata.seqno & ~DRIP_WAKEUP_BIT;
   
!     if ((currentSeqno == DRIP_SEQNO_UNKNOWN &&
! 	 incomingSeqno != DRIP_SEQNO_UNKNOWN &&
! 	 incomingSeqno != DRIP_SEQNO_OLDEST) ||
! 	(currentSeqno != DRIP_SEQNO_UNKNOWN &&
! 	 incomingSeqno != DRIP_SEQNO_UNKNOWN &&
! 	 incomingSeqno != DRIP_SEQNO_OLDEST &&
! 	 ((int8_t)(incomingSeqno - currentSeqno) > 0 ||
! 	  incomingSeqno == DRIP_SEQNO_NEWEST))) {
        
        /* my entry is older. save new data. */
***************
*** 162,166 ****
        return TRUE;
        
!     } else if ((int8_t)(incomingSeqno - currentSeqno) == 0 && 
  	       incomingSeqno != DRIP_SEQNO_OLDEST) {
        
--- 171,175 ----
        return TRUE;
        
!     } else if (((int8_t)(incomingSeqno - currentSeqno) == 0) && 
  	       incomingSeqno != DRIP_SEQNO_OLDEST) {
        



More information about the Tinyos-beta-commits mailing list