diff --git a/include/openthread/thread.h b/include/openthread/thread.h index 251631e66..67ed50991 100644 --- a/include/openthread/thread.h +++ b/include/openthread/thread.h @@ -400,11 +400,21 @@ OTAPI const otMasterKey *OTCALL otThreadGetMasterKey(otInstance *aInstance); OTAPI otError OTCALL otThreadSetMasterKey(otInstance *aInstance, const otMasterKey *aKey); /** - * This function returns a pointer to the Mesh Local EID. + * This function returns a pointer to the Thread Routing Locator (RLOC) address. * * @param[in] aInstance A pointer to an OpenThread instance. * - * @returns A pointer to the Mesh Local EID. + * @returns A pointer to the Thread Routing Locator (RLOC) address. + * + */ +OTAPI const otIp6Address *OTCALL otThreadGetRloc(otInstance *aInstance); + +/** + * This function returns a pointer to the Mesh Local EID address. + * + * @param[in] aInstance A pointer to an OpenThread instance. + * + * @returns A pointer to the Mesh Local EID address. * */ OTAPI const otIp6Address *OTCALL otThreadGetMeshLocalEid(otInstance *aInstance); diff --git a/src/core/api/thread_api.cpp b/src/core/api/thread_api.cpp index ee3fc155e..729513e29 100644 --- a/src/core/api/thread_api.cpp +++ b/src/core/api/thread_api.cpp @@ -183,6 +183,13 @@ exit: return error; } +const otIp6Address *OTCALL otThreadGetRloc(otInstance *aInstance) +{ + Instance &instance = *static_cast(aInstance); + + return &instance.Get().GetMeshLocal16(); +} + const otIp6Address *otThreadGetMeshLocalEid(otInstance *aInstance) { Instance &instance = *static_cast(aInstance);