mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 13:20:25 +00:00
[address-resolver] update public OT API for getting cache table (#4599)
This commit updates the public OpenThread APIs to get the address cache table. The new APIs allows to iterate through all entries (including in query or retry mode) and provides more info about the entries, e.g., current timeout, retry delay (if entry is in query/retry state), or the mesh-local EID, last transaction time (if entry is in cached state).
This commit is contained in:
committed by
Jonathan Hui
parent
ee4bc9cb12
commit
451a72f750
+5
-7
@@ -1294,16 +1294,14 @@ void Interpreter::ProcessEidCache(uint8_t aArgsLength, char *aArgs[])
|
||||
OT_UNUSED_VARIABLE(aArgsLength);
|
||||
OT_UNUSED_VARIABLE(aArgs);
|
||||
|
||||
otEidCacheEntry entry;
|
||||
otCacheEntryIterator iterator;
|
||||
otCacheEntryInfo entry;
|
||||
|
||||
memset(&iterator, 0, sizeof(iterator));
|
||||
|
||||
for (uint8_t i = 0;; i++)
|
||||
{
|
||||
SuccessOrExit(otThreadGetEidCacheEntry(mInstance, i, &entry));
|
||||
|
||||
if (!entry.mValid)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
SuccessOrExit(otThreadGetNextCacheEntry(mInstance, &entry, &iterator));
|
||||
|
||||
OutputIp6Address(entry.mTarget);
|
||||
mServer->OutputFormat(" %04x\r\n", entry.mRloc16);
|
||||
|
||||
Reference in New Issue
Block a user