mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 17:37:46 +00:00
[csl] fixes on the receiver window duration calculation (#6997)
- kUsPerUncertUnit was declared with two different values. - clockAccuracy values were not properly read from the Parent Response.
This commit is contained in:
@@ -584,10 +584,6 @@ private:
|
||||
// than expected sample window. The value is in usec.
|
||||
static constexpr uint32_t kCslReceiveTimeAhead = OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD;
|
||||
|
||||
static constexpr uint8_t kCslWorstCrystalPpm = 255; // Worst possible crystal accuracy, in units of ± ppm.
|
||||
static constexpr uint8_t kCslWorstUncertainty = 255; // Worst possible scheduling uncertainty, in units of 100 us.
|
||||
static constexpr uint8_t kUsPerUncertUnit = 100; // Number of microseconds by uncertainty unit.
|
||||
|
||||
enum CslState : uint8_t{
|
||||
kCslIdle, // CSL receiver is not started.
|
||||
kCslSample, // Sampling CSL channel.
|
||||
|
||||
@@ -3406,6 +3406,15 @@ void Mle::HandleParentResponse(const Message &aMessage, const Ip6::MessageInfo &
|
||||
SuccessOrExit(error = Tlv::FindTlv(aMessage, connectivity));
|
||||
VerifyOrExit(connectivity.IsValid(), error = kErrorParse);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
// CSL Accuracy
|
||||
if (Tlv::FindTlv(aMessage, clockAccuracy) != kErrorNone)
|
||||
{
|
||||
clockAccuracy.SetCslClockAccuracy(kCslWorstCrystalPpm);
|
||||
clockAccuracy.SetCslUncertainty(kCslWorstUncertainty);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Share data with application, if requested.
|
||||
if (mParentResponseCb)
|
||||
{
|
||||
@@ -3475,14 +3484,6 @@ void Mle::HandleParentResponse(const Message &aMessage, const Ip6::MessageInfo &
|
||||
VerifyOrExit(compare >= 0);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
if (Tlv::FindTlv(aMessage, clockAccuracy) != kErrorNone)
|
||||
{
|
||||
clockAccuracy.SetCslClockAccuracy(kCslWorstCrystalPpm);
|
||||
clockAccuracy.SetCslUncertainty(kCslWorstUncertainty);
|
||||
}
|
||||
#endif
|
||||
|
||||
// only consider better parents if the partitions are the same
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
VerifyOrExit(compare != 0 ||
|
||||
|
||||
Reference in New Issue
Block a user