[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/receive CC2420ReceiveP.nc, 1.7, 1.8
dmm
rincon at users.sourceforge.net
Wed May 14 14:33:09 PDT 2008
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/receive
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv351/receive
Modified Files:
CC2420ReceiveP.nc
Log Message:
* Removed hardware address recognition to monitor its affect on unit tests, low power listening reliability, and ack reliability in general.
* Implemented software-based address recognition in ReceiveP.
* Applied Steve Dawson-Haggerty's patch to make the RadioBackoff interface parameterized by AM ID only at the top of the stack, whiich allows stack modifications that do not support AM ID's to exist below the active message layer.
Index: CC2420ReceiveP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/receive/CC2420ReceiveP.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** CC2420ReceiveP.nc 18 Jan 2008 18:36:00 -0000 1.7
--- CC2420ReceiveP.nc 14 May 2008 21:33:07 -0000 1.8
***************
*** 38,41 ****
--- 38,43 ----
#include "IEEE802154.h"
+ #include "message.h"
+ #include "AM.h"
module CC2420ReceiveP {
***************
*** 108,111 ****
--- 110,114 ----
void waitForNextPacket();
void flush();
+ bool passesAddressCheck(message_t *msg);
task void receiveDone_task();
***************
*** 327,333 ****
metadata->lqi = buf[ rxFrameLength ] & 0x7f;
metadata->rssi = buf[ rxFrameLength - 1 ];
! m_p_rx_buf = signal Receive.receive( m_p_rx_buf, m_p_rx_buf->data,
! rxFrameLength );
!
atomic receivingPacket = FALSE;
waitForNextPacket();
--- 330,339 ----
metadata->lqi = buf[ rxFrameLength ] & 0x7f;
metadata->rssi = buf[ rxFrameLength - 1 ];
!
! if(passesAddressCheck(m_p_rx_buf)) {
! m_p_rx_buf = signal Receive.receive( m_p_rx_buf, m_p_rx_buf->data,
! rxFrameLength );
! }
!
atomic receivingPacket = FALSE;
waitForNextPacket();
***************
*** 433,435 ****
--- 439,453 ----
}
+ /**
+ * @return TRUE if the given message passes address recognition
+ */
+ bool passesAddressCheck(message_t *msg) {
+ cc2420_header_t *header = call CC2420PacketBody.getHeader( msg );
+
+ if(!(call CC2420Config.isAddressRecognitionEnabled())) {
+ return TRUE;
+ }
+
+ return (header->dest == call CC2420Config.getShortAddr());
+ }
}
More information about the Tinyos-2-commits
mailing list