From 534d2d7ae42380d6721ec14327b7f1108f10ae9b Mon Sep 17 00:00:00 2001 From: gnawali Date: Mon, 9 Apr 2007 15:34:34 +0000 Subject: [PATCH] allow etx for a bad parent to grow if no pkts were received since the last update --- tos/lib/net/le/LinkEstimatorP.nc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } -- 2.39.2