[cli] extend ipaddr command for selective address printing (#3856)

This commit is contained in:
Łukasz Duda
2019-05-29 22:46:56 +02:00
committed by Jonathan Hui
parent 787184d4bb
commit 99937016c0
7 changed files with 151 additions and 2 deletions
+15
View File
@@ -1328,6 +1328,21 @@ void Interpreter::ProcessIpAddr(int argc, char *argv[])
{
SuccessOrExit(error = ProcessIpAddrDel(argc - 1, argv + 1));
}
else if (strcmp(argv[0], "linklocal") == 0)
{
OutputIp6Address(*otThreadGetLinkLocalIp6Address(mInstance));
mServer->OutputFormat("\r\n");
}
else if (strcmp(argv[0], "rloc") == 0)
{
OutputIp6Address(*otThreadGetRloc(mInstance));
mServer->OutputFormat("\r\n");
}
else if (strcmp(argv[0], "mleid") == 0)
{
OutputIp6Address(*otThreadGetMeshLocalEid(mInstance));
mServer->OutputFormat("\r\n");
}
else
{
ExitNow(error = OT_ERROR_INVALID_ARGS);