[Tinyos-devel] Bug in AM.h in T2 release

Philip Levis pal at cs.stanford.edu
Mon Nov 20 12:36:18 PST 2006


On Nov 20, 2006, at 12:09 PM, Joe Polastre wrote:

> FYI,
>
> TOS_AM_ADDRESS will never get updated on a 'make platform reinstall'
> command because it is statically compiled into the app.  See the
> following from AM.h:
>
> #ifndef DEFINED_TOS_AM_ADDRESS
> #define DEFINED_TOS_AM_ADDRESS 1
> #endif
>
> enum {
>  TOS_AM_GROUP = DEFINED_TOS_AM_GROUP,
>  TOS_AM_ADDRESS = DEFINED_TOS_AM_ADDRESS
> };
>
> A quick fix (proposed by Cory) is to #define TOS_AM_ADDRESS to
> directly call the AM.address() function.

This is intentional: you should never be using TOS_AM_ADDRESS, rather  
you should be calling AMPacket.address(). This is for cases when you  
have two radios which might have different AM addresses.  The #define  
will break whenever you have have an "as" on the interface.

Phil


More information about the Tinyos-devel mailing list