Hi everybody,
I also have something unclear about CC2420ReceiveP. I'm truly grateful if
you can help me understand.
async event void RXFIFO.readDone( uint8_t* rx_buf, uint8_t rx_len, error_t
error ) {
...
switch( m_state ) {
case S_RX_LENGTH:
m_state = S_RX_FCF;
if ( rxFrameLength + 1 > m_bytes_left ) {
// Length of this packet is bigger than the RXFIFO, flush it out.
flush();
} else {
//what is the checking of FIFO and FIFOP pin for here?
if ( !call FIFO.get() && !call FIFOP.get() ) {
m_bytes_left -= rxFrameLength + 1;
}
...
// CSn flippage cuts off our FIFO; SACK and begin reading again
//Why is CSn flippage necessary here? why cannot SACK strobe be
sent directly without CSn flippage?
call CSN.set();
call CSN.clr();
call SACK.strobe();
call CSN.set();
call CSN.clr();
...
}
On Tue, Aug 30, 2011 at 12:38 AM, Xiaohui Liu <[email protected]> wrote:
> 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
>
--
-Xiaohui Liu
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help