mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 14:47:46 +00:00
[radio] rename CcaEnabled to CsmaCaEnabled (#2844)
This commit is contained in:
@@ -343,7 +343,7 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
|
||||
nrf_802154_channel_set(aFrame->mChannel);
|
||||
|
||||
if (aFrame->mInfo.mTxInfo.mIsCcaEnabled)
|
||||
if (aFrame->mInfo.mTxInfo.mCsmaCaEnabled)
|
||||
{
|
||||
nrf_802154_transmit_csma_ca_raw(&aFrame->mPsdu[-1]);
|
||||
}
|
||||
|
||||
@@ -124,10 +124,10 @@ typedef struct otRadioFrame
|
||||
*/
|
||||
struct
|
||||
{
|
||||
uint8_t mMaxTxAttempts; ///< Max number of transmit attempts for an outbound frame.
|
||||
bool mIsARetx : 1; ///< Set to true if this frame is a retransmission. Should be ignored by radio driver.
|
||||
bool mIsCcaEnabled : 1; ///< Set to true if CCA must be enabled for this packet. False otherwise.
|
||||
const uint8_t *mAesKey; ///< The key used for frame encryption and authentication (AES CCM).
|
||||
uint8_t mMaxTxAttempts; ///< Max number of transmit attempts for an outbound frame.
|
||||
bool mIsARetx : 1; ///< True if this frame is a retransmission (ignored by radio driver).
|
||||
bool mCsmaCaEnabled : 1; ///< Set to true to enable CSMA-CA for this packet, false otherwise.
|
||||
const uint8_t *mAesKey; ///< The key used for AES-CCM frame security.
|
||||
} mTxInfo;
|
||||
|
||||
/**
|
||||
|
||||
@@ -230,7 +230,7 @@ otError LinkRaw::Transmit(otRadioFrame *aFrame, otLinkRawTransmitDone aCallback)
|
||||
#endif // OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_CSMA_BACKOFF
|
||||
if (aFrame->mInfo.mTxInfo.mIsCcaEnabled)
|
||||
if (aFrame->mInfo.mTxInfo.mCsmaCaEnabled)
|
||||
{
|
||||
// Start the transmission backoff logic
|
||||
StartCsmaBackoff();
|
||||
|
||||
@@ -1027,6 +1027,12 @@ void Mac::StartCsmaBackoff(void)
|
||||
// If the radio supports CSMA back off logic, immediately schedule the send.
|
||||
BeginTransmit();
|
||||
}
|
||||
#if OPENTHREAD_CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT
|
||||
else if (mTransmitAttempts == (sendFrame.GetMaxTxAttempts() - 1))
|
||||
{
|
||||
BeginTransmit();
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
uint32_t backoffExponent = kMinBE + mTransmitAttempts + mCsmaAttempts;
|
||||
@@ -1137,17 +1143,15 @@ void Mac::BeginTransmit(void)
|
||||
|
||||
VerifyOrExit(mEnabled, error = OT_ERROR_ABORT);
|
||||
|
||||
#if OPENTHREAD_CONFIG_DISABLE_CCA_ON_LAST_ATTEMPT
|
||||
|
||||
// Disable CCA for the last attempt
|
||||
#if OPENTHREAD_CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT
|
||||
if (mTransmitAttempts == (sendFrame.GetMaxTxAttempts() - 1))
|
||||
{
|
||||
sendFrame.SetIsCcaEnabled(false);
|
||||
sendFrame.SetCsmaCaEnabled(false);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sendFrame.SetIsCcaEnabled(true);
|
||||
sendFrame.SetCsmaCaEnabled(true);
|
||||
}
|
||||
|
||||
if (mCsmaAttempts == 0 && mTransmitAttempts == 0)
|
||||
|
||||
@@ -1030,12 +1030,12 @@ public:
|
||||
void SetDidTx(bool aDidTx) { mDidTx = aDidTx; }
|
||||
|
||||
/**
|
||||
* This method sets the CCA enabled attribute.
|
||||
* This method sets the CSMA-CA enabled attribute.
|
||||
*
|
||||
* @param[in] aIsCcaEnabled TRUE if CCA must be enabled for this packet, FALSE otherwise.
|
||||
* @param[in] aCsmaCaEnabled TRUE if CSMA-CA must be enabled for this packet, FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
void SetIsCcaEnabled(bool aIsCcaEnabled) { mInfo.mTxInfo.mIsCcaEnabled = aIsCcaEnabled; }
|
||||
void SetCsmaCaEnabled(bool aCsmaCaEnabled) { mInfo.mTxInfo.mCsmaCaEnabled = aCsmaCaEnabled; }
|
||||
|
||||
/**
|
||||
* This method returns the key used for frame encryption and authentication (AES CCM).
|
||||
|
||||
@@ -1605,13 +1605,13 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DISABLE_CCA_ON_LAST_ATTEMPT
|
||||
* @def OPENTHREAD_CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT
|
||||
*
|
||||
* Define as 1 to disable CCA on the last transmit attempt
|
||||
* Define as 1 to disable CSMA-CA on the last transmit attempt
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DISABLE_CCA_ON_LAST_ATTEMPT
|
||||
#define OPENTHREAD_CONFIG_DISABLE_CCA_ON_LAST_ATTEMPT 0
|
||||
#ifndef OPENTHREAD_CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT
|
||||
#define OPENTHREAD_CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user