On Wed, Jul 30, 2008 at 10:55 AM, ram kishore <[EMAIL PROTECTED]> wrote:
> Hi all, > > When ever a packet is received, an event ReceiveMsg.receive(TOS_MsgPtr > Msg) is generated.Can I detect this in some other event for example in > send.senddone() event,so that I can perform alternative task.How to > detect it? First I'm not sure what problem you are trying to solve. The description you give above sounds complicated. If I understand correctly from the event handler for send.senddone you want to check to see if a message was received and do something else. Is that correct? If so it seems simpler to let the different handlers handler their one thing. Just an aside. events are signaled from another module and as such are pieces of static code. As such there isn't a way to detect an event in another event. That said your alternative sounds like it might work but it depends on what kind of events, async or not, are being used. And as soon as you start mixing async stuff and wanting it to interact with a task level event things get complicated quickly. eric An alternative to this may be using conditional variables.I declare a > global variable "flag" as "false".Keep performing some task in > senddone() event.when a packet is received,receive event generated > will set the flag as "true", then I will stop doing task in senddone() > event.Will this work? > > > Best Regards, > Kishore > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- Eric B. Decker Senior (over 50 :-) Researcher Autonomous Systems Lab Jack Baskin School of Engineering UCSC
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
