mirror of
https://github.com/espressif/openthread.git
synced 2026-07-15 00:24:11 +00:00
[timer] fix elapsed overflow (#3789)
This commit fixes a bug in the commissioner when a joiner's expiration time has alerady elapsed. This commit also introduces convenience methods for computing time elapsed and diffs.
This commit is contained in:
@@ -360,8 +360,8 @@ otError otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo)
|
||||
aParentInfo->mPathCost = parent->GetCost();
|
||||
aParentInfo->mLinkQualityIn = parent->GetLinkInfo().GetLinkQuality();
|
||||
aParentInfo->mLinkQualityOut = parent->GetLinkQualityOut();
|
||||
aParentInfo->mAge = static_cast<uint8_t>(TimerMilli::MsecToSec(TimerMilli::GetNow() - parent->GetLastHeard()));
|
||||
aParentInfo->mAllocated = true;
|
||||
aParentInfo->mAge = static_cast<uint8_t>(TimerMilli::MsecToSec(TimerMilli::Elapsed(parent->GetLastHeard())));
|
||||
aParentInfo->mAllocated = true;
|
||||
aParentInfo->mLinkEstablished = parent->GetState() == Neighbor::kStateValid;
|
||||
|
||||
exit:
|
||||
|
||||
Reference in New Issue
Block a user