[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/net/le LinkEstimatorP.nc, 1.13, 1.14

Omprakash Gnawali gnawali at users.sourceforge.net
Tue Jan 22 10:04:32 PST 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/le
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv6527

Modified Files:
	LinkEstimatorP.nc 
Log Message:
rename INFINITY, only send mature links on the footer, make getlinkquality* calls return VERY_LARGE_EETX if a link is not mature, set alpha=9

Index: LinkEstimatorP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/le/LinkEstimatorP.nc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** LinkEstimatorP.nc	5 Dec 2007 22:43:27 -0000	1.13
--- LinkEstimatorP.nc	22 Jan 2008 18:04:30 -0000	1.14
***************
*** 68,75 ****
      INVALID_RVAL = 0xff,
      INVALID_NEIGHBOR_ADDR = 0xff,
!     INFINITY = 0xff,
      // decay the link estimate using this alpha
      // we use a denominator of 10, so this corresponds to 0.2
!     ALPHA = 2,
      // number of packets to wait before computing a new
      // DLQ (Data-driven Link Quality)
--- 68,77 ----
      INVALID_RVAL = 0xff,
      INVALID_NEIGHBOR_ADDR = 0xff,
!     // if we don't know the link quality, we need to return a value so
!     // large that it will not be used to form paths
!     VERY_LARGE_EETX_VALUE = 0xff,
      // decay the link estimate using this alpha
      // we use a denominator of 10, so this corresponds to 0.2
!     ALPHA = 9,
      // number of packets to wait before computing a new
      // DLQ (Data-driven Link Quality)
***************
*** 131,135 ****
      for (i = 0; i < NEIGHBOR_TABLE_SIZE && j < maxEntries; i++) {
        k = (prevSentIdx + i + 1) % NEIGHBOR_TABLE_SIZE;
!       if (NeighborTable[k].flags & VALID_ENTRY) {
  	footer->neighborList[j].ll_addr = NeighborTable[k].ll_addr;
  	footer->neighborList[j].inquality = NeighborTable[k].inquality;
--- 133,138 ----
      for (i = 0; i < NEIGHBOR_TABLE_SIZE && j < maxEntries; i++) {
        k = (prevSentIdx + i + 1) % NEIGHBOR_TABLE_SIZE;
!       if ((NeighborTable[k].flags & VALID_ENTRY) &&
! 	  (NeighborTable[k].flags & MATURE_ENTRY)) {
  	footer->neighborList[j].ll_addr = NeighborTable[k].ll_addr;
  	footer->neighborList[j].inquality = NeighborTable[k].inquality;
***************
*** 271,279 ****
        q =  2550 / q1 - 10;
        if (q > 255) {
! 	q = INFINITY;
        }
        return (uint8_t)q;
      } else {
!       return INFINITY;
      }
    }
--- 274,282 ----
        q =  2550 / q1 - 10;
        if (q > 255) {
! 	q = VERY_LARGE_EETX_VALUE;
        }
        return (uint8_t)q;
      } else {
!       return VERY_LARGE_EETX_VALUE;
      }
    }
***************
*** 438,445 ****
      idx = findIdx(neighbor);
      if (idx == INVALID_RVAL) {
!       return INFINITY;
      } else {
!       return NeighborTable[idx].eetx;
!     };
    }
  
--- 441,452 ----
      idx = findIdx(neighbor);
      if (idx == INVALID_RVAL) {
!       return VERY_LARGE_EETX_VALUE;
      } else {
!       if (NeighborTable[idx].flags & MATURE_ENTRY) {
! 	return NeighborTable[idx].eetx;
!       } else {
! 	return VERY_LARGE_EETX_VALUE;
!       }
!     }
    }
  
***************
*** 449,456 ****
      idx = findIdx(neighbor);
      if (idx == INVALID_RVAL) {
!       return INFINITY;
      } else {
!       return computeEETX(NeighborTable[idx].inquality);
!     };
    }
  
--- 456,467 ----
      idx = findIdx(neighbor);
      if (idx == INVALID_RVAL) {
!       return VERY_LARGE_EETX_VALUE;
      } else {
!       if (NeighborTable[idx].flags & MATURE_ENTRY) {
! 	return computeEETX(NeighborTable[idx].inquality);
!       } else {
! 	return VERY_LARGE_EETX_VALUE;
!       }
!     }
    }
  
***************
*** 460,467 ****
      idx = findIdx(neighbor);
      if (idx == INVALID_RVAL) {
!       return INFINITY;
      } else {
!       return computeEETX(NeighborTable[idx].outquality);
!     };
    }
  
--- 471,482 ----
      idx = findIdx(neighbor);
      if (idx == INVALID_RVAL) {
!       return VERY_LARGE_EETX_VALUE;
      } else {
!       if (NeighborTable[idx].flags & MATURE_ENTRY) {
! 	return computeEETX(NeighborTable[idx].outquality);
!       } else {
! 	return VERY_LARGE_EETX_VALUE;
!       }
!     }
    }
  



More information about the Tinyos-2-commits mailing list