mirror of
https://github.com/espressif/openthread.git
synced 2026-07-26 13:59:05 +00:00
Update child's keep-alive period (#1676)
* Update child's keep-alive period * Python Cert: correct sed1 index * update for comments
This commit is contained in:
@@ -388,7 +388,7 @@ uint32_t DataPollManager::CalculatePollPeriod(void) const
|
||||
|
||||
if (period == 0)
|
||||
{
|
||||
period = Timer::SecToMsec(mMeshForwarder.GetNetif().GetMle().GetTimeout() / Mle::kMaxChildKeepAliveAttempts);
|
||||
period = Timer::SecToMsec(mMeshForwarder.GetNetif().GetMle().GetTimeout()) - kRetxPollPeriod * kMaxPollRetxAttempts;
|
||||
|
||||
if (period == 0)
|
||||
{
|
||||
|
||||
@@ -588,7 +588,7 @@ ThreadError Mle::SetStateChild(uint16_t aRloc16)
|
||||
|
||||
if ((mDeviceMode & ModeTlv::kModeRxOnWhenIdle) != 0)
|
||||
{
|
||||
mParentRequestTimer.Start(Timer::SecToMsec(mTimeout / kMaxChildKeepAliveAttempts));
|
||||
mParentRequestTimer.Start(Timer::SecToMsec(mTimeout) - kUnicastRetransmissionDelay * kMaxChildKeepAliveAttempts);
|
||||
}
|
||||
|
||||
if ((mDeviceMode & ModeTlv::kModeFFD) != 0)
|
||||
@@ -616,9 +616,9 @@ ThreadError Mle::SetTimeout(uint32_t aTimeout)
|
||||
{
|
||||
VerifyOrExit(mTimeout != aTimeout);
|
||||
|
||||
if (aTimeout < 4)
|
||||
if (aTimeout < kMinTimeout)
|
||||
{
|
||||
aTimeout = 4;
|
||||
aTimeout = kMinTimeout;
|
||||
}
|
||||
|
||||
mTimeout = aTimeout;
|
||||
@@ -2968,7 +2968,7 @@ ThreadError Mle::HandleChildUpdateResponse(const Message &aMessage, const Ip6::M
|
||||
}
|
||||
else
|
||||
{
|
||||
mParentRequestTimer.Start(Timer::SecToMsec(mTimeout / kMaxChildKeepAliveAttempts));
|
||||
mParentRequestTimer.Start(Timer::SecToMsec(mTimeout) - kUnicastRetransmissionDelay * kMaxChildKeepAliveAttempts);
|
||||
mNetif.GetMeshForwarder().SetRxOnWhenIdle(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ enum
|
||||
kMaxResponseDelay = 1000, ///< Maximum delay before responding to a multicast request
|
||||
kMaxChildIdRequestTimeout = 5000, ///< Maximum delay for receiving a Child ID Request
|
||||
kMaxChildUpdateResponseTimeout = 2000, ///< Maximum delay for receiving a Child Update Response
|
||||
kMinTimeout = (((kMaxChildKeepAliveAttempts + 1) * kUnicastRetransmissionDelay) / 1000), ///< Minimum timeout(s)
|
||||
};
|
||||
|
||||
enum
|
||||
|
||||
@@ -34,7 +34,7 @@ import node
|
||||
|
||||
LEADER = 1
|
||||
ROUTER = 2
|
||||
SED1 = 6
|
||||
SED1 = 7
|
||||
|
||||
class Cert_5_1_07_MaxChildCount(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user