On 6/10/07, Murtuza <[EMAIL PROTECTED]> wrote:
Hello friends,
I am working on tinyos-2.x and i have a very simple question to ask. Though
I read the TEPs etc I still cant figure out what AMType means. The tutorials
too dont tell what it is. Can anyone tell me what it is?
I want to write a code in which a receiving mote receives data from
different other motes running different codes on them and sending out data
packets which are not identical i.e different messages being sent.
How can I have multiple receive events at the receiver mote. I saw the
BaseStation code and it implements a queue of receive events. But how can I
distinguish between various received messages without looking at the payload
or their IDs. Can I give a separate AMType to different messages coming out
from different motes using AMPacket.setType(). I used this function to set
the type to one of the motes but it did not work. It still sends packets
with type 06. The motes which I use always send out messages with type 06.
Why is it so?
I think what you are looking for is explained is the tutorial.
When you want to send or receive AM messages, you wire your component
to AMSenderC or AMReceiverC, and declare them with something like :
components new AMSenderC(SOMETHING);
The SOMETHING is the AM type of your messages. You must wire the
receiver to AMReceiverC(SOMETHING) to receive the message. You can
send and receive messages on different AM channels by using several
instances of these components.
As for the meaning of the AM type, here is a copy & paste or what I
had written in my dissertation (hopefully it is correct):
The TinyOS link layer relies on Active Messages (AM). Active
Messages are packets that specify a handler ID in their
header. They are called active messages because they trigger
the invokation of the associated handler upon receipt, preempting any
ongoing computation.
Hope it helps,
Romain
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help