Hello,

I am trying to simulate message communication in a network of > 100 nodes.

I have the following code:

...
event void Receive.receive(){
    Timer.startOneShot(x);
}

Timer.fired(){
    Send.send(counter);
}
...

The question is if a node receives another message before Timer fires, will
the Timer start again? Will the node cancel previous send command?

for example,
counter=0;
..
event void Receive.receive(){
    counter++;
    Timer.startOneShot(PERIOD);
}

Timer.fired(){
    Send.send(counter);
}

if a node receives a message the counter is incremented to 1 and the Timer
will be started. Assume that another message is received at time < PERIOD.
Will the node send 1 or 2?

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

Reply via email to