This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How long will CSMA & Data-Poll waiting cost?

Other Parts Discussed in Thread: Z-STACK, CC2530

When a EndDevice Send a Data-Poll(MAC Data-Request) to Parent-Nod to receive data,it will be in CSMA status.How long will CSMA cost?As I how CSMA waiting is a random time,I want to know the time range.

After send Data-Poll to Parent,the EndDevice will wait for Parent's Data.How long will it wait?Will the Parent send to EndDevice by CSMA too?

  • Hello Aries,

    The CSMA is implemented as per the 802.15.4 specification in Z-Stack. On an average a good number for CSMA-CA will be about ~1msec. 

    The end device after it receives the MAC ACK with pending bit set can wait upto ~19msec according to the IEEE 802.15.4 spec,. Yes, the parent will send the data using the CSMA-CA. 

    Hope this helps. 

    Regards

  • As my understanding that follow Ur discrib discribing,the EndDevice will stay in Rx-On status for 1~19ms by random(that meaning by luck,and bad-luck will cost 19ms*28mA power).

    By I have test on Osilloscope.When a EndDevice receives the MAC ACK of Data-Poll,and the Parent FFD have no data to send to EndDevice,the EndDevice will sleep as soon as quick.

  • Yes,I have found Ack-Pending bit can be control by PENDING_OR bit of  FRMCTRL1.

    But I have found another question,the "MAC_RADIO_TX_ACK_PEND" is set at rxStartIsr.When this status,CC2530 have only received 6 bytes(read 4bytes),that can't  judge what this packet is.It only can be judged this packet's type.

        if( MAC_FRAME_TYPE(&rxBuf[1]) == MAC_FRAME_TYPE_COMMAND )
        {
          if( macRxCheckMACPendingCallback())
          {
            /* Check is any mac data pending for end devices */
            ackWithPending = MAC_RX_FLAG_ACK_PENDING;
          }
          else
          {
            if( macSrcMatchIsEnabled )
            {
              /* When autopend is enabled, check if allpending is set to true */
              if( MAC_SrcMatchCheckAllPending() == MAC_AUTOACK_PENDING_ALL_ON )
              {
                ackWithPending = MAC_RX_FLAG_ACK_PENDING;
              }
            }
            else
            {
              /* When autopend is disabled, check the application pending callback */
              if( macRxCheckPendingCallback() )
              {
                ackWithPending = MAC_RX_FLAG_ACK_PENDING;
              }
            }
          }
        }
    
        if( ackWithPending == MAC_RX_FLAG_ACK_PENDING )
        {
          MAC_RADIO_TX_ACK_PEND();
        }
        else
        {
          MAC_RADIO_TX_ACK();
        }
    
    
        /* request a callback to macRxAckTxDoneCallback() when the ACK transmit has finished */
        MAC_RADIO_REQUEST_ACK_TX_DONE_CALLBACK();
        HAL_EXIT_CRITICAL_SECTION(s);
      }

    Like these code,I feel that the once FFD receive RFD's CMD type packet,it will enable  PENDING_OR bit.

    Then,I have found under code in "rxFcsIsr".

        if ((pRxBuf->internal.flags & MAC_RX_FLAG_ACK_PENDING) && (*pRxBuf->msdu.p != MAC_DATA_REQ_FRAME))
        {
          /* For non-data request commands, cancel the pending bit in the ACK. */
          MAC_RADIO_TX_ACK();
        }

    but,I can,t understand this logic is wrong.If the received packet is MAC_DATA_REQ,but FFD have no data to this RFD,the "&&" should be "||".