Hi, I think there is a mistake in my previous email, t should be within [currentInterval / 2, currentInterval], sorry about that.
But I'm still not sure What "tHasPassed" means. Can anyone helps with that? On Fri, Feb 4, 2011 at 12:15 PM, Xiaohui Liu <[email protected]> wrote: > Hi everyone, > > In CTP router, I have the following questions regarding the adaptive > beaconing, please see comments inline. > > void chooseAdvertiseTime() { > t = currentInterval; > t /= 2; > t += call Random.rand32() % t; * // t is within > [currentInterval / 2, currentInterval * 3 / 2]* > tHasPassed = FALSE; > call BeaconTimer.stop(); > call BeaconTimer.startOneShot(t); > } > > void remainingInterval() { > uint32_t remaining = currentInterval; > remaining -= t; * //overflow if t is > within (currentInterval, currentInterval * 3 / 2]. **Will this overflow > occur? Is it desired?* > tHasPassed = TRUE; > call BeaconTimer.startOneShot(remaining); > } > > * > * > > event void BeaconTimer.fired() { > if (radioOn && running) { > if (!tHasPassed) { *//What does > "tHasPassed" mean? What's it's function?* > post updateRouteTask(); //always send the most up to date info > post sendBeaconTask(); > dbg("RoutingTimer", "Beacon timer fired at %s\n", > sim_time_string()); > remainingInterval(); > } > else { > decayInterval(); > } > } > } > > Thanks in advance. > -- > -Xiaohui Liu > -- -Xiaohui Liu
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
