Hi *

   I have a little problem with Timers. In my application I use two timers 
"JobTimer" and "StopTimer". I send from base station a start signal and 
start the JobTimer with some intervall( let say 1000 ). After that I 
start StopTimer.startOneShot(10000).  So that looks like :

// ... get start signal form BS
   atomic ssBit = TRUE; // StartStopBit
   call SensingControl.startSensing(1000,0); // <- starts sensing ... no 
matter
   startTS = call JobTimer.getNow();  // start timestamp
   call JobTimer.startPeriodic(1000); // start periodic every second
   call StopTimer.startOneShot(10000); // stop after 10 s
// ..................................................

// now fire events:
event void JobTimer.fired() {
                if (!radioBusy && ssBit) {        // if radio is free and ssBit 
true
                        post sendMeasurement(); // send measurement to BS
                }else{                                      // else (read if 
ssBit = 
false
                        sendResult();                   // send result (other 
measurement) to 
BS
                }
        }

event void StopTimer.fired(){
        atomic ssBit = FALSE;                     //set ssBit false
        call SensingControl.stopSensing();  // stop sensing
        call JobTimer.stop();                        // stop JobTimer
        call JobTimer.startOneShot(10);      // start JobTimer once !!!
}

The problem is  when i call JobTimer.startOneShot(10) it start  
JobTimer.startPeriodic(10)!!!  I don't understand this behaviour ?!? Is 
there some study about it? Has somebody observed similary behaviour of 
Timers?

cheers
  Jordan

----------------------------------------------------
Tysiące pomysłów na urządzanie domu, mieszkania, 
ogrodu w jednym miejscu! 
Zobacz jak mógłbyś zamieszkać.
Kliknij: http://klik.wp.pl/?adr=www.dom.wp.pl&sid=419


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

Reply via email to