mirror of
https://github.com/espressif/openthread.git
synced 2026-09-24 18:07:36 +00:00
[address-resolver] TimeSinceLastTransaction should be in seconds (#5264)
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "common/instance.hpp"
|
||||
#include "common/locator-getters.hpp"
|
||||
#include "common/logging.hpp"
|
||||
#include "common/time.hpp"
|
||||
#include "mac/mac_types.hpp"
|
||||
#include "thread/mesh_forwarder.hpp"
|
||||
#include "thread/mle_router.hpp"
|
||||
@@ -787,7 +788,7 @@ void AddressResolver::HandleAddressQuery(Coap::Message &aMessage, const Ip6::Mes
|
||||
|
||||
if (child.HasIp6Address(target))
|
||||
{
|
||||
lastTransactionTime = TimerMilli::GetNow() - child.GetLastHeard();
|
||||
lastTransactionTime = Time::MsecToSec(TimerMilli::GetNow() - child.GetLastHeard());
|
||||
SendAddressQueryResponse(target, child.GetMeshLocalIid(), &lastTransactionTime, aMessageInfo.GetPeerAddr());
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -322,7 +322,9 @@ for index in range(NUM_ADDRESSES):
|
||||
str(NUM_ADDRESSES - index - 1))
|
||||
verify(cache_table[index].rloc16 == r3_rloc)
|
||||
verify(cache_table[index].state == wpan.ADDRESS_CACHE_ENTRY_STATE_CACHED)
|
||||
verify(cache_table[index].last_trans > 0)
|
||||
# SED's keep-alive period (`POLL_PERIOD`) is 200ms, `last_trans` should always be 0 as it is
|
||||
# the number of seconds since a keep-alive was last received from the child.
|
||||
verify(cache_table[index].last_trans == 0)
|
||||
|
||||
# Send again to r2. This should cause the related cache entries to be moved to top of the list:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user