reset_state();
m_state = S_STARTED;
atomic receivingPacket = FALSE;
+ /* Note:
+ We use the falling edge because the FIFOP polarity is reversed.
+ This is done in CC2420Power.startOscillator from CC2420ControlP.nc.
+ */
call InterruptFIFOP.enableFallingEdge();
}
return SUCCESS;
if(rxFrameLength <= MAC_PACKET_SIZE) {
if(rxFrameLength > 0) {
- if(rxFrameLength >= CC2420_SIZE) {
+ if(rxFrameLength > SACK_HEADER_LENGTH) {
// This packet has an FCF byte plus at least one more byte to read
call RXFIFO.continueRead(buf + 1, SACK_HEADER_LENGTH);
metadata->lqi = buf[ length ] & 0x7f;
metadata->rssi = buf[ length - 1 ];
- if(passesAddressCheck(m_p_rx_buf)) {
+ if (passesAddressCheck(m_p_rx_buf) && length >= CC2420_SIZE) {
m_p_rx_buf = signal Receive.receive( m_p_rx_buf, m_p_rx_buf->data,
length - CC2420_SIZE);
}