[Tinyos-help] How to create an event?
Muhammad Azhar
leo_az_83 at hotmail.com
Tue May 29 20:28:36 PDT 2007
Hi all,
I'm using TinyOS-2.0 and I'd like to create an interface (assume all the
necessary wirings have been done) whereby a certain event will cause a
node's timer to fire periodically for 1s. However, after 1 minute, I'd like
to signal to the application program that 60 seconds have passed. Can I get
some pointers on how I can go about doing this? I am not so sure if it
should look something like this:
=====================================================
module someModuleP {
provides { //all the interfaces it provides }
uses { //all the interfaces it uses }
}
implementation{
//I declare a new event in this module
event void oneMinPassed();
..............
//from Timer interface
event void TImer.fired(){
...
if(counter%60 == 0) {
signal oneMinPassed();
}
...
}
}
==================================================
Did I miss any step? Many thanks for your help.
Regards,
Azhar
More information about the Tinyos-help
mailing list