Hi All,
I would like to send one packet/sec and after sending 1000 packet I
want to change the period  to be 2 seconds and send again 1000
packets.
I am not sure where I have to put the the second call to
startPeriodc(2048) if it is the right thing to do!!
Is it possible to call startDone event in the middle of the code? what
do you think about the following:

......
int counter; //to count the packets

event void AMControl.startDone(error_t err) {
    if (err == SUCCESS&& counter >0) {
      call Timer0.startPeriodic(1024);
    }
  else  if (err == SUCCESS && counter <1000) {
        call Timer0.startPeriodic(2048);
   }
.......
  }
  event void Timer0.fired() {
  // send the packet
   }

  event void AMSend.sendDone(message_t* msg, error_t err) {
}
Thanks
  Sara
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to