[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/receive CC2420ReceiveP.nc, 1.13, 1.14

David Gay idgay at users.sourceforge.net
Mon Jun 23 16:40:41 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/receive
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21037/receive

Modified Files:
	CC2420ReceiveP.nc 
Log Message:
fix misuse of interface

Index: CC2420ReceiveP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/receive/CC2420ReceiveP.nc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** CC2420ReceiveP.nc	23 Jun 2008 20:25:15 -0000	1.13
--- CC2420ReceiveP.nc	23 Jun 2008 23:40:21 -0000	1.14
***************
*** 327,340 ****
      cc2420_metadata_t* metadata = call CC2420PacketBody.getMetadata( m_p_rx_buf );
      cc2420_header_t* header = call CC2420PacketBody.getHeader( m_p_rx_buf);
      uint8_t tmpLen __DEPUTY_UNUSED__ = sizeof(message_t) - (offsetof(message_t, data) - sizeof(cc2420_header_t));
      uint8_t* COUNT(tmpLen) buf = TCAST(uint8_t* COUNT(tmpLen), header);
      
!     metadata->crc = buf[ rxFrameLength ] >> 7;
!     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 );
      }
      
--- 327,341 ----
      cc2420_metadata_t* metadata = call CC2420PacketBody.getMetadata( m_p_rx_buf );
      cc2420_header_t* header = call CC2420PacketBody.getHeader( m_p_rx_buf);
+     uint8_t length = header->length;
      uint8_t tmpLen __DEPUTY_UNUSED__ = sizeof(message_t) - (offsetof(message_t, data) - sizeof(cc2420_header_t));
      uint8_t* COUNT(tmpLen) buf = TCAST(uint8_t* COUNT(tmpLen), header);
      
!     metadata->crc = buf[ length ] >> 7;
!     metadata->lqi = buf[ length ] & 0x7f;
!     metadata->rssi = buf[ length - 1 ];
      
      if(passesAddressCheck(m_p_rx_buf)) {
        m_p_rx_buf = signal Receive.receive( m_p_rx_buf, m_p_rx_buf->data, 
! 					   length - CC2420_SIZE);
      }
      



More information about the Tinyos-2-commits mailing list