mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 03:07:47 +00:00
[api] expose API to obtain service ALOC for given service ID (#6519)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user