You should use Random.rand() function which returns a 32 bit random value.
But the sequence of random values is always the same because the
Random.init() function
(that you must call before using Random.rand()) is seeded with
TOS_LOCAL_ADDRESS.
You can modify Random.init() to seed generator with, for example, the
system time
to get MORE RANDOM values.

L Tony wrote:

> Hi,
>
> I want to use a random time in Timer, such as
>
> command result_t StdControl.start() {
> return call Timer.start(TIMER_ONE_SHOT, random time)
> }
> ....
> event result_t Timer.fired(){
> ....}
>
> Is there anybody know how to realize it? Thanks!
>
> Best regards
> Tony
>
> _________________________________________________________________
> 免费下载 MSN Explorer: http://explorer.msn.com/lccn/
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to