mirror of
https://github.com/espressif/openthread.git
synced 2026-10-12 02:37:37 +00:00
[style] prettier CSL comments and logs (#5431)
Mostly renaming 'Csl' to 'CSL', and some other minor changes.
This commit is contained in:
@@ -230,7 +230,7 @@ typedef struct otRadioFrame
|
||||
uint8_t mMaxFrameRetries; ///< Maximum number of retries allowed after a transmission failure.
|
||||
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.
|
||||
bool mCslPresent : 1; ///< Set to true if CSL header ie is present.
|
||||
bool mCslPresent : 1; ///< Set to true if CSL header IE is present.
|
||||
bool mIsSecurityProcessed : 1; ///< True if SubMac should skip the AES processing of this frame.
|
||||
} mTxInfo;
|
||||
|
||||
|
||||
@@ -2270,7 +2270,7 @@ otError Mac::AppendHeaderIe(bool aIsTimeSync, TxFrame &aFrame) const
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aIsTimeSync);
|
||||
|
||||
const size_t kMaxNumHeaderIe = 3; // TimeSync + Csl + Termination2
|
||||
const size_t kMaxNumHeaderIe = 3; // TimeSync + CSL + Termination2
|
||||
HeaderIe ieList[kMaxNumHeaderIe];
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint8_t ieCount = 0;
|
||||
|
||||
@@ -220,9 +220,9 @@ public:
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
/**
|
||||
* This method requests `Mac` to start a Csl Tx operation after a delay of @p aDelay time.
|
||||
* This method requests `Mac` to start a CSL tx operation after a delay of @p aDelay time.
|
||||
*
|
||||
* @param[in] aDelay Delay time for `Mac` to start a Csl Tx, in units of milliseconds.
|
||||
* @param[in] aDelay Delay time for `Mac` to start a CSL tx, in units of milliseconds.
|
||||
*
|
||||
*/
|
||||
void RequestCslFrameTransmission(uint32_t aDelay);
|
||||
@@ -754,7 +754,7 @@ public:
|
||||
* This method updates frame control field.
|
||||
*
|
||||
* If the frame would contain header IEs, IE present field would be set.
|
||||
* If this is a csl transmission frame or header IE is present in this frame,
|
||||
* If this is a CSL transmission frame or header IE is present in this frame,
|
||||
* the version should be set to 2015. Otherwise, the version would be set to 2006.
|
||||
*
|
||||
* @param[in] aNeighbor A pointer to the destination device, could be `nullptr`.
|
||||
|
||||
@@ -862,7 +862,7 @@ void SubMac::SetCslPeriod(uint16_t aPeriod)
|
||||
}
|
||||
}
|
||||
|
||||
otLogDebgMac("Csl Period: %u", mCslPeriod);
|
||||
otLogDebgMac("CSL Period: %u", mCslPeriod);
|
||||
|
||||
exit:
|
||||
return;
|
||||
|
||||
@@ -587,7 +587,7 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* Csl state, always updated by `mCslTimer`.
|
||||
* CSL state, always updated by `mCslTimer`.
|
||||
*
|
||||
*/
|
||||
enum CslState : uint8_t{
|
||||
|
||||
@@ -414,14 +414,14 @@ public:
|
||||
otError Receive(uint8_t aChannel) { return otPlatRadioReceive(GetInstance(), aChannel); }
|
||||
|
||||
/**
|
||||
* This method updates the csl sample time in radio.
|
||||
* This method updates the CSL sample time in radio.
|
||||
*
|
||||
* @param[in] aCslSampleTime The csl sample time.
|
||||
* @param[in] aCslSampleTime The CSL sample time.
|
||||
*
|
||||
*/
|
||||
void UpdateCslSampleTime(uint32_t aCslSampleTime) { otPlatRadioUpdateCslSampleTime(GetInstance(), aCslSampleTime); }
|
||||
|
||||
/** This method enables csl sampling in radio.
|
||||
/** This method enables CSL sampling in radio.
|
||||
*
|
||||
* @param[in] aCslPeriod CSL period, 0 for disabling CSL.
|
||||
* @param[in] aExtAddr The extended source address of CSL receiver's parent device (when the platforms
|
||||
|
||||
@@ -58,7 +58,7 @@ inline void CslTxScheduler::Callbacks::HandleSentFrameToChild(const Mac::TxFrame
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
//
|
||||
|
||||
CslTxScheduler::CslTxScheduler(Instance &aInstance)
|
||||
: InstanceLocator(aInstance)
|
||||
, mCslTxChild(nullptr)
|
||||
@@ -102,9 +102,9 @@ void CslTxScheduler::Clear(void)
|
||||
}
|
||||
|
||||
/**
|
||||
* This method always finds the most recent csl tx among all children,
|
||||
* and request `Mac` to do csl tx at specific time. It shouldn't be called
|
||||
* when `Mac` is already starting to do the csl tx (indicated by `mCslTxMessage`).
|
||||
* This method always finds the most recent CSL tx among all children,
|
||||
* and requests `Mac` to do CSL tx at specific time. It shouldn't be called
|
||||
* when `Mac` is already starting to do the CSL tx (indicated by `mCslTxMessage`).
|
||||
*
|
||||
*/
|
||||
void CslTxScheduler::RescheduleCslTx(void)
|
||||
@@ -222,16 +222,16 @@ void CslTxScheduler::HandleSentFrame(const Mac::TxFrame &aFrame, otError aError,
|
||||
case OT_ERROR_NO_ACK:
|
||||
aChild.IncrementCslTxAttempts();
|
||||
|
||||
otLogInfoMac("Csl tx to child %04x failed, attempt %d/%d", aChild.GetRloc16(), aChild.GetCslTxAttempts(),
|
||||
otLogInfoMac("CSL tx to child %04x failed, attempt %d/%d", aChild.GetRloc16(), aChild.GetCslTxAttempts(),
|
||||
kMaxCslTriggeredTxAttempts);
|
||||
|
||||
// Fall through
|
||||
case OT_ERROR_CHANNEL_ACCESS_FAILURE:
|
||||
case OT_ERROR_ABORT:
|
||||
|
||||
// Even if Csl Tx attempts count reaches max, the message won't be
|
||||
// Even if CSL tx attempts count reaches max, the message won't be
|
||||
// dropped until indirect tx attempts count reaches max. So here it
|
||||
// would set sequence number and schedule next csl tx.
|
||||
// would set sequence number and schedule next CSL tx.
|
||||
|
||||
if (!aFrame.IsEmpty())
|
||||
{
|
||||
|
||||
@@ -102,13 +102,13 @@ public:
|
||||
void SetCslLastHeard(TimeMilli aCslLastHeard) { mCslLastHeard = aCslLastHeard; }
|
||||
|
||||
private:
|
||||
uint8_t mCslTxAttempts : 7; ///< Number of csl triggered tx attempts.
|
||||
uint8_t mCslTxAttempts : 7; ///< Number of CSL triggered tx attempts.
|
||||
bool mCslSynchronized : 1; ///< Indicates whether or not the child is CSL synchronized.
|
||||
uint8_t mCslChannel; ///< The channel the device will listen on.
|
||||
uint32_t mCslTimeout; ///< The sync timeout, in seconds.
|
||||
uint16_t mCslPeriod; ///< CSL sampled listening period in units of 10 symbols (160 microseconds).
|
||||
uint16_t mCslPhase; ///< The time when the next CSL sample will start.
|
||||
TimeMilli mCslLastHeard; ///< Time when last frame containing CSL IE heard.
|
||||
TimeMilli mCslLastHeard; ///< Time when last frame containing CSL IE was heard.
|
||||
|
||||
static_assert(kMaxCslTriggeredTxAttempts < (1 << 7), "mCslTxAttempts cannot fit max!");
|
||||
};
|
||||
@@ -163,7 +163,7 @@ public:
|
||||
Child & aChild);
|
||||
};
|
||||
/**
|
||||
* This constructor initializes the csl tx scheduler object.
|
||||
* This constructor initializes the CSL tx scheduler object.
|
||||
*
|
||||
* @param[in] aInstance A reference to the OpenThread instance.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user