Hello all,

I'm looking at the implementation of CC2420TransmitP and there are quite a
few places I do not fully understand even with the inline comments. If you
can help me comprehend any of them, I'm greatly indebted. Thanks in advance
and look forward to your clarification.

1.
void attemptSend() {
...
  call CSN.clr();
  *status = m_cca ? call STXONCCA.strobe() : call STXON.strobe();*
  if ( !( status & CC2420_STATUS_TX_ACTIVE ) ) {
    //why check status twice? congestion means after strobe STXON or
STXONCCA, packet is not sent, am I right? Under what condition will
congestion happen?
    *status = call SNOP.strobe();*
    if ( status & CC2420_STATUS_TX_ACTIVE ) {
      congestion = FALSE;
    }
  }
...
}

2.
async event void CaptureSFD.captured( uint16_t time ) {
...
   //What does this command do?
    call CaptureSFD.captureFallingEdge();
...
   //What does this command do and what does its return value mean?
        if ( call SFD.get() ) {
          break;
        }
}

3.
What does the boolean variable *m_receiving* represent? Whether the SFD is
caused by packet reception or transmission?

4.
  async event void BackoffTimer.fired() {
    atomic {
      switch( m_state ) {

      case S_SAMPLE_CCA :
        // sample CCA and wait a little longer if free, just in case we
        // sampled during the ack turn-around window
        //what is ack turn-around here and why do we have to wait even
channel is clear?
        if ( call CCA.get() ) {
          m_state = S_BEGIN_TRANSMIT;
          call BackoffTimer.start( CC2420_TIME_ACK_TURNAROUND );

        } else {
          congestionBackoff();
        }

-- 
-Xiaohui Liu
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to