Shouldn't the address not be accessed in this way anymore anyway? Is
it not better to wire to the ActiveMessageC component, and access it
through a call to adress() from the AMPacket interface.

In your configuration you would have something like,

configuration AppC {}
implementation {
  components ActiveMessageC as AMRadio;

  MainC.SoftwareInit -> AMRadio;
  App.AMPacket -> AMRadio;
}

your implementation then accesses the address via...

call AMPacket.address()

instead of a direct usage of TOS_LOCAL_ADDRESS or TOS_NODE_ID

Kevin

On 3/9/06, Avinash Sridharan <[EMAIL PROTECTED]> wrote:
> Thanks phil,
>   Will update the CVS and try it out.
> -Avinash
>
>
> On 3/9/06, Philip Levis <[EMAIL PROTECTED] > wrote:
> > On Wed, 2006-03-08 at 23:51 -0800, Avinash Sridharan wrote:
> > > Hi,
> > >  I am starting to use TinyOS 2.x. How do you I get the local address
> > > in TinyOS -2.x. TOS_LOCAL_ADDRESS is not present should I be using
> > > TOS_NODE_ID. The problem is that I am using TOSSIM in TinyOS-2.x and
> > > in code I had used TOS_NODE_ID, but it doesn't get intitalized to the
> > > node id. Since it keeps throwing the value of 1 for all nodes. I tried
> > > TOS_AM_ADDRESS with the same results.
> >
> > This is a bug. I've fixed it in CVS. It required two changes. The first
> > is in sim_tossim.c, where it sets TOS_NODE_ID when you switch nodes. The
> > second is in ActiveMessageAddressC, where it initializes addr to
> > TOS_NODE_ID. The modified functions:
> >
> > void sim_set_node(unsigned long node) __attribute__ ((C, spontaneous)) {
> >   current_node = node;
> >   TOS_NODE_ID = node;
> > }
> >
> >   async command am_addr_t amAddress() {
> >     if (!set) {
> >       addr = TOS_NODE_ID;
> >       set = TRUE;
> >     }
> >     return addr;
> >   }
> >
> > Let me know if you have any other problems,
> >
> > Phil
> >
> >
>
>
>
> --
> Phd Dept. of Electrical Engineering
> University of Southern California
> http://www-scf.usc.edu/~asridhar
> _______________________________________________
> Tinyos-devel mailing list
> [EMAIL PROTECTED]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>
>
>

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to