[api] expose API to obtain RLOC (#3854)

This commit is contained in:
Łukasz Duda
2019-05-22 10:57:58 -07:00
committed by Jonathan Hui
parent bcfa791912
commit 9e7162253c
2 changed files with 19 additions and 2 deletions
+12 -2
View File
@@ -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);
+7
View File
@@ -183,6 +183,13 @@ exit:
return error;
}
const otIp6Address *OTCALL otThreadGetRloc(otInstance *aInstance)
{
Instance &instance = *static_cast<Instance *>(aInstance);
return &instance.Get<Mle::MleRouter>().GetMeshLocal16();
}
const otIp6Address *otThreadGetMeshLocalEid(otInstance *aInstance)
{
Instance &instance = *static_cast<Instance *>(aInstance);