X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fnet%2F4bitle%2FLinkEstimatorP.nc;h=fd4ddf302b38e3ea5b01b2833ecb7e43b0e30df0;hb=cf5ec9ed422048c623294bf69aae89c08f96be20;hp=fab06407f1ec817633ae997316fa24f5ab95a5c8;hpb=936b732e4a9e22a0fe4d1d6463a64368011f4779;p=tinyos-2.x.git diff --git a/tos/lib/net/4bitle/LinkEstimatorP.nc b/tos/lib/net/4bitle/LinkEstimatorP.nc index fab06407..fd4ddf30 100644 --- a/tos/lib/net/4bitle/LinkEstimatorP.nc +++ b/tos/lib/net/4bitle/LinkEstimatorP.nc @@ -370,11 +370,6 @@ implementation { if (packetGap > 0) { NeighborTable[idx].failcnt += packetGap - 1; } - if (packetGap > MAX_PKT_GAP) { - NeighborTable[idx].failcnt = 0; - NeighborTable[idx].rcvcnt = 1; - NeighborTable[idx].inquality = 0; - } // The or with packetGap >= BLQ_PKT_WINDOW is needed in case // failcnt gets reset above @@ -384,6 +379,11 @@ implementation { updateNeighborTableEst(NeighborTable[idx].ll_addr); } + if (packetGap > MAX_PKT_GAP) { + initNeighborIdx(idx, NeighborTable[idx].ll_addr); + NeighborTable[idx].lastseq = seq; + NeighborTable[idx].rcvcnt = 1; + } }