Border Agent Tracker

This module includes APIs for the Border Agent Tracker.

Summary

The Border Agent Tracker discovers and tracks Border Agents on the infrastructure link by browsing for the _meshcop._udp mDNS service.

Typedefs

otBorderAgentTrackerAgentInfo typedef
Represents information about a discovered Border Agent.
otBorderAgentTrackerIterator typedef
Represents an iterator to iterate through the discovered Border Agents.

Functions

otBorderAgentTrackerGetNextAgent(otInstance *aInstance, otBorderAgentTrackerIterator *aIterator, otBorderAgentTrackerAgentInfo *aAgentInfo)
Gets the information for the next discovered Border Agent.
otBorderAgentTrackerInitIterator(otInstance *aInstance, otBorderAgentTrackerIterator *aIterator)
void
Initializes a Border Agent Tracker iterator.
otBorderAgentTrackerIsRunning(otInstance *aInstance)
bool
Indicates whether the Border Agent Tracker is running.
otBorderAgentTrackerSetEnabled(otInstance *aInstance, bool aEnable)
void
Enables or disables the Border Agent Tracker.

Structs

otBorderAgentTrackerAgentInfo

Represents information about a discovered Border Agent.

otBorderAgentTrackerIterator

Represents an iterator to iterate through the discovered Border Agents.

Typedefs

otBorderAgentTrackerAgentInfo

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.

otBorderAgentTrackerIterator

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.

Functions

otBorderAgentTrackerGetNextAgent

otError otBorderAgentTrackerGetNextAgent(
  otInstance *aInstance,
  otBorderAgentTrackerIterator *aIterator,
  otBorderAgentTrackerAgentInfo *aAgentInfo
)

Gets the information for the next discovered Border Agent.

Requires OPENTHREAD_CONFIG_BORDER_AGENT_TRACKER_ENABLE.

The iterator initialization time is used to determine the mMsecSinceDiscovered and mMsecSinceLastChange in the otBorderAgentTrackerAgentInfo.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
[in,out] aIterator
A pointer to the iterator. An iterator MUST be initialized using otBorderAgentTrackerInitIterator() before it is used.
[out] aAgentInfo
A pointer to an otBorderAgentTrackerAgentInfo struct to populate.
Return Values
OT_ERROR_NONE
Successfully retrieved the information for the next agent.
OT_ERROR_NOT_FOUND
No more agents were found.

otBorderAgentTrackerInitIterator

void otBorderAgentTrackerInitIterator(
  otInstance *aInstance,
  otBorderAgentTrackerIterator *aIterator
)

Initializes a Border Agent Tracker iterator.

Requires OPENTHREAD_CONFIG_BORDER_AGENT_TRACKER_ENABLE.

An iterator MUST be initialized before being used.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
[in] aIterator
A pointer to the iterator to initialize.

otBorderAgentTrackerIsRunning

bool otBorderAgentTrackerIsRunning(
  otInstance *aInstance
)

Indicates whether the Border Agent Tracker is running.

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).

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
Return Values
TRUE
If the tracker is running.
FALSE
If the tracker is not running.

otBorderAgentTrackerSetEnabled

void otBorderAgentTrackerSetEnabled(
  otInstance *aInstance,
  bool aEnable
)

Enables or disables the Border Agent Tracker.

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.

Details
Parameters
[in] aInstance
A pointer to an OpenThread instance.
[in] aEnable
TRUE to enable the Border Agent Tracker, FALSE to disable it.

Resources

OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.