mirror of
https://github.com/espressif/openthread.git
synced 2026-08-01 00:27:47 +00:00
[csl] rename to CslUncertainty (#7690)
This commit is contained in:
@@ -53,7 +53,7 @@ extern "C" {
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (206)
|
||||
#define OPENTHREAD_API_VERSION (207)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
|
||||
@@ -1060,14 +1060,14 @@ void otPlatRadioUpdateCslSampleTime(otInstance *aInstance, uint32_t aCslSampleTi
|
||||
uint8_t otPlatRadioGetCslAccuracy(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Get the current uncertainty, in units of 10 us, of the clock used for scheduling CSL operations.
|
||||
* The fixed uncertainty of the Device for scheduling CSL Transmissions in units of 10 microseconds.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @returns The current CSL Clock Uncertainty in units of 10 us.
|
||||
* @returns The CSL Uncertainty in units of 10 us.
|
||||
*
|
||||
*/
|
||||
uint8_t otPlatRadioGetCslClockUncertainty(otInstance *aInstance);
|
||||
uint8_t otPlatRadioGetCslUncertainty(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Set the max transmit power for a specific channel.
|
||||
|
||||
@@ -473,12 +473,12 @@ public:
|
||||
uint8_t GetCslAccuracy(void);
|
||||
|
||||
/**
|
||||
* Get the current uncertainty, in units of 10 us, of the clock used for scheduling CSL operations.
|
||||
* Get the fixed uncertainty of the Device for scheduling CSL Transmissions in units of 10 microseconds.
|
||||
*
|
||||
* @returns The current CSL Clock Uncertainty in units of 10 us.
|
||||
* @returns The CSL Uncertainty in units of 10 us.
|
||||
*
|
||||
*/
|
||||
uint8_t GetCslClockUncertainty(void);
|
||||
uint8_t GetCslUncertainty(void);
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
|
||||
/**
|
||||
@@ -812,9 +812,9 @@ inline uint8_t Radio::GetCslAccuracy(void)
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
inline uint8_t Radio::GetCslClockUncertainty(void)
|
||||
inline uint8_t Radio::GetCslUncertainty(void)
|
||||
{
|
||||
return otPlatRadioGetCslClockUncertainty(GetInstancePtr());
|
||||
return otPlatRadioGetCslUncertainty(GetInstancePtr());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -981,7 +981,7 @@ inline uint8_t Radio::GetCslAccuracy(void)
|
||||
return UINT8_MAX;
|
||||
}
|
||||
|
||||
inline uint8_t Radio::GetCslClockUncertainty(void)
|
||||
inline uint8_t Radio::GetCslUncertainty(void)
|
||||
{
|
||||
return UINT8_MAX;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ OT_TOOL_WEAK uint8_t otPlatRadioGetCslAccuracy(otInstance *aInstance)
|
||||
return UINT8_MAX;
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK uint8_t otPlatRadioGetCslClockUncertainty(otInstance *aInstance)
|
||||
OT_TOOL_WEAK uint8_t otPlatRadioGetCslUncertainty(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
|
||||
@@ -1556,7 +1556,7 @@ Error Mle::AppendCslClockAccuracy(Message &aMessage)
|
||||
cslClockAccuracy.Init();
|
||||
|
||||
cslClockAccuracy.SetCslClockAccuracy(Get<Radio>().GetCslAccuracy());
|
||||
cslClockAccuracy.SetCslUncertainty(Get<Radio>().GetCslClockUncertainty());
|
||||
cslClockAccuracy.SetCslUncertainty(Get<Radio>().GetCslUncertainty());
|
||||
|
||||
SuccessOrExit(error = aMessage.Append(cslClockAccuracy));
|
||||
|
||||
@@ -3472,7 +3472,7 @@ bool Mle::IsBetterParent(uint16_t aRloc16,
|
||||
{
|
||||
cslMetric = CalcParentCslMetric(aCslClockAccuracy, aCslUncertainty);
|
||||
candidateCslMetric =
|
||||
CalcParentCslMetric(mParentCandidate.GetCslClockAccuracy(), mParentCandidate.GetCslClockUncertainty());
|
||||
CalcParentCslMetric(mParentCandidate.GetCslClockAccuracy(), mParentCandidate.GetCslUncertainty());
|
||||
if (candidateCslMetric != cslMetric)
|
||||
{
|
||||
ExitNow(rval = (cslMetric < candidateCslMetric));
|
||||
@@ -3681,7 +3681,7 @@ void Mle::HandleParentResponse(RxInfo &aRxInfo)
|
||||
mParentCandidate.SetKeySequence(aRxInfo.mKeySequence);
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
mParentCandidate.SetCslClockAccuracy(clockAccuracy.GetCslClockAccuracy());
|
||||
mParentCandidate.SetCslClockUncertainty(clockAccuracy.GetCslUncertainty());
|
||||
mParentCandidate.SetCslUncertainty(clockAccuracy.GetCslUncertainty());
|
||||
#endif
|
||||
|
||||
mParentPriority = connectivity.GetParentPriority();
|
||||
@@ -3809,7 +3809,7 @@ void Mle::HandleChildIdResponse(RxInfo &aRxInfo)
|
||||
mParentCandidate.Clear();
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
Get<Mac::Mac>().SetCslParentUncertainty(mParent.GetCslClockUncertainty());
|
||||
Get<Mac::Mac>().SetCslParentUncertainty(mParent.GetCslUncertainty());
|
||||
Get<Mac::Mac>().SetCslParentClockAccuracy(mParent.GetCslClockAccuracy());
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1365,7 +1365,7 @@ public:
|
||||
Neighbor::Init(aInstance);
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
SetCslClockAccuracy(kCslWorstCrystalPpm);
|
||||
SetCslClockUncertainty(kCslWorstUncertainty);
|
||||
SetCslUncertainty(kCslWorstUncertainty);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1446,15 +1446,15 @@ public:
|
||||
* @returns The CSL clock uncertainty of this router.
|
||||
*
|
||||
*/
|
||||
uint8_t GetCslClockUncertainty(void) const { return mCslClockUncertainty; }
|
||||
uint8_t GetCslUncertainty(void) const { return mCslUncertainty; }
|
||||
|
||||
/**
|
||||
* This method sets the CSL clock uncertainty of this router.
|
||||
*
|
||||
* @param[in] aCslClockUncertainty The CSL clock uncertainty of this router.
|
||||
* @param[in] aCslUncertainty The CSL clock uncertainty of this router.
|
||||
*
|
||||
*/
|
||||
void SetCslClockUncertainty(uint8_t aCslClockUncertainty) { mCslClockUncertainty = aCslClockUncertainty; }
|
||||
void SetCslUncertainty(uint8_t aCslUncertainty) { mCslUncertainty = aCslUncertainty; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -1467,8 +1467,8 @@ private:
|
||||
uint8_t mCost : 4; ///< The cost to this router via neighbor router
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
uint8_t mCslClockAccuracy; ///< Crystal accuracy, in units of ± ppm.
|
||||
uint8_t mCslClockUncertainty; ///< Scheduling uncertainty, in units of 10 us.
|
||||
uint8_t mCslClockAccuracy; ///< Crystal accuracy, in units of ± ppm.
|
||||
uint8_t mCslUncertainty; ///< Scheduling uncertainty, in units of 10 us.
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -1557,7 +1557,7 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_RCP_CSL_ACCURACY>(voi
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_RCP_CSL_UNCERTAINTY>(void)
|
||||
{
|
||||
return mEncoder.WriteUint8(otPlatRadioGetCslClockUncertainty(mInstance));
|
||||
return mEncoder.WriteUint8(otPlatRadioGetCslUncertainty(mInstance));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -614,7 +614,7 @@ uint8_t otPlatRadioGetCslAccuracy(otInstance *aInstance)
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
uint8_t otPlatRadioGetCslClockUncertainty(otInstance *aInstance)
|
||||
uint8_t otPlatRadioGetCslUncertainty(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user