mirror of
https://github.com/espressif/openthread.git
synced 2026-08-16 23:57:46 +00:00
[link-quality] have LinkQualityInfo inherit from IntsanceLocatorInit (#4569)
This commit is contained in:
committed by
Jonathan Hui
parent
0f5edc4c89
commit
2437a75a6b
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/instance.hpp"
|
||||
#include "common/locator-getters.hpp"
|
||||
|
||||
namespace ot {
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#include "common/locator.hpp"
|
||||
#include "common/string.hpp"
|
||||
|
||||
namespace ot {
|
||||
@@ -215,7 +216,7 @@ private:
|
||||
* strength (RSS), last RSS, link margin, and link quality.
|
||||
*
|
||||
*/
|
||||
class LinkQualityInfo
|
||||
class LinkQualityInfo : public InstanceLocatorInit
|
||||
{
|
||||
public:
|
||||
enum
|
||||
@@ -229,6 +230,14 @@ public:
|
||||
*/
|
||||
typedef String<kInfoStringSize> InfoString;
|
||||
|
||||
/**
|
||||
* This method initializes the `LinkQualityInfo` object.
|
||||
*
|
||||
* @param[in] aInstance A reference to the OpenThread instance.
|
||||
*
|
||||
*/
|
||||
void Init(Instance &aInstance) { InstanceLocatorInit::Init(aInstance); }
|
||||
|
||||
/**
|
||||
* This method clears the all the data in the object.
|
||||
*
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace ot {
|
||||
void Neighbor::Init(Instance &aInstance)
|
||||
{
|
||||
InstanceLocatorInit::Init(aInstance);
|
||||
mLinkInfo.Init(aInstance);
|
||||
SetState(kStateInvalid);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,8 +90,7 @@ void VerifyChildIp6Addresses(const Child &aChild, uint8_t aAddressListLength, co
|
||||
|
||||
if (sInstance->Get<Mle::MleRouter>().IsMeshLocalAddress(aAddressList[index]))
|
||||
{
|
||||
SuccessOrQuit(aChild.GetMeshLocalIp6Address(address),
|
||||
"Child::GetMeshLocalIp6Address() failed\n");
|
||||
SuccessOrQuit(aChild.GetMeshLocalIp6Address(address), "Child::GetMeshLocalIp6Address() failed\n");
|
||||
VerifyOrQuit(address == aAddressList[index], "GetMeshLocalIp6Address() did not return expected address");
|
||||
hasMeshLocal = true;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
namespace ot {
|
||||
|
||||
static ot::Instance *sInstance;
|
||||
|
||||
enum
|
||||
{
|
||||
kMaxRssValue = 0,
|
||||
@@ -89,6 +91,10 @@ void TestLinkQualityData(RssTestData aRssData)
|
||||
int8_t rss, ave, min, max;
|
||||
size_t i;
|
||||
|
||||
sInstance = testInitInstance();
|
||||
VerifyOrQuit(sInstance != NULL, "Null instance");
|
||||
linkInfo.Init(*sInstance);
|
||||
|
||||
printf("- - - - - - - - - - - - - - - - - -\n");
|
||||
linkInfo.Clear();
|
||||
min = kMinRssValue;
|
||||
|
||||
Reference in New Issue
Block a user