[radio] rename CcaEnabled to CsmaCaEnabled (#2844)

This commit is contained in:
Jonathan Hui
2018-07-02 10:44:09 -05:00
committed by GitHub
parent 31698ecaf7
commit 30222e8538
6 changed files with 22 additions and 18 deletions
+1 -1
View File
@@ -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]);
}
+4 -4
View File
@@ -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;
/**
+1 -1
View File
@@ -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();
+9 -5
View File
@@ -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)
+3 -3
View File
@@ -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).
+4 -4
View File
@@ -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
/**