[api] expose API to obtain service ALOC for given service ID (#6519)

This commit is contained in:
Pieter De Gendt
2021-04-29 09:27:02 -07:00
committed by GitHub
parent 257188b5e9
commit 84876d7f56
3 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (107)
#define OPENTHREAD_API_VERSION (108)
/**
* @addtogroup api-instance
+12
View File
@@ -500,6 +500,18 @@ const otIp6Address *otThreadGetLinkLocalAllThreadNodesMulticastAddress(otInstanc
*/
const otIp6Address *otThreadGetRealmLocalAllThreadNodesMulticastAddress(otInstance *aInstance);
/**
* This function retrieves the Service ALOC for given Service ID.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aServiceId Service ID to get ALOC for.
* @param[out] aServiceAloc A pointer to output the Service ALOC. MUST NOT BE NULL.
*
* @retval OT_ERROR_NONE Successfully retrieved the Service ALOC.
* @retval OT_ERROR_DETACHED The Thread interface is not currently attached to a Thread Partition.
*/
otError otThreadGetServiceAloc(otInstance *aInstance, uint8_t aServiceId, otIp6Address *aServiceAloc);
/**
* Get the Thread Network Name.
*
+7
View File
@@ -193,6 +193,13 @@ const otIp6Address *otThreadGetRealmLocalAllThreadNodesMulticastAddress(otInstan
return &instance.Get<Mle::MleRouter>().GetRealmLocalAllThreadNodesAddress();
}
otError otThreadGetServiceAloc(otInstance *aInstance, uint8_t aServiceId, otIp6Address *aServiceAloc)
{
Instance &instance = *static_cast<Instance *>(aInstance);
return instance.Get<Mle::MleRouter>().GetServiceAloc(aServiceId, *static_cast<Ip6::Address *>(aServiceAloc));
}
const char *otThreadGetNetworkName(otInstance *aInstance)
{
Instance &instance = *static_cast<Instance *>(aInstance);