Border Agent#

This module includes functions for the Thread Border Agent role.

Modules#

otBorderAgentId

Enumerations#

enum
OT_BORDER_AGENT_STATE_STOPPED = 0
OT_BORDER_AGENT_STATE_STARTED = 1
OT_BORDER_AGENT_STATE_ACTIVE = 2
}

Defines the Border Agent state.

Typedefs#

typedef struct otBorderAgentId

Represents a Border Agent ID.

typedef enum otBorderAgentState

Defines the Border Agent state.

Functions#

otBorderAgentGetState(otInstance *aInstance)

Gets the otBorderAgentState of the Thread Border Agent role.

uint16_t
otBorderAgentGetUdpPort(otInstance *aInstance)

Gets the UDP port of the Thread Border Agent service.

otBorderAgentGetId(otInstance *aInstance, otBorderAgentId *aId)

Gets the randomly generated Border Agent ID.

otBorderAgentSetId(otInstance *aInstance, const otBorderAgentId *aId)

Sets the Border Agent ID.

Macros#

#define

The length of Border Agent/Router ID in bytes.

Enumeration Documentation#

otBorderAgentState#

otBorderAgentState

Defines the Border Agent state.

Enumerator
OT_BORDER_AGENT_STATE_STOPPED

Border agent role is disabled.

OT_BORDER_AGENT_STATE_STARTED

Border agent is started.

OT_BORDER_AGENT_STATE_ACTIVE

Border agent is connected with external commissioner.


Definition at line 82 of file include/openthread/border_agent.h

Typedef Documentation#

otBorderAgentId#

typedef struct otBorderAgentId otBorderAgentId

Represents a Border Agent ID.


Definition at line 76 of file include/openthread/border_agent.h

otBorderAgentState#

typedef enum otBorderAgentState otBorderAgentState

Defines the Border Agent state.


Definition at line 87 of file include/openthread/border_agent.h

Variable Documentation#

OT_TOOL_PACKED_END#

OT_TOOL_PACKED_BEGIN struct otBorderAgentId OT_TOOL_PACKED_END

Definition at line 70 of file include/openthread/border_agent.h

Function Documentation#

otBorderAgentGetState#

otBorderAgentState otBorderAgentGetState (otInstance * aInstance)

Gets the otBorderAgentState of the Thread Border Agent role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns


Definition at line 97 of file include/openthread/border_agent.h

otBorderAgentGetUdpPort#

uint16_t otBorderAgentGetUdpPort (otInstance * aInstance)

Gets the UDP port of the Thread Border Agent service.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • UDP port of the Border Agent.


Definition at line 107 of file include/openthread/border_agent.h

otBorderAgentGetId#

otError otBorderAgentGetId (otInstance * aInstance, otBorderAgentId * aId)

Gets the randomly generated Border Agent ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aId

A pointer to buffer to receive the ID.

The ID is saved in persistent storage and survives reboots. The typical use case of the ID is to be published in the MeshCoP mDNS service as the id TXT value for the client to identify this Border Router/Agent device.

See Also


Definition at line 125 of file include/openthread/border_agent.h

otBorderAgentSetId#

otError otBorderAgentSetId (otInstance * aInstance, const otBorderAgentId * aId)

Sets the Border Agent ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aId

A pointer to the Border Agent ID.

The Border Agent ID will be saved in persistent storage and survive reboots. It's required to set the ID only once after factory reset. If the ID has never been set by calling this function, a random ID will be generated and returned when otBorderAgentGetId is called.

See Also


Definition at line 143 of file include/openthread/border_agent.h

Macro Definition Documentation#

OT_BORDER_AGENT_ID_LENGTH#

#define OT_BORDER_AGENT_ID_LENGTH
Value:
(16)

The length of Border Agent/Router ID in bytes.


Definition at line 58 of file include/openthread/border_agent.h