[Tinyos-help] BaseStationCC2420 does not act as a sniffer: patch

Alban Hessler alban.mailing at googlemail.com
Tue Jan 30 06:40:30 PST 2007


Hi everyone,

We have found a small bug in the file CC2240ControlP.nc for the
BaseStationCC2420 application of T2.

In order to be a sniffer (that's what BaseStation is according to the
readme), the BaseStation should disable the address filtering of the CC2420.
For that to be done, it must explicitly set the bit to 0 in the registry, as
the default reset value is 1. (datasheet of CC2420, p.65)

So the code to set the configuration register in CC2240ControlP.nc should be
the following:

call MDMCTRL0.write( (( 1 << CC2420_MDMCTRL0_RESERVED_FRAME_MODE ) |
      ( 2 << CC2420_MDMCTRL0_CCA_HYST ) |
      ( 3 << CC2420_MDMCTRL0_CCA_MOD ) |
      ( 1 << CC2420_MDMCTRL0_AUTOCRC ) |
      ( 2 << CC2420_MDMCTRL0_PREAMBLE_LENGTH )) &
      ~( 1 << CC2420_MDMCTRL0_ADR_DECODE));


Notice the added mask at the end of the instruction.

Best Regards,

Alban Hessler & Evgeny Osipov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070130/b370626d/attachment.html


More information about the Tinyos-help mailing list