[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge DelugeM.nc, 1.20, 1.21 DelugeMsgs.h, 1.5, 1.6

Jonathan Hui jwhui at users.sourceforge.net
Wed Jun 22 15:38:26 PDT 2005


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

Modified Files:
	DelugeM.nc DelugeMsgs.h 
Log Message:
Provide some feedback when Deluge is not enabled.



Index: DelugeM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/DelugeM.nc,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** DelugeM.nc	21 Jun 2005 23:34:31 -0000	1.20
--- DelugeM.nc	22 Jun 2005 22:38:08 -0000	1.21
***************
*** 205,209 ****
        pMsg->sourceAddr = TOS_LOCAL_ADDRESS;
        pMsg->version = DELUGE_VERSION;
!       pMsg->type = DELUGE_ADV_NORMAL;
        memcpy(&pMsg->nodeDesc, &nodeDesc, sizeof(DelugeNodeDesc));
        memcpy(&pMsg->imgDesc, imgDesc, sizeof(DelugeImgDesc));
--- 205,209 ----
        pMsg->sourceAddr = TOS_LOCAL_ADDRESS;
        pMsg->version = DELUGE_VERSION;
!       pMsg->type = (state == S_ENABLED) ? DELUGE_ADV_NORMAL : DELUGE_ADV_ERROR;
        memcpy(&pMsg->nodeDesc, &nodeDesc, sizeof(DelugeNodeDesc));
        memcpy(&pMsg->imgDesc, imgDesc, sizeof(DelugeImgDesc));
***************
*** 266,271 ****
      bool isEqual = FALSE;
  
!     if (state != S_ENABLED
! 	|| rxAdvMsg->version != DELUGE_VERSION
  	|| !call Metadata.isImgDescValid(&(rxAdvMsg->imgDesc))
  	|| !isNodeDescValid(&rxAdvMsg->nodeDesc))
--- 266,270 ----
      bool isEqual = FALSE;
  
!     if (rxAdvMsg->version != DELUGE_VERSION
  	|| !call Metadata.isImgDescValid(&(rxAdvMsg->imgDesc))
  	|| !isNodeDescValid(&rxAdvMsg->nodeDesc))
***************
*** 285,288 ****
--- 284,290 ----
      }
  
+     if (state != S_ENABLED)
+       return pMsg;
+ 
      // don't listen to advertisements about the golden image
      //   unless it's from the PC and source address is TOS_UART_ADDR
***************
*** 303,309 ****
        }
        // image is smaller
!       else if (imgNum != DELUGE_GOLDEN_IMAGE_NUM
! 	       && cmpImgDesc->numPgsComplete < curImgDesc->numPgsComplete) {
! 	advTimers[imgNum-1].newAdvs = DELUGE_NUM_NEWDATA_ADVS_REQUIRED;
        }      
        // image is the same
--- 305,311 ----
        }
        // image is smaller
!       else if (cmpImgDesc->numPgsComplete < curImgDesc->numPgsComplete) {
! 	if (imgNum != DELUGE_GOLDEN_IMAGE_NUM)
! 	  advTimers[imgNum-1].newAdvs = DELUGE_NUM_NEWDATA_ADVS_REQUIRED;
        }      
        // image is the same

Index: DelugeMsgs.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/DelugeMsgs.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** DelugeMsgs.h	21 Jun 2005 23:34:31 -0000	1.5
--- DelugeMsgs.h	22 Jun 2005 22:38:08 -0000	1.6
***************
*** 40,51 ****
  
  enum {
!   AM_DELUGEADVMSG       = 161,
!   AM_DELUGEREQMSG       = 162,
!   AM_DELUGEDATAMSG      = 163,
  };
  
  enum {
!   DELUGE_ADV_NORMAL    = 0,
!   DELUGE_ADV_PC        = 1,
  };
  
--- 40,52 ----
  
  enum {
!   AM_DELUGEADVMSG  = 161,
!   AM_DELUGEREQMSG  = 162,
!   AM_DELUGEDATAMSG = 163,
  };
  
  enum {
!   DELUGE_ADV_NORMAL = 0,
!   DELUGE_ADV_PC     = 1,
!   DELUGE_ADV_ERROR  = 2,
  };
  



More information about the Tinyos-beta-commits mailing list