Modules#

otBorderRouterConfig

otLowpanContextInfo

otExternalRouteConfig

otServerConfig

otServiceConfig

otNetworkDiagConnectivity

otNetworkDiagRouteData

otNetworkDiagRoute

otNetworkDiagMacCounters

otNetworkDiagChildEntry

otNetworkDiagTlv

otLinkModeConfig

otNeighborInfo

otLeaderData

otRouterInfo

otIpCounters

otMleCounters

otThreadParentResponseInfo

otThreadDiscoveryRequestInfo

General#

This module includes functions for all Thread roles.

The Network Data Publisher provides mechanisms to limit the number of similar Service and/or Prefix (on-mesh prefix or external route) entries in the Thread Network Data by monitoring the Network Data and managing if or when to add or remove entries.

All the functions in this module require OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE to be enabled.

Note

  • The functions in this module require OPENTHREAD_FTD=1 or OPENTHREAD_MTD=1.

Enumerations#

enum
OT_ROUTE_PREFERENCE_LOW = -1
OT_ROUTE_PREFERENCE_MED = 0
OT_ROUTE_PREFERENCE_HIGH = 1
}

Defines valid values for mPreference in otExternalRouteConfig and otBorderRouterConfig.

enum
OT_NETDATA_PUBLISHER_EVENT_ENTRY_ADDED = 0
OT_NETDATA_PUBLISHER_EVENT_ENTRY_REMOVED = 1
}

This enumeration represents the events reported from the Publisher callbacks.

enum
@6 {
OT_NETWORK_DIAGNOSTIC_TLV_EXT_ADDRESS = 0
OT_NETWORK_DIAGNOSTIC_TLV_SHORT_ADDRESS = 1
OT_NETWORK_DIAGNOSTIC_TLV_MODE = 2
OT_NETWORK_DIAGNOSTIC_TLV_TIMEOUT = 3
OT_NETWORK_DIAGNOSTIC_TLV_CONNECTIVITY = 4
OT_NETWORK_DIAGNOSTIC_TLV_ROUTE = 5
OT_NETWORK_DIAGNOSTIC_TLV_LEADER_DATA = 6
OT_NETWORK_DIAGNOSTIC_TLV_NETWORK_DATA = 7
OT_NETWORK_DIAGNOSTIC_TLV_IP6_ADDR_LIST = 8
OT_NETWORK_DIAGNOSTIC_TLV_MAC_COUNTERS = 9
OT_NETWORK_DIAGNOSTIC_TLV_BATTERY_LEVEL = 14
OT_NETWORK_DIAGNOSTIC_TLV_SUPPLY_VOLTAGE = 15
OT_NETWORK_DIAGNOSTIC_TLV_CHILD_TABLE = 16
OT_NETWORK_DIAGNOSTIC_TLV_CHANNEL_PAGES = 17
OT_NETWORK_DIAGNOSTIC_TLV_TYPE_LIST = 18
OT_NETWORK_DIAGNOSTIC_TLV_MAX_CHILD_TIMEOUT = 19
OT_NETWORK_DIAGNOSTIC_TLV_VERSION = 24
OT_NETWORK_DIAGNOSTIC_TLV_VENDOR_NAME = 25
OT_NETWORK_DIAGNOSTIC_TLV_VENDOR_MODEL = 26
OT_NETWORK_DIAGNOSTIC_TLV_VENDOR_SW_VERSION = 27
OT_NETWORK_DIAGNOSTIC_TLV_THREAD_STACK_VERSION = 28
}
enum
OT_DEVICE_ROLE_DISABLED = 0
OT_DEVICE_ROLE_DETACHED = 1
OT_DEVICE_ROLE_CHILD = 2
OT_DEVICE_ROLE_ROUTER = 3
OT_DEVICE_ROLE_LEADER = 4
}

Represents a Thread device role.

Typedefs#

typedef uint32_t

Used to iterate through Network Data information.

typedef struct otBorderRouterConfig

This structure represents a Border Router configuration.

typedef struct otLowpanContextInfo

This structure represents 6LoWPAN Context ID information associated with a prefix in Network Data.

typedef struct otExternalRouteConfig

This structure represents an External Route configuration.

typedef enum otRoutePreference

Defines valid values for mPreference in otExternalRouteConfig and otBorderRouterConfig.

typedef struct otServerConfig

This structure represents a Server configuration.

typedef struct otServiceConfig

This structure represents a Service configuration.

This enumeration represents the events reported from the Publisher callbacks.

typedef void(*
otNetDataDnsSrpServicePublisherCallback)(otNetDataPublisherEvent aEvent, void *aContext)

This function pointer type defines the callback used to notify when a "DNS/SRP Service" entry is added to or removed from the Thread Network Data.

typedef void(*
otNetDataPrefixPublisherCallback)(otNetDataPublisherEvent aEvent, const otIp6Prefix *aPrefix, void *aContext)

This function pointer type defines the callback used to notify when a prefix (on-mesh or external route) entry is added to or removed from the Thread Network Data.

typedef uint16_t

Used to iterate through Network Diagnostic TLV.

This structure represents a Network Diagnostic Connectivity value.

typedef struct otNetworkDiagRouteData

This structure represents a Network Diagnostic Route data.

typedef struct otNetworkDiagRoute

This structure represents a Network Diagnostic Route TLV value.

This structure represents a Network Diagnostic Mac Counters value.

This structure represents a Network Diagnostic Child Table Entry.

typedef struct otNetworkDiagTlv

This structure represents a Network Diagnostic TLV.

typedef void(*
otReceiveDiagnosticGetCallback)(otError aError, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext)

This function pointer is called when Network Diagnostic Get response is received.

typedef struct otLinkModeConfig

This structure represents an MLE Link Mode configuration.

typedef int16_t

Used to iterate through neighbor table.

typedef struct otLeaderData

This structure represents the Thread Leader Data.

typedef struct otIpCounters

This structure represents the IP level counters.

typedef struct otMleCounters

This structure represents the Thread MLE counters.

This structure represents the MLE Parent Response data.

typedef void(*

This callback informs the application that the detaching process has finished.

typedef void(*
otThreadParentResponseCallback)(otThreadParentResponseInfo *aInfo, void *aContext)

This function pointer is called every time an MLE Parent Response message is received.

This structure represents the Thread Discovery Request data.

typedef void(*
otThreadDiscoveryRequestCallback)(const otThreadDiscoveryRequestInfo *aInfo, void *aContext)

This function pointer is called every time an MLE Discovery Request message is received.

typedef void(*
otThreadAnycastLocatorCallback)(void *aContext, otError aError, const otIp6Address *aMeshLocalAddress, uint16_t aRloc16)

This function pointer type defines the callback to notify the outcome of a otThreadLocateAnycastDestination() request.

Functions#

otNetDataGet(otInstance *aInstance, bool aStable, uint8_t *aData, uint8_t *aDataLength)

Provide full or stable copy of the Partition's Thread Network Data.

uint8_t
otNetDataGetLength(otInstance *aInstance)

Get the current length (number of bytes) of Partition's Thread Network Data.

uint8_t
otNetDataGetMaxLength(otInstance *aInstance)

Get the maximum observed length of the Thread Network Data since OT stack initialization or since the last call to otNetDataResetMaxLength().

void
otNetDataResetMaxLength(otInstance *aInstance)

Reset the tracked maximum length of the Thread Network Data.

otNetDataGetNextOnMeshPrefix(otInstance *aInstance, otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig)

Get the next On Mesh Prefix in the partition's Network Data.

otNetDataGetNextRoute(otInstance *aInstance, otNetworkDataIterator *aIterator, otExternalRouteConfig *aConfig)

Get the next external route in the partition's Network Data.

otNetDataGetNextService(otInstance *aInstance, otNetworkDataIterator *aIterator, otServiceConfig *aConfig)

Get the next service in the partition's Network Data.

otNetDataGetNextLowpanContextInfo(otInstance *aInstance, otNetworkDataIterator *aIterator, otLowpanContextInfo *aContextInfo)

Get the next 6LoWPAN Context ID info in the partition's Network Data.

uint8_t
otNetDataGetVersion(otInstance *aInstance)

Get the Network Data Version.

uint8_t
otNetDataGetStableVersion(otInstance *aInstance)

Get the Stable Network Data Version.

otNetDataSteeringDataCheckJoiner(otInstance *aInstance, const otExtAddress *aEui64)

Check if the steering data includes a Joiner.

otNetDataSteeringDataCheckJoinerWithDiscerner(otInstance *aInstance, const struct otJoinerDiscerner *aDiscerner)

Check if the steering data includes a Joiner with a given discerner value.

bool
otNetDataContainsOmrPrefix(otInstance *aInstance, const otIp6Prefix *aPrefix)

Check whether a given Prefix can act as a valid OMR prefix and also the Leader's Network Data contains this prefix.

void
otNetDataPublishDnsSrpServiceAnycast(otInstance *aInstance, uint8_t aSequenceNUmber)

This function requests "DNS/SRP Service Anycast Address" to be published in the Thread Network Data.

void
otNetDataPublishDnsSrpServiceUnicast(otInstance *aInstance, const otIp6Address *aAddress, uint16_t aPort)

This function requests "DNS/SRP Service Unicast Address" to be published in the Thread Network Data.

void
otNetDataPublishDnsSrpServiceUnicastMeshLocalEid(otInstance *aInstance, uint16_t aPort)

This function requests "DNS/SRP Service Unicast Address" to be published in the Thread Network Data.

bool
otNetDataIsDnsSrpServiceAdded(otInstance *aInstance)

This function indicates whether or not currently the "DNS/SRP Service" entry is added to the Thread Network Data.

void
otNetDataSetDnsSrpServicePublisherCallback(otInstance *aInstance, otNetDataDnsSrpServicePublisherCallback aCallback, void *aContext)

This function sets a callback for notifying when a published "DNS/SRP Service" is actually added to or removed from the Thread Network Data.

void
otNetDataUnpublishDnsSrpService(otInstance *aInstance)

Unpublishes any previously added DNS/SRP (Anycast or Unicast) Service entry from the Thread Network Data.

otNetDataPublishOnMeshPrefix(otInstance *aInstance, const otBorderRouterConfig *aConfig)

This function requests an on-mesh prefix to be published in the Thread Network Data.

otNetDataPublishExternalRoute(otInstance *aInstance, const otExternalRouteConfig *aConfig)

This function requests an external route prefix to be published in the Thread Network Data.