You can check the node id of the source at the receiver in the following way :

1. assign address at compile time : make install.1 mica2 ...... , will assign 
    address    1 to the node being programmed.
2. The address parameter can be accessed using 
    TOS_LOCAL_ADDRESS/TOSH_LOCAL_ADDRESS . Assign this value in the 
    address field of the TOS_Msg which you transmit to the base.
     TOS_Msgexample->addr = TOSH_LOCAL_ADDRESS.
3. at the receiver in the receive event check for the node address.

The above steps have been tested with TinyOS 1.x for mica2 and cricket hardware 
with XP and work fine.
For accessing the fields within received messages check OscilloscopeRF code for 
radio communication. Information on the TOS_Msg  structure can be found in 
cygwin\opt\tinyos-1.x\tos\types\AM.h file.

Hope this helps,
Aneeket.


Message: 1
Date: Wed, 21 Nov 2007 06:27:53 -0800 (PST)
From: Sourabh Shah <[EMAIL PROTECTED]>
Subject: [Tinyos-help] accesssing source address in main
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Hello all

I want to access source address in main at base station. Can any one
 tell me how can I do that. I couldnt get much info about cracking
 received packet and accessing  Node id  of  source  node.  The thing  is  I
  want  to  receive  messages  from  specific  nodes  at  some  instances.


       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to