[Tinyos-help] AM source destination stuff

Michael Schippling schip at santafe.edu
Thu Sep 18 21:39:36 PDT 2008


I think you are confusing AMtype and MoteID.
I believe that first arg to the send() should be the MoteID
which is assigned when you install your program, or BCAST
if you don't care what device receives the message.
The AMtype is set by creating your sender and receiver.
It defines the message structure type and thus the block
of code in your program that gets the message.

I think AmSender, etal, may be a TOS2 thing so I can't
help much more. Look at some of the example apps that
use different messages to see how they are defined.

MS


Michael von Hauff wrote:
> I am a bit confused about using the AM addressing
> 
> in my App file I declare a AMSender and Receiver
> 
> components new AMSenderC(AM_TYPE6);
>   components new AMReceiverC(AM_TYPE6);
> 
> 
> 
> then later in my send command I have this
> 
> if (call AMSend.send(AM_TYPE6,
>           &pkt, sizeof(PacketRecombineMsg)) == SUCCESS) {
>         busy = TRUE;
>     call Leds.led0Toggle();
>       }
> 
> 
> but an identical node does not receive the packet.
> 
> It will only receive broadcast packets (i just change the send function 
> to send AM_BROADCAST_ADDRESS)
> 
> So i think I misunderstanding something about the AM stuff.
> 
> 
> any help would be much appreciated!
> 
> 
> Mike.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


More information about the Tinyos-help mailing list