X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=tos%2Flib%2Fnet%2Fctp%2FCtpRoutingEngineP.nc;h=fb8aad78ff98ca9fba238a9c897b96cbd710185f;hb=618c63a3bd6752cdd94d8511ffecaac79499283a;hp=5c6faeb01ef3a4e360d0f4563f847cbd7abb882a;hpb=c30f108c7c4050474b24cfc63e67720b6b1b38c5;p=tinyos-2.x.git diff --git a/tos/lib/net/ctp/CtpRoutingEngineP.nc b/tos/lib/net/ctp/CtpRoutingEngineP.nc index 5c6faeb0..fb8aad78 100644 --- a/tos/lib/net/ctp/CtpRoutingEngineP.nc +++ b/tos/lib/net/ctp/CtpRoutingEngineP.nc @@ -555,23 +555,23 @@ implementation { command void CtpInfo.triggerRouteUpdate() { // Random time in interval 64-127ms - uint16_t time = call Random.rand16(); - time &= 0x3f; - time += 64; + uint16_t beaconDelay = call Random.rand16(); + beaconDelay &= 0x3f; + beaconDelay += 64; if (call BeaconTimer.gett0() + call BeaconTimer.getdt() - - call BeaconTimer.getNow() >= time) { + call BeaconTimer.getNow() >= beaconDelay) { call BeaconTimer.stop(); - call BeaconTimer.startOneShot(time); + call BeaconTimer.startOneShot(beaconDelay); } } command void CtpInfo.triggerImmediateRouteUpdate() { // Random time in interval 4-11ms - uint16_t time = call Random.rand16(); - time &= 0x7; - time += 4; + uint16_t beaconDelay = call Random.rand16(); + beaconDelay &= 0x7; + beaconDelay += 4; call BeaconTimer.stop(); - call BeaconTimer.startOneShot(time); + call BeaconTimer.startOneShot(beaconDelay); } command void CtpInfo.setNeighborCongested(am_addr_t n, bool congested) {