[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:
Abtin Keshavarzian
2020-02-21 12:55:08 -08:00
committed by Jonathan Hui
parent ee4bc9cb12
commit 451a72f750
6 changed files with 148 additions and 53 deletions
+5 -7
View File
@@ -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);