We spent a lot of time but are still confused by the following:
 
1) CC2420ReceiveP.nc, in event void RXFIFO.readDone(uint8_t* rx_buf, uint8_t rx_len, error_t error )  
1.1) line 197:
      if ( length > 10 ) {...}    (where length is header[0])
      Q: why use constant 10? Does it mean sizeof(cc2420_header_t)? If so, will it always be true, since length include a 11-byte header and a payload?
 
1.2) line 207,208:
      // pass packet up if crc is good
      if ( ( buf[ length ] >> 7 ) && rx_buf ) {...}
      Q: buf[ length ] is the byte beyond the last byte of header+payload, so why judge on that? and what does it being shift by 7 bits mean? How does this related to crc (see the comment above)
2) in message_t, length=header+payload+footer, right?  But in CC2420TransmitP.nc line 243 is:
      call TXFIFO.write( (uint8_t*)header, header->length - 1 );
    Q: why -1?
 
3) related to (2), in the same file at line 421:  msg_metadata->rssi = ack_buf[ length - 1 ]; while rssi is define as the 2nd field of
typedef nx_struct cc2420_metadata_t {
  nx_uint8_t tx_power;
  nx_uint8_t rssi;
  nx_uint8_t lqi;
  nx_bool crc;
  nx_bool ack;
  nx_uint16_t time;
} cc2420_metadata_t;
So why ack_buf[ length - 1 ] is rssi?
 
These questions really make us blue, can you help us out? Thanks a ton!

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

Reply via email to