diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index e649a2716..9fbc9fef8 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -1534,6 +1534,9 @@ void Interpreter::ProcessParent(int argc, char *argv[]) mServer->OutputFormat("\r\n"); mServer->OutputFormat("Rloc: %x\r\n", parentInfo.mRloc16); + mServer->OutputFormat("Link Quality In: %d\r\n", parentInfo.mLinkQualityIn); + mServer->OutputFormat("Link Quality Out: %d\r\n", parentInfo.mLinkQualityOut); + mServer->OutputFormat("Age: %d\r\n", parentInfo.mAge); exit: (void)argc; diff --git a/src/core/api/thread_api.cpp b/src/core/api/thread_api.cpp index 5426b6d1a..e55f88be1 100644 --- a/src/core/api/thread_api.cpp +++ b/src/core/api/thread_api.cpp @@ -304,6 +304,9 @@ otError otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo) otError error = OT_ERROR_NONE; Router *parent; + VerifyOrExit(aInstance->mThreadNetif.GetMle().GetRole() == OT_DEVICE_ROLE_CHILD, + error = OT_ERROR_INVALID_STATE); + VerifyOrExit(aParentInfo != NULL, error = OT_ERROR_INVALID_ARGS); parent = aInstance->mThreadNetif.GetMle().GetParent();