Border Agent Tracker#
This module includes APIs for the Border Agent Tracker.
The Border Agent Tracker discovers and tracks Border Agents on the infrastructure link by browsing for the _meshcop._udp mDNS service.
Modules#
Typedefs#
Represents an iterator to iterate through the discovered Border Agents.
Represents information about a discovered Border Agent.
Functions#
Enables or disables the Border Agent Tracker.
Indicates whether the Border Agent Tracker is running.
Initializes a Border Agent Tracker iterator.
Gets the information for the next discovered Border Agent.
Typedef Documentation#
otBorderAgentTrackerIterator#
typedef struct otBorderAgentTrackerIterator otBorderAgentTrackerIterator
Represents an iterator to iterate through the discovered Border Agents.
The fields in this struct are for OpenThread internal use only and MUST NOT be accessed or modified by the caller.
An iterator MUST be initialized using otBorderAgentTrackerInitIterator() before it is used.
otBorderAgentTrackerAgentInfo#
typedef struct otBorderAgentTrackerAgentInfo otBorderAgentTrackerAgentInfo
Represents information about a discovered Border Agent.
To ensure consistent mMsecSinceDiscovered and mMsecSinceLastChange time calculations, the iterator's initialization time is stored within the iterator when otBorderAgentTrackerInitIterator() is called. The time values in this struct are calculated relative to the iterator's initialization time.
Function Documentation#
otBorderAgentTrackerSetEnabled#
void otBorderAgentTrackerSetEnabled (otInstance * aInstance, bool aEnable)
Enables or disables the Border Agent Tracker.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
| bool | [in] | aEnable | TRUE to enable the Border Agent Tracker, FALSE to disable it. |
Requires OPENTHREAD_CONFIG_BORDER_AGENT_TRACKER_ENABLE.
When enabled, the tracker browses for the _meshcop._udp mDNS service to discover and track Border Agents on the infra-if network.
otBorderAgentTrackerIsRunning#
bool otBorderAgentTrackerIsRunning (otInstance * aInstance)
Indicates whether the Border Agent Tracker is running.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Requires OPENTHREAD_CONFIG_BORDER_AGENT_TRACKER_ENABLE.
The tracker can be enabled by the user (via otBorderAgentTrackerSetEnabled()) or by the OpenThread stack itself. The tracker is considered running if it is enabled by either entity AND the underlying DNS-SD (mDNS) is ready. This means that otBorderAgentTrackerIsRunning() may not return TRUE immediately after a call to otBorderAgentTrackerSetEnabled(true).
otBorderAgentTrackerInitIterator#
void otBorderAgentTrackerInitIterator (otInstance * aInstance, otBorderAgentTrackerIterator * aIterator)
Initializes a Border Agent Tracker iterator.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
| otBorderAgentTrackerIterator * | [in] | aIterator | A pointer to the iterator to initialize. |
Requires OPENTHREAD_CONFIG_BORDER_AGENT_TRACKER_ENABLE.
An iterator MUST be initialized before being used.
otBorderAgentTrackerGetNextAgent#
otError otBorderAgentTrackerGetNextAgent (otInstance * aInstance, otBorderAgentTrackerIterator * aIterator, otBorderAgentTrackerAgentInfo * aAgentInfo)
Gets the information for the next discovered Border Agent.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
| otBorderAgentTrackerIterator * | [inout] | aIterator | A pointer to the iterator. An iterator MUST be initialized using |
| otBorderAgentTrackerAgentInfo * | [out] | aAgentInfo | A pointer to an |
Requires OPENTHREAD_CONFIG_BORDER_AGENT_TRACKER_ENABLE.
The iterator initialization time is used to determine the mMsecSinceDiscovered and mMsecSinceLastChange in the otBorderAgentTrackerAgentInfo.