Hi, Ryan,
 
It seems work now by deleting that single line.  I wish it won't cause other problems.
Thank you very much for your kind help.
 
Best Regards,
Tie
 
On 10/29/06, Ryan Stinnett <[EMAIL PROTECTED]> wrote:
This is not the issue.  The CC2420 chip performs its own address
decoding.  This is occurs inside that chip, and does not involve any
TinyOS code.  However TinyOS can control whether that feature is
enabled.  If you look at the command CC2420Power.startOscillator() in
CC2420ControlP.nc, you can see the various settings that TinyOS
configures on the chip.  One of the lines is

( 1 << CC2420_MDMCTRL0_ADR_DECODE ) |

which sets a bit in the MDMCTRL0 register to enable the chip's address
decoding.  When this is enabled, the code you included below never
receives packets if they are not for the current node (or being
broadcast).  I believe disabling this feature will get you what you
want.  I suppose the simplest way would be to delete this line, but
really there should be an interface to do so (if there is not already).

Again, the CC2420 datasheet is very helpful, and is located at:
http://www.chipcon.com/files/CC2420_Data_Sheet_1_4.pdf

- Ryan Stinnett

Tie Luo wrote:
> By looking at the source code, I found CC2420 does not do address
> decoding.  The code is as below (in CC2420ReceiveP.nc):
> async event void RXFIFO.readDone( uint8_t* rx_buf, uint8_t rx_len,
> error_t error ) {
> ...
>       // pass packet up if crc is good
>       if ( ( buf[ length ] >> 7 ) && rx_buf ) {
>     uint8_t type = ( header->fcf >> IEEE154_FCF_FRAME_TYPE ) & 7;
>     signal CC2420Receive.receive ( type, m_p_rx_buf );
>     if ( type == IEEE154_TYPE_DATA ) {
>       post receiveDone_task();
>       return;
>     }
> ...
> }
>
> This shows that CC2420 stack forwards all messages to upper layers
> without decoding addresses.
> I am really confused. :(
>
> Tie
>
> On 10/29/06, *Ryan Stinnett* <[EMAIL PROTECTED] <mailto: [EMAIL PROTECTED]>>
> wrote:
>
>     T2's CC2420 radio stack uses the radio's automatic ACK feature, which
>     requires its address decoding feature as well.  The software radio
>     stack
>     supports snooping in that it will pass you packets for which you are not
>     the destination if it gets them from the radio.  However, the default
>     radio configuration does not pass the packets to software at all.  What
>     you need to do is disable the CC2420's address decoding.  Unfortunately,
>     I haven't tried to do this in T2 yet, so I'm not sure how it would be
>     done.  For more information, look at the CC2420 datasheet on Chipcon's
>     website.
>
>     - Ryan Stinnett
>
>     "Tie Luo" <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] >> wrote:
>      >From the last email it appears that CC2420 does provide snooping
>     functionality, doesn't it? If unfortunately, it does not, then how to
>     snoop on micaz? Synchronous ACK is not necessary to us. Really need
>     help. Thanks a lot. Tie On 10/28/06, Tie Luo <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
>      > >
>      > > Thanks.
>      > > But in CC2420ActiveMessageC, Snoop is wired to
>     CC2420ActiveMessageP.snoop,
>      > > and in CC2420ActiveMessageP, it has the following code:
>      > > event message_t* SubReceive.receive(message_t* msg, void* payload,
>     uint8_t
>      > > len) {
>      > >     if (call AMPacket.isForMe(msg)) {
>      > >       return signal Receive.receive[call AMPacket.type(msg)](msg,
>     payload,
>      > > len - CC2420_SIZE);
>      > >     }
>      > >     else {
>      > >       return signal Snoop.receive [call AMPacket.type(msg)](msg,
>     payload,
>      > > len - CC2420_SIZE);
>      > >     }
>      > >   }
>      > > where SubReceive is finally wired to CC2420ReceiveP.receive .
>      > > In CC2420ReceiveP, it has the following code:
>      > > if ( type == IEEE154_TYPE_DATA ) {
>      > >       post receiveDone_task();
>      > >       return;
>      > >     }
>      > > and in receiveDone_task(), Receive.receive is signaled.
>      > >
>      > > All the above means that, no component seems to check the
>     destination
>      > > address unless CC2420ActiveMessageP.  But this component does
>     signal
>      > > Snoop.Receive().
>      > >
>      > > So, why CC2420 is not able to snoop? And, I indeed do not need
>     synchronous
>      > > ACKs.
>      > >
>      > > Tie
>      > >
>      > > On 10/28/06, Philip Levis < [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
>      >> > >
>      >> > > On Oct 27, 2006, at 10:13 PM, Tie Luo wrote:
>      >> > >
>      >>> > > > Dear all,
>      >>> > > >
>      >>> > > > I am using AMSnoopingReceiverC, but the node seems only
>     receive
>      >>> > > > message destined to the node itself, and cannot receive
>     messages
>      >>> > > > for others.
>      >>> > > > I saw in CC2420ActiveMessageC.nc there is a comment:
>      >>> > > > "Note that snooping may not work, due to CC2420 early packet
>      >>> > > > rejection if acknowledgements are enabled."
>      >>> > > > However when I check all relevant files like CC2420CsmaC.nc,
>      >>> > > > CC2420CsmaP.nc, CC2420ReceiveC.nc , CC2420ReceiveP.nc, it
>     appears
>      >>> > > > that the snooping function does get fulfilled.
>      >>> > > >
>      >>> > > > So, does AMSnoopingReceiver really work on micaz? (TinyOS
>     2.x)
>      >>> > > >
>      >>> > > > Dr. Levis, you wrote that comment, may you help on this
>     question?
>      >>> > > > Many thanks!
>      >>> > > >
>      >> > >
>      >> > > You cannot snoop with the default T2 CC2420 stack. If you
>     want to
>      >> > > snoop you have to disabled address decode, which means you do
>     not get
>      >> > > synchronous acks.
>      >> > >
>      >> > > Phil
>      >> > >
>      >> > >
>      > >
>      > >
>      > > --
>      > > Regards,
>      > > Tie
>     _______________________________________________
>     Tinyos-help mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>     <https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >
>
>
>
>
> --
> Regards,
> Tie



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

Reply via email to