Hi Phil,
 I was trying to debug the problem, I realised the problem was in my code and hence your changes work just fine. Due to a multitude of code changes I ended up reinitializing the node id's midway during simulation (this was a hack to get around the earlier bug) duh !!. Things are working fine now.

Thanks and regards,
Avinash

On 3/9/06, Avinash Sridharan <[EMAIL PROTECTED]> wrote:
Hi Phil,
 I tried making the code changes you had suggested. I can't check out those specific files and didn't want a complete new source tree to play with, so went ahead and made the appropriate code changes.
 But even now TOS_NODE_ID is always set to 0 ?? It does show the node id of the node properly.
  I was printing out the TOS_NODE_ID in the boot section of my code ?

-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



--
Phd Dept. of Electrical Engineering
University of Southern California
http://www-scf.usc.edu/~asridhar
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to