mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 19:27:46 +00:00
[link-quality] explicitly clear link quality for new child/router (#2941)
The child/router entries are generally cleared using `memset()` to avoid explicitly setting all fields to zero. As a result, it is necessary to explicitly clear the link quality state to properly initialize the last RSSI reading. The user-specific constructors are also removed.
This commit is contained in:
@@ -93,6 +93,7 @@ void TestLinkQualityData(RssTestData aRssData)
|
||||
size_t i;
|
||||
|
||||
printf("- - - - - - - - - - - - - - - - - -\n");
|
||||
linkInfo.Clear();
|
||||
min = kMinRssValue;
|
||||
max = kMaxRssValue;
|
||||
|
||||
@@ -387,6 +388,8 @@ void TestSuccessRateTracker(void)
|
||||
|
||||
printf("\nTesting SuccessRateTracker\n");
|
||||
|
||||
rateTracker.Reset();
|
||||
|
||||
VerifyOrQuit(rateTracker.GetSuccessRate() == kMaxRate, "SuccessRateTracker: Initial value incorrect");
|
||||
VerifyOrQuit(rateTracker.GetFailureRate() == 0, "SuccessRateTracker: Initial value incorrect");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user