[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Drain Drain.h, 1.6, 1.7 DrainLinkEstM.nc, 1.7, 1.8

Gilman Tolle gtolle at users.sourceforge.net
Tue Mar 15 18:19:35 PST 2005


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

Modified Files:
	Drain.h DrainLinkEstM.nc 
Log Message:
Bounded the number of retries for reverse-tree join. Added a check for the DrainChildren attribute.

Index: Drain.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drain/Drain.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Drain.h	15 Mar 2005 01:19:13 -0000	1.6
--- Drain.h	16 Mar 2005 02:19:31 -0000	1.7
***************
*** 56,59 ****
--- 56,60 ----
    DRAIN_DIRECTION_UP = 0,
    DRAIN_DIRECTION_DOWN = 1,
+   DRAIN_MAX_REG_ATTEMPTS = 5,
  };
  

Index: DrainLinkEstM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drain/DrainLinkEstM.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DrainLinkEstM.nc	15 Mar 2005 01:52:35 -0000	1.7
--- DrainLinkEstM.nc	16 Mar 2005 02:19:32 -0000	1.8
***************
*** 76,80 ****
  
    uint8_t  regAttempts;
-   uint8_t  timerFires;
    uint8_t  regFires;
  
--- 76,79 ----
***************
*** 150,154 ****
      uint8_t i;
      toAddr = 0;
-     timerFires = 0;
      regFires = 0;
      regAttempts = 0;
--- 149,152 ----
***************
*** 385,390 ****
      DrainRouteEntry *route = &routes[0];
  
-     timerFires++;
-     
      if (route->sentRoute == FALSE) {
        route->sentRoute = TRUE;
--- 383,386 ----
***************
*** 393,396 ****
--- 389,395 ----
      } else {
        regFires++;
+       if (regFires > DRAIN_MAX_REG_ATTEMPTS) {
+ 	call Timer.stop();
+       }
  #ifdef PLATFORM_PC
        if (TOS_LOCAL_ADDRESS != 0)
***************
*** 655,658 ****
--- 654,660 ----
  
    command result_t DrainChildren.get(uint16_t* buf, uint8_t pos) {
+     if (pos >= DRAIN_MAX_CHILDREN) 
+       return FAIL;
+ 
      memcpy(buf, &children[pos], sizeof(uint16_t));
      signal DrainChildren.getDone(buf);



More information about the Tinyos-beta-commits mailing list