[Tinyos-help] AMPacket interface

Philip Levis pal at cs.stanford.edu
Wed Feb 13 09:59:30 PST 2008


On Feb 13, 2008, at 9:45 AM, Flavio Pompermaier wrote:

> Hi to all, I've a doubt regard the AMPacket interface: it is useful  
> in order to set AM fields of the Packet, right? However there are 3  
> components that provide this interface: ActiveMessageC, AMSenderC e  
> AMReceiverC. Which should I use? Are they equivalent? Or should I  
> choose one or the other respect to what I'm doing (sending/receiving)?

If you look closely, AMSenderC and AMReceiverC just wire to  
ActiveMessageC's. They provide it as a convenience, so you only have  
to name one component in a configuration. I.e.:

components new AMSenderC(AM_FOO);
A.AMSend -> AMSenderC;
A.AMPacket -> AMSenderC;

rather than

components new AMSenderC(FOO), ActiveMessageC;
A.AMSend -> AMSenderC;
A.AMPacket -> ActiveMessageC;

Phil


More information about the Tinyos-help mailing list