From: gnawali Date: Mon, 9 Apr 2007 15:34:34 +0000 (+0000) Subject: allow etx for a bad parent to grow if no pkts were received since the last update X-Git-Tag: tinyos/2.0.1~85 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=534d2d7ae42380d6721ec14327b7f1108f10ae9b;p=tinyos-2.x.git allow etx for a bad parent to grow if no pkts were received since the last update --- diff --git a/tos/lib/net/le/LinkEstimatorP.nc b/tos/lib/net/le/LinkEstimatorP.nc index 58ab66c6..ebfa4430 100644 --- a/tos/lib/net/le/LinkEstimatorP.nc +++ b/tos/lib/net/le/LinkEstimatorP.nc @@ -246,14 +246,15 @@ implementation { if (ne->data_success == 0) { // if there were no successful packet transmission in the - // last window, assign a large EETX estimate - estETX = LARGE_EETX_VALUE; + // last window, our current estimate is the number of failed + // transmissions + estETX = (ne->data_total - 1)* 10; } else { estETX = (10 * ne->data_total) / ne->data_success - 10; + ne->data_success = 0; + ne->data_total = 0; } updateEETX(ne, estETX); - ne->data_success = 0; - ne->data_total = 0; }