I am confused by the following code in CC2420TransmitP.nc (T2):
 
void attemptSend() {
       bool congestion = TRUE;
...
1     status = m_cca ? call STXONCCA.strobe() : call STXON.strobe();
2     if ( !( status & CC2420_STATUS_TX_ACTIVE ) ) {
3           status = call SNOP.strobe();
4       if ( status & CC2420_STATUS_TX_ACTIVE )
5          congestion = FALSE;
6      }
7     atomic m_state = congestion ? S_SAMPLE_CCA : S_SFD;

8     call CSN.set();

9    if ( congestion ) {
      releaseSpiResource();
      congestionBackoff();
    }
#ifdef PLATFORM_MICAZ
    else {
      startBackoffTimer(CC2420_ABORT_PERIOD);
    }
#endif

}

questions:
line 2,3: if RF transmission is not active, why use line 3 to detect status again?
To my understanding, congestion means channel busy. So if I can turn on RF transmission, it means no congestion, am I right?
 
line 9 & below: no matter congestion or not, micaz will do backoff. This looks wield. Really?
 
--
Regards,
Tie
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to