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

Omprakash Gnawali gnawali at users.sourceforge.net
Thu Mar 12 22:13:31 PDT 2009


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/net/le
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15778/le

Modified Files:
	LinkEstimatorP.nc 
Log Message:
trunc->round as suggested out by Andreas Kopke, and one other trunc->round

Index: LinkEstimatorP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/net/le/LinkEstimatorP.nc,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** LinkEstimatorP.nc	4 Jun 2008 05:45:20 -0000	1.15
--- LinkEstimatorP.nc	13 Mar 2009 05:13:29 -0000	1.16
***************
*** 253,257 ****
    // also called when new DEETX estimate is done
    void updateEETX(neighbor_table_entry_t *ne, uint16_t newEst) {
!     ne->eetx = (ALPHA * ne->eetx + (10 - ALPHA) * newEst)/10;
    }
  
--- 253,257 ----
    // also called when new DEETX estimate is done
    void updateEETX(neighbor_table_entry_t *ne, uint16_t newEst) {
!     ne->eetx = (ALPHA * ne->eetx + (10 - ALPHA) * newEst + 5)/10;
    }
  
***************
*** 342,347 ****
  	    } else {
  	      newEst = (255 * ne->rcvcnt) / totalPkt;
! 	      dbg("LI,LITest", "  %hu: %hhu -> %hhu", ne->ll_addr, ne->inquality, (ALPHA * ne->inquality + (10-ALPHA) * newEst)/10);
! 	      ne->inquality = (ALPHA * ne->inquality + (10-ALPHA) * newEst)/10;
  	    }
  	    ne->rcvcnt = 0;
--- 342,347 ----
  	    } else {
  	      newEst = (255 * ne->rcvcnt) / totalPkt;
! 	      dbg("LI,LITest", "  %hu: %hhu -> %hhu", ne->ll_addr, ne->inquality, (ALPHA * ne->inquality + (10-ALPHA) * newEst + 5)/10);
! 	      ne->inquality = (ALPHA * ne->inquality + (10-ALPHA) * newEst + 5)/10;
  	    }
  	    ne->rcvcnt = 0;



More information about the Tinyos-2-commits mailing list