Vikram,
In general, each instance of the AMSenderC component only supports a
queue of 1 message. So just calling send() twice will likely result in
some failure. I haven't actually tried this myself (nor have easy
access to the code right now), so i don't know if the 2nd send will
return an error or what the exact end result would be.
One way to send two messages is to queue up the first message in the
sendDone() event that is called after the first send() call. You must
be careful to make sure that the sendDone event is for the first message
you sent.
There are queue data structures available in tinyos 2.x so if you wanted
to create your own component, you may want to start from there. It is
also likely that someone else has implemented this feature (for certain
protocols I'm sure it's been implemented, but I don't know of any
generic component that has been built. You may want to check out the
contrib directories in the cvs checkout. Another option is to look at
your platform-specific implementation of AMSenderC and see how it
manages its queue. With some minor modifications, you could create your
own component that supports an arbitrary queue size.
-Paul
On 12/29/2009 12:57 AM, Vikram vik76 wrote:
Hello,
How do I send multiple messages ( say two messages) one after the other?
The send statements in my code are one after the other.
Is there any queuing in tinyos which will take care of this automatically?
Because, when the second message is sent, the first message may still
be using the radio.
Thanks
Regards
Vikram
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help