[Tinyos-help] how to specify the address of ndoes

Tarun Bansal bansal.tarun at gmail.com
Mon Feb 12 22:00:31 PST 2007


The address of the mote is specified when uploading the program onto
that particular mote.  Check "Device Addressing" section at
http://www.tinyos.net/tinyos-1.x/doc/tutorial/programmers.html

If you are using TOSSIM, then addresses are allocated by default from 0 to N-1

Tarun
http://bansal.tarun.googlepages.com/

On 2/12/07, qin zhao <redmuts at hotmail.com> wrote:
> Hi,
>
> I'm new to TinyOS. I started programming for a simple application with two
> nodes. One is the master and the other one is the slave. My question is that
> how to specify the address of the two nodes. What I did is that I use
> TOS_LOCAL_ADDRESS and compare it's value with 0.
>
> event result_t Timer.fired()
> {
>    if (TOS_LOCAL_ADDRESS == 0)
>     // this is a master, send a beacon
>   else
>     // this is a slave, receive a beacon
> ....
> }
>
> But during debugging with TOSSIM, the value of TOS_LOCAL_ADDRESS is always
> 0. Can someone tell me where is TOS_LOCAL_ADDRESS originally defined? Why it
> is always 0? What are the better ways to implement? Thanks a lot.
>
> Best Regards,
> Redmuts
>
> _________________________________________________________________
> Live Search, for accurate results! http://www.live.nl
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>


More information about the Tinyos-help mailing list