[mle] define DetachGraecfuly variables as private (#8044)

This commit changes the definitions (member variables, constants, and
methods) related to graceful detach mechanism to be `private` instead
of `protected` since they are only accessed/used by the `Mle` and not
by its sub-class `MleRouter`.
This commit is contained in:
Abtin Keshavarzian
2022-08-18 23:01:26 -07:00
committed by GitHub
parent 4dd9fd0c9e
commit a0718d90b1
2 changed files with 10 additions and 18 deletions
+3 -3
View File
@@ -83,10 +83,7 @@ Mle::Mle(Instance &aInstance)
, mAttachTimer(aInstance, Mle::HandleAttachTimer)
, mDelayedResponseTimer(aInstance, Mle::HandleDelayedResponseTimer)
, mMessageTransmissionTimer(aInstance, Mle::HandleMessageTransmissionTimer)
, mDetachGracefullyTimer(aInstance, Mle::HandleDetachGracefullyTimer)
, mParentLeaderCost(0)
, mDetachGracefullyCallback(nullptr)
, mDetachGracefullyContext(nullptr)
, mAttachMode(kAnyPartition)
, mParentPriority(0)
, mParentLinkQuality3(0)
@@ -116,6 +113,9 @@ Mle::Mle(Instance &aInstance)
, mAlternateChannel(0)
, mAlternatePanId(Mac::kPanIdBroadcast)
, mAlternateTimestamp(0)
, mDetachGracefullyTimer(aInstance, Mle::HandleDetachGracefullyTimer)
, mDetachGracefullyCallback(nullptr)
, mDetachGracefullyContext(nullptr)
, mParentResponseCb(nullptr)
, mParentResponseCbContext(nullptr)
{
+7 -15
View File
@@ -1770,15 +1770,6 @@ protected:
#endif
/**
* This method indicates whether the device is detaching gracefully.
*
* @retval TRUE Detaching is in progress.
* @retval FALSE Not detaching.
*
*/
bool IsDetachingGracefully(void) { return mDetachGracefullyTimer.IsRunning(); }
Ip6::Netif::UnicastAddress mLeaderAloc; ///< Leader anycast locator
LeaderData mLeaderData; ///< Last received Leader Data TLV.
@@ -1796,14 +1787,8 @@ protected:
TimerMilli mAttachTimer; ///< The timer for driving the attach process.
TimerMilli mDelayedResponseTimer; ///< The timer to delay MLE responses.
TimerMilli mMessageTransmissionTimer; ///< The timer for (re-)sending of MLE messages (e.g. Child Update).
TimerMilli mDetachGracefullyTimer;
uint8_t mParentLeaderCost;
otDetachGracefullyCallback mDetachGracefullyCallback;
void * mDetachGracefullyContext;
static constexpr uint32_t kDetachGracefullyTimeout = 1000;
private:
static constexpr uint8_t kMleHopLimit = 255;
static constexpr uint8_t kMleSecurityTagSize = 4; // Security tag size in bytes.
@@ -1829,6 +1814,8 @@ private:
static constexpr uint8_t kNextAttachCycleTotalParentRequests = 2;
static constexpr uint8_t kNextAttachCycleNumParentRequestToRouters = 1;
static constexpr uint32_t kDetachGracefullyTimeout = 1000;
enum StartMode : uint8_t // Used in `Start()`.
{
kNormalAttach,
@@ -1976,6 +1963,7 @@ private:
void ReestablishLinkWithNeighbor(Neighbor &aNeighbor);
static void HandleDetachGracefullyTimer(Timer &aTimer);
void HandleDetachGracefullyTimer(void);
bool IsDetachingGracefully(void) { return mDetachGracefullyTimer.IsRunning(); }
Error SendChildUpdateRequest(bool aAppendChallenge, uint32_t aTimeout);
#if OPENTHREAD_FTD
@@ -2111,6 +2099,10 @@ private:
Ip6::Netif::MulticastAddress mLinkLocalAllThreadNodes;
Ip6::Netif::MulticastAddress mRealmLocalAllThreadNodes;
TimerMilli mDetachGracefullyTimer;
otDetachGracefullyCallback mDetachGracefullyCallback;
void * mDetachGracefullyContext;
otThreadParentResponseCallback mParentResponseCb;
void * mParentResponseCbContext;
};