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.

协议栈初始化的时候设置了 autoACK,为什么接收的时候还有ack的事?

如下macMcuInit函数已经MAC_RADIO_TURN_ON_AUTO_ACK();

rxStartIsr函数下的三个函数分别是什么意思?

MAC_RADIO_TX_ACK_PEND();

MAC_RADIO_TX_ACK();

MAC_RADIO_REQUEST_ACK_TX_DONE_CALLBACK();

MAC_RX_FLAG_ACK_PENDING 是什么意思?

MAC_INTERNAL_API void macMcuInit(void)

{

……

/* Turn on autoack */
MAC_RADIO_TURN_ON_AUTO_ACK();

……

}

static void rxStartIsr(void)

……

/*-------------------------------------------------------------------------------
* Process any ACK request.
*/
if (macRxOutgoingAckFlag)
{
halIntState_t s;

/*
* This critical section ensures that the callback ISR is initiated within time
* to guarantee correlation with the strobe.
*/
HAL_ENTER_CRITICAL_SECTION(s);

/* Do not ack data packet with pending more data */
if( MAC_FRAME_TYPE(&rxBuf[1]) == MAC_FRAME_TYPE_COMMAND )
{

……

}

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);
}

}