> Now, when the report_timer fires, I want to compute a new random value > and set the report_timer period to the new value. > Therefore I wrote in the report_timer.fired() > > call report_timer.startPeriodic( call Random.rand16() % > TIMER_PERIOD_REPORT ); > > I thjink this should be right, or? > The problem is, that the mote stops to send reports after a while > (sometimes > after 10 packets, sometimes after 300 packets) and I don't have any > idea why?!
What happens when you "roll" a zero? Then you'll start the timer at an interval of 0 ms. Not sure how the timer treats that, but it'll either fire as fast as it can, or not at all. Both will probably not do what you want. You may want to use a minimum delay and/or use a one shot timer. HTH, Michiel _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
