mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 23:30:07 +00:00
[child-table] remove from MTD build (#4730)
This commit is contained in:
@@ -411,12 +411,12 @@ template <> inline Mle::MleRouter &Instance::Get(void)
|
||||
return mThreadNetif.mMleRouter;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
template <> inline ChildTable &Instance::Get(void)
|
||||
{
|
||||
return mThreadNetif.mMleRouter.mChildTable;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
template <> inline RouterTable &Instance::Get(void)
|
||||
{
|
||||
return mThreadNetif.mMleRouter.mRouterTable;
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
|
||||
#include "common/locator.hpp"
|
||||
#include "thread/topology.hpp"
|
||||
|
||||
namespace ot {
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
|
||||
/**
|
||||
* This class represents the Thread child table.
|
||||
*
|
||||
@@ -285,50 +285,8 @@ private:
|
||||
Child mChildren[kMaxChildren];
|
||||
};
|
||||
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
#if OPENTHREAD_MTD
|
||||
|
||||
class ChildTable : public InstanceLocator
|
||||
{
|
||||
public:
|
||||
class Iterator
|
||||
{
|
||||
public:
|
||||
Iterator(Instance &, Child::StateFilter) {}
|
||||
Iterator(Instance &, Child::StateFilter, Child *) {}
|
||||
void Reset(void) {}
|
||||
bool IsDone(void) const { return true; }
|
||||
void Advance(void) {}
|
||||
void operator++(void) {}
|
||||
void operator++(int) {}
|
||||
Child *GetChild(void) { return NULL; }
|
||||
};
|
||||
|
||||
explicit ChildTable(Instance &aInstance)
|
||||
: InstanceLocator(aInstance)
|
||||
{
|
||||
}
|
||||
void Clear(void) {}
|
||||
|
||||
uint16_t GetChildIndex(const Child &) const { return 0; }
|
||||
Child * GetChildAtIndex(uint16_t) { return NULL; }
|
||||
|
||||
Child *GetNewChild(void) { return NULL; }
|
||||
|
||||
Child *FindChild(uint16_t, Child::StateFilter) { return NULL; }
|
||||
Child *FindChild(const Mac::ExtAddress &, Child::StateFilter) { return NULL; }
|
||||
Child *FindChild(const Mac::Address &, Child::StateFilter) { return NULL; }
|
||||
|
||||
bool HasChildren(Child::StateFilter) const { return false; }
|
||||
uint16_t GetNumChildren(Child::StateFilter) const { return 0; }
|
||||
uint16_t GetMaxChildren(void) const { return 0; }
|
||||
uint16_t GetMaxChildrenAllowed(void) const { return 0; }
|
||||
otError SetMaxChildrenAllowed(uint16_t) { return OT_ERROR_INVALID_STATE; }
|
||||
};
|
||||
|
||||
#endif // OPENTHREAD_MTD
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
#endif // CHILD_TABLE_HPP_
|
||||
|
||||
@@ -132,7 +132,6 @@ otError KeyManager::SetMasterKey(const MasterKey &aKey)
|
||||
iter.GetRouter()->SetLinkFrameCounter(0);
|
||||
iter.GetRouter()->SetMleFrameCounter(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// reset child frame counters
|
||||
for (ChildTable::Iterator iter(GetInstance(), Child::kInStateAnyExceptInvalid); !iter.IsDone(); iter++)
|
||||
@@ -141,6 +140,7 @@ otError KeyManager::SetMasterKey(const MasterKey &aKey)
|
||||
iter.GetChild()->SetLinkFrameCounter(0);
|
||||
iter.GetChild()->SetMleFrameCounter(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#include "thread/child_table.hpp"
|
||||
#include "thread/mle.hpp"
|
||||
|
||||
namespace ot {
|
||||
@@ -50,7 +49,6 @@ class MleRouter : public Mle
|
||||
public:
|
||||
explicit MleRouter(Instance &aInstance)
|
||||
: Mle(aInstance)
|
||||
, mChildTable(aInstance)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -81,9 +79,6 @@ public:
|
||||
otError GetMaxChildTimeout(uint32_t &) { return OT_ERROR_NOT_IMPLEMENTED; }
|
||||
|
||||
bool HasSleepyChildrenSubscribed(const Ip6::Address &) { return false; }
|
||||
|
||||
private:
|
||||
ChildTable mChildTable;
|
||||
};
|
||||
|
||||
} // namespace Mle
|
||||
|
||||
@@ -220,6 +220,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
otError NetworkDiagnostic::AppendChildTable(Message &aMessage)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
@@ -271,6 +272,7 @@ exit:
|
||||
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
void NetworkDiagnostic::FillMacCountersTlv(MacCountersTlv &aMacCountersTlv)
|
||||
{
|
||||
@@ -430,6 +432,7 @@ otError NetworkDiagnostic::FillRequestedTlvs(Message & aRequest,
|
||||
break;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
case NetworkDiagnosticTlv::kChildTable:
|
||||
{
|
||||
// Thread 1.1.1 Specification Section 10.11.2.2:
|
||||
@@ -442,6 +445,7 @@ otError NetworkDiagnostic::FillRequestedTlvs(Message & aRequest,
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case NetworkDiagnosticTlv::kChannelPages:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user