Dear All, my questions are w.r.t to a strange function in CC2420TransmitP.nc, attached below.
 
Questions:
Line 3: why check status again, provided line 1 already got it?
Line 6: if congestion is true, even m_cca==false can enter S_SAMPLE_CCA state, which is wrong.
Line 7: I do not find where the macro PLATFORM_MICAZ is defined.  And, if it is defined, then micaz will always backoff regardless of congestion, which is a bit wield.
 
Thanks in advance for any clarification.
 
  void attemptSend() {

    uint8_t status;
    bool congestion = TRUE;

    call CSN.clr();

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    atomic m_state = congestion ? S_SAMPLE_CCA : S_SFD;

    call CSN.set();

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

  }



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

Reply via email to