]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
problems with beacon timer init, eliminate dead code. problems reported by Islam...
authorgnawali <gnawali>
Sun, 11 Apr 2010 23:26:35 +0000 (23:26 +0000)
committergnawali <gnawali>
Sun, 11 Apr 2010 23:26:35 +0000 (23:26 +0000)
tos/lib/net/ctp/CtpRoutingEngineP.nc

index 4657a00f20ccffc96657bcd4079e827f207a80b0..eb9eddc43ac3a4dad0b59e15c45a0119d67bded6 100644 (file)
@@ -157,6 +157,16 @@ implementation {
     error_t routingTableUpdateEntry(am_addr_t, am_addr_t , uint16_t);
     error_t routingTableEvict(am_addr_t neighbor);
 
+
+
+  /* 
+     For each interval t, you set a timer to fire between t/2 and t
+     (chooseAdvertiseTime), and you wait until t (remainingInterval). Once
+     you are at t, you double the interval (decayInterval) if you haven't
+     reached the max. For reasons such as topological inconsistency, you
+     reset the timer to a small value (resetInterval).
+  */
+
     uint32_t currentInterval = minInterval;
     uint32_t t; 
     bool tHasPassed;
@@ -166,7 +176,6 @@ implementation {
        t /= 2;
        t += call Random.rand32() % t;
        tHasPassed = FALSE;
-       call BeaconTimer.stop();
        call BeaconTimer.startOneShot(t);
     }
 
@@ -230,7 +239,6 @@ implementation {
             uint16_t nextInt;
             nextInt = call Random.rand16() % BEACON_INTERVAL;
             nextInt += BEACON_INTERVAL >> 1;
-            call BeaconTimer.startOneShot(nextInt);
         }
     }