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.

otNetDataReplacePublishedExternalRoute(otInstance *aInstance, const otIp6Prefix *aPrefix, const otExternalRouteConfig *aConfig)

This function replaces a previously published external route in the Thread Network Data.

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

This function indicates whether or not currently a published prefix entry (on-mesh or external route) is added to the Thread Network Data.

void
otNetDataSetPrefixPublisherCallback(otInstance *aInstance, otNetDataPrefixPublisherCallback aCallback, void *aContext)

This function sets a callback for notifying when a published prefix entry is actually added to or removed from the Thread Network Data.

otNetDataUnpublishPrefix(otInstance *aInstance, const otIp6Prefix *aPrefix)

Unpublishes a previously published On-Mesh or External Route Prefix.

otThreadGetNextDiagnosticTlv(const otMessage *aMessage, otNetworkDiagIterator *aIterator, otNetworkDiagTlv *aNetworkDiagTlv)

This function gets the next Network Diagnostic TLV in the message.

otThreadSendDiagnosticGet(otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount, otReceiveDiagnosticGetCallback aCallback, void *aCallbackContext)

Send a Network Diagnostic Get request.

otThreadSendDiagnosticReset(otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)

Send a Network Diagnostic Reset request.

const char *
otThreadGetVendorName(otInstance *aInstance)

Get the vendor name string.

const char *
otThreadGetVendorModel(otInstance *aInstance)

Get the vendor model string.

const char *
otThreadGetVendorSwVersion(otInstance *aInstance)

Get the vendor sw version string.

otThreadSetVendorName(otInstance *aInstance, const char *aVendorName)

Set the vendor name string.

otThreadSetVendorModel(otInstance *aInstance, const char *aVendorModel)

Set the vendor model string.

otThreadSetVendorSwVersion(otInstance *aInstance, const char *aVendorSwVersion)

Set the vendor software version string.

otThreadSetEnabled(otInstance *aInstance, bool aEnabled)

This function starts Thread protocol operation.

uint16_t

This function gets the Thread protocol version.

bool
otThreadIsSingleton(otInstance *aInstance)

This function indicates whether a node is the only router on the network.

otThreadDiscover(otInstance *aInstance, uint32_t aScanChannels, uint16_t aPanId, bool aJoiner, bool aEnableEui64Filtering, otHandleActiveScanResult aCallback, void *aCallbackContext)

This function starts a Thread Discovery scan.

bool
otThreadIsDiscoverInProgress(otInstance *aInstance)

This function determines if an MLE Thread Discovery is currently in progress.

otThreadSetJoinerAdvertisement(otInstance *aInstance, uint32_t aOui, const uint8_t *aAdvData, uint8_t aAdvDataLength)

This method sets the Thread Joiner Advertisement when discovering Thread network.

uint32_t
otThreadGetChildTimeout(otInstance *aInstance)

Gets the Thread Child Timeout (in seconds) used when operating in the Child role.

void
otThreadSetChildTimeout(otInstance *aInstance, uint32_t aTimeout)

Sets the Thread Child Timeout (in seconds) used when operating in the Child role.

otThreadGetExtendedPanId(otInstance *aInstance)

Gets the IEEE 802.15.4 Extended PAN ID.

otThreadSetExtendedPanId(otInstance *aInstance, const otExtendedPanId *aExtendedPanId)

Sets the IEEE 802.15.4 Extended PAN ID.

otThreadGetLeaderRloc(otInstance *aInstance, otIp6Address *aLeaderRloc)

This function returns a pointer to the Leader's RLOC.

otThreadGetLinkMode(otInstance *aInstance)

Get the MLE Link Mode configuration.

otThreadSetLinkMode(otInstance *aInstance, otLinkModeConfig aConfig)

Set the MLE Link Mode configuration.

void
otThreadGetNetworkKey(otInstance *aInstance, otNetworkKey *aNetworkKey)

Get the Thread Network Key.

otThreadGetNetworkKeyRef(otInstance *aInstance)

Get the otNetworkKeyRef for Thread Network Key.

otThreadSetNetworkKey(otInstance *aInstance, const otNetworkKey *aKey)

Set the Thread Network Key.

otThreadSetNetworkKeyRef(otInstance *aInstance, otNetworkKeyRef aKeyRef)

Set the Thread Network Key as a otNetworkKeyRef.

const otIp6Address *
otThreadGetRloc(otInstance *aInstance)

Gets the Thread Routing Locator (RLOC) address.

const otIp6Address *
otThreadGetMeshLocalEid(otInstance *aInstance)

Gets the Mesh Local EID address.

otThreadGetMeshLocalPrefix(otInstance *aInstance)

This function returns a pointer to the Mesh Local Prefix.

otThreadSetMeshLocalPrefix(otInstance *aInstance, const otMeshLocalPrefix *aMeshLocalPrefix)

This function sets the Mesh Local Prefix.

const otIp6Address *
otThreadGetLinkLocalIp6Address(otInstance *aInstance)

Gets the Thread link-local IPv6 address.

const otIp6Address *

Gets the Thread Link-Local All Thread Nodes multicast address.

const otIp6Address *

Gets the Thread Realm-Local All Thread Nodes multicast address.

otThreadGetServiceAloc(otInstance *aInstance, uint8_t aServiceId, otIp6Address *aServiceAloc)

This function retrieves the Service ALOC for given Service ID.

const char *
otThreadGetNetworkName(otInstance *aInstance)

Get the Thread Network Name.

otThreadSetNetworkName(otInstance *aInstance, const char *aNetworkName)

Set the Thread Network Name.

const char *
otThreadGetDomainName(otInstance *aInstance)

Gets the Thread Domain Name.

otThreadSetDomainName(otInstance *aInstance, const char *aDomainName)

Sets the Thread Domain Name.

otThreadSetFixedDuaInterfaceIdentifier(otInstance *aInstance, const otIp6InterfaceIdentifier *aIid)

Sets or clears the Interface Identifier manually specified for the Thread Domain Unicast Address.

Gets the Interface Identifier manually specified for the Thread Domain Unicast Address.

uint32_t
otThreadGetKeySequenceCounter(otInstance *aInstance)

Gets the thrKeySequenceCounter.

void
otThreadSetKeySequenceCounter(otInstance *aInstance, uint32_t aKeySequenceCounter)

Sets the thrKeySequenceCounter.

uint32_t
otThreadGetKeySwitchGuardTime(otInstance *aInstance)

Gets the thrKeySwitchGuardTime (in hours).

void
otThreadSetKeySwitchGuardTime(otInstance *aInstance, uint32_t aKeySwitchGuardTime)

Sets the thrKeySwitchGuardTime (in hours).

otThreadBecomeDetached(otInstance *aInstance)

Detach from the Thread network.

otThreadBecomeChild(otInstance *aInstance)

Attempt to reattach as a child.

otThreadGetNextNeighborInfo(otInstance *aInstance, otNeighborInfoIterator *aIterator, otNeighborInfo *aInfo)

This function gets the next neighbor information.

otThreadGetDeviceRole(otInstance *aInstance)

Get the device role.

const char *
otThreadDeviceRoleToString(otDeviceRole aRole)

Convert the device role to human-readable string.

otThreadGetLeaderData(otInstance *aInstance, otLeaderData *aLeaderData)

This function get the Thread Leader Data.

uint8_t
otThreadGetLeaderRouterId(otInstance *aInstance)

Get the Leader's Router ID.

uint8_t
otThreadGetLeaderWeight(otInstance *aInstance)

Get the Leader's Weight.

uint32_t
otThreadGetPartitionId(otInstance *aInstance)

Get the Partition ID.

uint16_t
otThreadGetRloc16(otInstance *aInstance)

Get the RLOC16.

otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo)

The function retrieves diagnostic information for a Thread Router as parent.

otThreadGetParentAverageRssi(otInstance *aInstance, int8_t *aParentRssi)

The function retrieves the average RSSI for the Thread Parent.

otThreadGetParentLastRssi(otInstance *aInstance, int8_t *aLastRssi)

The function retrieves the RSSI of the last packet from the Thread Parent.

otThreadSearchForBetterParent(otInstance *aInstance)

Starts the process for child to search for a better parent while staying attached to its current parent.

const otIpCounters *
otThreadGetIp6Counters(otInstance *aInstance)

Gets the IPv6 counters.

void
otThreadResetIp6Counters(otInstance *aInstance)

Resets the IPv6 counters.

otThreadGetMleCounters(otInstance *aInstance)

Gets the Thread MLE counters.

void
otThreadResetMleCounters(otInstance *aInstance)

Resets the Thread MLE counters.

void
otThreadRegisterParentResponseCallback(otInstance *aInstance, otThreadParentResponseCallback aCallback, void *aContext)

This function registers a callback to receive MLE Parent Response data.

void
otThreadSetDiscoveryRequestCallback(otInstance *aInstance, otThreadDiscoveryRequestCallback aCallback, void *aContext)

This function sets a callback to receive MLE Discovery Request data.

otThreadLocateAnycastDestination(otInstance *aInstance, const otIp6Address *aAnycastAddress, otThreadAnycastLocatorCallback aCallback, void *aContext)

This function requests the closest destination of a given anycast address to be located.

bool
otThreadIsAnycastLocateInProgress(otInstance *aInstance)

This function indicates whether an anycast locate request is currently in progress.

void
otThreadSendAddressNotification(otInstance *aInstance, otIp6Address *aDestination, otIp6Address *aTarget, otIp6InterfaceIdentifier *aMlIid)

This function sends a Proactive Address Notification (ADDR_NTF.ntf) message.

otThreadSendProactiveBackboneNotification(otInstance *aInstance, otIp6Address *aTarget, otIp6InterfaceIdentifier *aMlIid, uint32_t aTimeSinceLastTransaction)

This function sends a Proactive Backbone Notification (PRO_BB.ntf) message on the Backbone link.

otThreadDetachGracefully(otInstance *aInstance, otDetachGracefullyCallback aCallback, void *aContext)

This function notifies other nodes in the network (if any) and then stops Thread protocol operation.

void
otConvertDurationInSecondsToString(uint32_t aDuration, char *aBuffer, uint16_t aSize)

This function converts an uint32_t duration (in seconds) to a human-readable string.

Macros#

#define

Value to initialize otNetworkDataIterator.

#define

Max size of Service Data in bytes.

#define

Max size of Server Data in bytes. Theoretical limit, practically much lower.

#define

Maximum Number of Network Diagnostic TLV Types to Request or Reset.

#define

Size of Network Diagnostic Child Table entry.

#define

Initializer for otNetworkDiagIterator.

#define

Max length of Vendor Name TLV.

#define

Max length of Vendor Model TLV.

#define

Max length of Vendor SW Version TLV.

#define

Max length of Thread Stack Version TLV.

#define

Maximum value length of Thread Base TLV.

#define

Maximum Router ID.

#define

Initializer for otNeighborInfoIterator.

#define

Maximum AdvData Length of Joiner Advertisement.

#define

Recommended size for string representation of uint32_t duration in seconds.

Enumeration Documentation#

otRoutePreference#

otRoutePreference

Defines valid values for mPreference in otExternalRouteConfig and otBorderRouterConfig.

Enumerator
OT_ROUTE_PREFERENCE_LOW

Low route preference.

OT_ROUTE_PREFERENCE_MED

Medium route preference.

OT_ROUTE_PREFERENCE_HIGH

High route preference.


Definition at line 103 of file include/openthread/netdata.h

otNetDataPublisherEvent#

otNetDataPublisherEvent

This enumeration represents the events reported from the Publisher callbacks.

Enumerator
OT_NETDATA_PUBLISHER_EVENT_ENTRY_ADDED

Published entry is added to the Thread Network Data.

OT_NETDATA_PUBLISHER_EVENT_ENTRY_REMOVED

Published entry is removed from the Thread Network Data.


Definition at line 61 of file include/openthread/netdata_publisher.h

@6#

@6
Enumerator
OT_NETWORK_DIAGNOSTIC_TLV_EXT_ADDRESS

MAC Extended Address TLV.

OT_NETWORK_DIAGNOSTIC_TLV_SHORT_ADDRESS

Address16 TLV.

OT_NETWORK_DIAGNOSTIC_TLV_MODE

Mode TLV.

OT_NETWORK_DIAGNOSTIC_TLV_TIMEOUT

Timeout TLV (the maximum polling time period for SEDs)

OT_NETWORK_DIAGNOSTIC_TLV_CONNECTIVITY

Connectivity TLV.

OT_NETWORK_DIAGNOSTIC_TLV_ROUTE

Route64 TLV.

OT_NETWORK_DIAGNOSTIC_TLV_LEADER_DATA

Leader Data TLV.

OT_NETWORK_DIAGNOSTIC_TLV_NETWORK_DATA

Network Data TLV.

OT_NETWORK_DIAGNOSTIC_TLV_IP6_ADDR_LIST

IPv6 Address List TLV.

OT_NETWORK_DIAGNOSTIC_TLV_MAC_COUNTERS

MAC Counters TLV.

OT_NETWORK_DIAGNOSTIC_TLV_BATTERY_LEVEL

Battery Level TLV.

OT_NETWORK_DIAGNOSTIC_TLV_SUPPLY_VOLTAGE

Supply Voltage TLV.

OT_NETWORK_DIAGNOSTIC_TLV_CHILD_TABLE

Child Table TLV.

OT_NETWORK_DIAGNOSTIC_TLV_CHANNEL_PAGES

Channel Pages TLV.

OT_NETWORK_DIAGNOSTIC_TLV_TYPE_LIST

Type List TLV.

OT_NETWORK_DIAGNOSTIC_TLV_MAX_CHILD_TIMEOUT

Max Child Timeout TLV.

OT_NETWORK_DIAGNOSTIC_TLV_VERSION

Version TLV.

OT_NETWORK_DIAGNOSTIC_TLV_VENDOR_NAME

Vendor Name TLV.

OT_NETWORK_DIAGNOSTIC_TLV_VENDOR_MODEL

Vendor Model TLV.

OT_NETWORK_DIAGNOSTIC_TLV_VENDOR_SW_VERSION

Vendor SW Version TLV.

OT_NETWORK_DIAGNOSTIC_TLV_THREAD_STACK_VERSION

Thread Stack Version TLV.


Definition at line 67 of file include/openthread/netdiag.h

otDeviceRole#

otDeviceRole

Represents a Thread device role.

Enumerator
OT_DEVICE_ROLE_DISABLED

The Thread stack is disabled.

OT_DEVICE_ROLE_DETACHED

Not currently participating in a Thread network/partition.

OT_DEVICE_ROLE_CHILD

The Thread Child role.

OT_DEVICE_ROLE_ROUTER

The Thread Router role.

OT_DEVICE_ROLE_LEADER

The Thread Leader role.


Definition at line 67 of file include/openthread/thread.h

Typedef Documentation#

otNetworkDataIterator#

typedef uint32_t otNetworkDataIterator

Used to iterate through Network Data information.


Definition at line 53 of file include/openthread/netdata.h

otBorderRouterConfig#

typedef struct otBorderRouterConfig otBorderRouterConfig

This structure represents a Border Router configuration.


Definition at line 72 of file include/openthread/netdata.h

otLowpanContextInfo#

typedef struct otLowpanContextInfo otLowpanContextInfo

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


Definition at line 83 of file include/openthread/netdata.h

otExternalRouteConfig#

typedef struct otExternalRouteConfig otExternalRouteConfig

This structure represents an External Route configuration.


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

otRoutePreference#

typedef enum otRoutePreference otRoutePreference

Defines valid values for mPreference in otExternalRouteConfig and otBorderRouterConfig.


Definition at line 108 of file include/openthread/netdata.h

otServerConfig#

typedef struct otServerConfig otServerConfig

This structure represents a Server configuration.


Definition at line 123 of file include/openthread/netdata.h

otServiceConfig#

typedef struct otServiceConfig otServiceConfig

This structure represents a Service configuration.


Definition at line 136 of file include/openthread/netdata.h

otNetDataPublisherEvent#

typedef enum otNetDataPublisherEvent otNetDataPublisherEvent

This enumeration represents the events reported from the Publisher callbacks.


Definition at line 65 of file include/openthread/netdata_publisher.h

otNetDataDnsSrpServicePublisherCallback#

typedef void(* otNetDataDnsSrpServicePublisherCallback) (otNetDataPublisherEvent aEvent, void *aContext) )(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.

Parameters
[in]aEvent

Indicates the event (whether the entry was added or removed).

[in]aContext

A pointer to application-specific context.

On remove the callback is invoked independent of whether the entry is removed by Publisher (e.g., when there are too many similar entries already present in the Network Data) or through an explicit call to unpublish the entry (i.e., a call to otNetDataUnpublishDnsSrpService()).


Definition at line 79 of file include/openthread/netdata_publisher.h

otNetDataPrefixPublisherCallback#

typedef void(* otNetDataPrefixPublisherCallback) (otNetDataPublisherEvent aEvent, const otIp6Prefix *aPrefix, void *aContext) )(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.

Parameters
[in]aEvent

Indicates the event (whether the entry was added or removed).

[in]aPrefix

A pointer to the prefix entry.

[in]aContext

A pointer to application-specific context.

On remove the callback is invoked independent of whether the entry is removed by Publisher (e.g., when there are too many similar entries already present in the Network Data) or through an explicit call to unpublish the entry.


Definition at line 93 of file include/openthread/netdata_publisher.h

otNetworkDiagIterator#

typedef uint16_t otNetworkDiagIterator

Used to iterate through Network Diagnostic TLV.


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

otNetworkDiagConnectivity#

typedef struct otNetworkDiagConnectivity otNetworkDiagConnectivity

This structure represents a Network Diagnostic Connectivity value.


Definition at line 149 of file include/openthread/netdiag.h

otNetworkDiagRouteData#

typedef struct otNetworkDiagRouteData otNetworkDiagRouteData

This structure represents a Network Diagnostic Route data.


Definition at line 161 of file include/openthread/netdiag.h

otNetworkDiagRoute#

typedef struct otNetworkDiagRoute otNetworkDiagRoute

This structure represents a Network Diagnostic Route TLV value.


Definition at line 183 of file include/openthread/netdiag.h

otNetworkDiagMacCounters#

typedef struct otNetworkDiagMacCounters otNetworkDiagMacCounters

This structure represents a Network Diagnostic Mac Counters value.

See RFC 2863 for definitions of member fields.


Definition at line 202 of file include/openthread/netdiag.h

otNetworkDiagChildEntry#

typedef struct otNetworkDiagChildEntry otNetworkDiagChildEntry

This structure represents a Network Diagnostic Child Table Entry.


Definition at line 232 of file include/openthread/netdiag.h

otNetworkDiagTlv#

typedef struct otNetworkDiagTlv otNetworkDiagTlv

This structure represents a Network Diagnostic TLV.


Definition at line 285 of file include/openthread/netdiag.h

otReceiveDiagnosticGetCallback#

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

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

Parameters
[in]aError

The error when failed to get the response.

[in]aMessage

A pointer to the message buffer containing the received Network Diagnostic Get response payload. Available only when aError is OT_ERROR_NONE.

[in]aMessageInfo

A pointer to the message info for aMessage. Available only when aError is OT_ERROR_NONE.

[in]aContext

A pointer to application-specific context.


Definition at line 319 of file include/openthread/netdiag.h

otLinkModeConfig#

typedef struct otLinkModeConfig otLinkModeConfig

This structure represents an MLE Link Mode configuration.


Definition at line 84 of file include/openthread/thread.h

otNeighborInfoIterator#

typedef int16_t otNeighborInfoIterator

Used to iterate through neighbor table.


Definition at line 113 of file include/openthread/thread.h

otLeaderData#

typedef struct otLeaderData otLeaderData

This structure represents the Thread Leader Data.


Definition at line 126 of file include/openthread/thread.h

otIpCounters#

typedef struct otIpCounters otIpCounters

This structure represents the IP level counters.


Definition at line 164 of file include/openthread/thread.h

otMleCounters#

typedef struct otMleCounters otMleCounters

This structure represents the Thread MLE counters.


Definition at line 203 of file include/openthread/thread.h

otThreadParentResponseInfo#

typedef struct otThreadParentResponseInfo otThreadParentResponseInfo

This structure represents the MLE Parent Response data.


Definition at line 219 of file include/openthread/thread.h

otDetachGracefullyCallback#

typedef void(* otDetachGracefullyCallback) (void *aContext) )(void *aContext)

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

Parameters
[in]aContext

A pointer to application-specific context.


Definition at line 227 of file include/openthread/thread.h

otThreadParentResponseCallback#

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

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

Parameters
[in]aInfo

A pointer to a location on stack holding the stats data.

[in]aContext

A pointer to callback client-specific context.

This is used in otThreadRegisterParentResponseCallback().


Definition at line 932 of file include/openthread/thread.h

otThreadDiscoveryRequestInfo#

typedef struct otThreadDiscoveryRequestInfo otThreadDiscoveryRequestInfo

This structure represents the Thread Discovery Request data.


Definition at line 957 of file include/openthread/thread.h

otThreadDiscoveryRequestCallback#

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

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

Parameters
[in]aInfo

A pointer to the Discovery Request info data.

[in]aContext

A pointer to callback application-specific context.


Definition at line 966 of file include/openthread/thread.h

otThreadAnycastLocatorCallback#

typedef void(* otThreadAnycastLocatorCallback) (void *aContext, otError aError, const otIp6Address *aMeshLocalAddress, uint16_t aRloc16) )(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.

Parameters
[in]aContext

A pointer to an arbitrary context (provided when callback is registered).

[in]aError

The error when handling the request. OT_ERROR_NONE indicates success. OT_ERROR_RESPONSE_TIMEOUT indicates a destination could not be found. OT_ERROR_ABORT indicates the request was aborted.

[in]aMeshLocalAddress

A pointer to the mesh-local EID of the closest destination of the anycast address when aError is OT_ERROR_NONE, NULL otherwise.

[in]aRloc16

The RLOC16 of the destination if found, otherwise invalid RLOC16 (0xfffe).


Definition at line 993 of file include/openthread/thread.h

Function Documentation#

otNetDataGet#

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

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aStable

TRUE when copying the stable version, FALSE when copying the full version.

[out]aData

A pointer to the data buffer.

[inout]aDataLength

On entry, size of the data buffer pointed to by aData. On exit, number of copied bytes.


Definition at line 151 of file include/openthread/netdata.h

otNetDataGetLength#

uint8_t otNetDataGetLength (otInstance * aInstance)

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The length of the Network Data.


Definition at line 161 of file include/openthread/netdata.h

otNetDataGetMaxLength#

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The maximum length of the Network Data (high water mark for Network Data length).


Definition at line 172 of file include/openthread/netdata.h

otNetDataResetMaxLength#

void otNetDataResetMaxLength (otInstance * aInstance)

Reset the tracked maximum length of the Thread Network Data.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

See Also


Definition at line 182 of file include/openthread/netdata.h

otNetDataGetNextOnMeshPrefix#

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

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[inout]aIterator

A pointer to the Network Data iterator context. To get the first on-mesh entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT.

[out]aConfig

A pointer to where the On Mesh Prefix information will be placed.


Definition at line 196 of file include/openthread/netdata.h

otNetDataGetNextRoute#

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

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[inout]aIterator

A pointer to the Network Data iterator context. To get the first external route entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT.

[out]aConfig

A pointer to where the External Route information will be placed.


Definition at line 212 of file include/openthread/netdata.h

otNetDataGetNextService#

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

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[inout]aIterator

A pointer to the Network Data iterator context. To get the first service entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT.

[out]aConfig

A pointer to where the service information will be placed.


Definition at line 226 of file include/openthread/netdata.h

otNetDataGetNextLowpanContextInfo#

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

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[inout]aIterator

A pointer to the Network Data iterator. To get the first service entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT.

[out]aContextInfo

A pointer to where the retrieved 6LoWPAN Context ID information will be placed.


Definition at line 240 of file include/openthread/netdata.h

otNetDataGetVersion#

uint8_t otNetDataGetVersion (otInstance * aInstance)

Get the Network Data Version.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Network Data Version.


Definition at line 252 of file include/openthread/netdata.h

otNetDataGetStableVersion#

uint8_t otNetDataGetStableVersion (otInstance * aInstance)

Get the Stable Network Data Version.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Stable Network Data Version.


Definition at line 262 of file include/openthread/netdata.h

otNetDataSteeringDataCheckJoiner#

otError otNetDataSteeringDataCheckJoiner (otInstance * aInstance, const otExtAddress * aEui64)

Check if the steering data includes a Joiner.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEui64

A pointer to the Joiner's IEEE EUI-64.


Definition at line 275 of file include/openthread/netdata.h

otNetDataSteeringDataCheckJoinerWithDiscerner#

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

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDiscerner

A pointer to the Joiner Discerner.


Definition at line 291 of file include/openthread/netdata.h

otNetDataContainsOmrPrefix#

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.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aPrefix

A pointer to the IPv6 prefix.

Returns

  • Whether aPrefix is a valid OMR prefix and Leader's Network Data contains the OMR prefix aPrefix.

Note

  • This API is only available when OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE is used.


Definition at line 305 of file include/openthread/netdata.h

otNetDataPublishDnsSrpServiceAnycast#

void otNetDataPublishDnsSrpServiceAnycast (otInstance * aInstance, uint8_t aSequenceNUmber)

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aSequenceNUmber

The sequence number of DNS/SRP Anycast Service.

This function requires the feature OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE to be enabled.

A call to this function will remove and replace any previous "DNS/SRP Service" entry that was being published (from earlier call to any of otNetDataPublishDnsSrpService{Type}() functions).


Definition at line 109 of file include/openthread/netdata_publisher.h

otNetDataPublishDnsSrpServiceUnicast#

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.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aAddress

The DNS/SRP server address to publish (MUST NOT be NULL).

[in]aPort

The SRP server port number to publish.

This function requires the feature OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE to be enabled.

A call to this function will remove and replace any previous "DNS/SRP Service" entry that was being published (from earlier call to any of otNetDataPublishDnsSrpService{Type}() functions).

This function publishes the "DNS/SRP Service Unicast Address" by including the address and port info in the Service TLV data.


Definition at line 127 of file include/openthread/netdata_publisher.h

otNetDataPublishDnsSrpServiceUnicastMeshLocalEid#

void otNetDataPublishDnsSrpServiceUnicastMeshLocalEid (otInstance * aInstance, uint16_t aPort)

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aPort

The SRP server port number to publish.

This function requires the feature OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE to be enabled.

A call to this function will remove and replace any previous "DNS/SRP Service" entry that was being published (from earlier call to any of otNetDataPublishDnsSrpService{Type}() functions).

Unlike otNetDataPublishDnsSrpServiceUnicast() which requires the published address to be given and includes the info in the Service TLV data, this function uses the device's mesh-local EID and includes the info in the Server TLV data.


Definition at line 145 of file include/openthread/netdata_publisher.h

otNetDataIsDnsSrpServiceAdded#

bool otNetDataIsDnsSrpServiceAdded (otInstance * aInstance)

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

This function requires the feature OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE to be enabled.


Definition at line 158 of file include/openthread/netdata_publisher.h

otNetDataSetDnsSrpServicePublisherCallback#

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.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aCallback

The callback function pointer (can be NULL if not needed).

[in]aContext

A pointer to application-specific context (used when aCallback is invoked).

A subsequent call to this function replaces any previously set callback function.

This function requires the feature OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE to be enabled.


Definition at line 173 of file include/openthread/netdata_publisher.h

otNetDataUnpublishDnsSrpService#

void otNetDataUnpublishDnsSrpService (otInstance * aInstance)

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE must be enabled.


Definition at line 186 of file include/openthread/netdata_publisher.h

otNetDataPublishOnMeshPrefix#

otError otNetDataPublishOnMeshPrefix (otInstance * aInstance, const otBorderRouterConfig * aConfig)

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aConfig

The on-mesh prefix config to publish (MUST NOT be NULL).

This function requires the feature OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE to be enabled.

Only stable entries can be published (i.e.,aConfig.mStable MUST be TRUE).

A subsequent call to this method will replace a previous request for the same prefix. In particular, if the new call only changes the flags (e.g., preference level) and the prefix is already added in the Network Data, the change to flags is immediately reflected in the Network Data. This ensures that existing entries in the Network Data are not abruptly removed. Note that a change in the preference level can potentially later cause the entry to be removed from the Network Data after determining there are other nodes that are publishing the same prefix with the same or higher preference.


Definition at line 213 of file include/openthread/netdata_publisher.h

otNetDataPublishExternalRoute#

otError otNetDataPublishExternalRoute (otInstance * aInstance, const otExternalRouteConfig * aConfig)

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

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aConfig

The external route config to publish (MUST NOT be NULL).

This function requires the feature OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE to be enabled.

Only stable entries can be published (i.e.,aConfig.mStable MUST be TRUE).

A subsequent call to this method will replace a previous request for the same prefix. In particular, if the new call only changes the flags (e.g., preference level) and the prefix is already added in the Network Data, the change to flags is immediately reflected in the Network Data. This ensures that existing entries in the Network Data are not abruptly removed. Note that a change in the preference level can potentially later cause the entry to be removed from the Network Data after determining there are other nodes that are publishing the same prefix with the same or higher preference.


Definition at line 238 of file include/openthread/netdata_publisher.h

otNetDataReplacePublishedExternalRoute#

otError otNetDataReplacePublishedExternalRoute (otInstance * aInstance, const otIp6Prefix * aPrefix, const otExternalRouteConfig * aConfig)

This function replaces a previously published external route in the Thread Network Data.

Parameters
[in]aInstance

The previously published external route prefix to replace.

[in]aPrefix

The external route config to publish.

[in]aConfig

The requester (kFromUser or kFromRoutingManager module).

This function requires the feature OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE to be enabled.

If there is no previously published external route matching aPrefix, this function behaves similarly to otNetDataPublishExternalRoute(), i.e., it will start the process of publishing aConfig as an external route in the Thread Network Data.

If there is a previously published route entry matching aPrefix, it will be replaced with the new prefix from aConfig.

  • If the aPrefix was already added in the Network Data, the change to the new prefix in aConfig is immediately reflected in the Network Data. This ensures that route entries in the Network Data are not abruptly removed and the transition from aPrefix to the new prefix is smooth.

  • If the old published aPrefix was not added in the Network Data, it will be replaced with the new aConfig prefix but it will not be immediately added. Instead, it will start the process of publishing it in the Network Data (monitoring the Network Data to determine when/if to add the prefix, depending on the number of similar prefixes present in the Network Data).


Definition at line 272 of file include/openthread/netdata_publisher.h

otNetDataIsPrefixAdded#

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

This function indicates whether or not currently a published prefix entry (on-mesh or external route) is added to the Thread Network Data.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aPrefix

A pointer to the prefix (MUST NOT be NULL).

This function requires the feature OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE to be enabled.


Definition at line 289 of file include/openthread/netdata_publisher.h

otNetDataSetPrefixPublisherCallback#

void otNetDataSetPrefixPublisherCallback (otInstance * aInstance, otNetDataPrefixPublisherCallback aCallback, void * aContext)

This function sets a callback for notifying when a published prefix entry is actually added to or removed from the Thread Network Data.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aCallback

The callback function pointer (can be NULL if not needed).

[in]aContext

A pointer to application-specific context (used when aCallback is invoked).

A subsequent call to this function replaces any previously set callback function.

This function requires the feature OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE to be enabled.


Definition at line 304 of file include/openthread/netdata_publisher.h

otNetDataUnpublishPrefix#

otError otNetDataUnpublishPrefix (otInstance * aInstance, const otIp6Prefix * aPrefix)

Unpublishes a previously published On-Mesh or External Route Prefix.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aPrefix

The prefix to unpublish (MUST NOT be NULL).

OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE must be enabled.


Definition at line 320 of file include/openthread/netdata_publisher.h

otThreadGetNextDiagnosticTlv#

otError otThreadGetNextDiagnosticTlv (const otMessage * aMessage, otNetworkDiagIterator * aIterator, otNetworkDiagTlv * aNetworkDiagTlv)

This function gets the next Network Diagnostic TLV in the message.

Parameters
[in]aMessage

A pointer to a message.

[inout]aIterator

A pointer to the Network Diagnostic iterator context. To get the first Network Diagnostic TLV it should be set to OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT.

[out]aNetworkDiagTlv

A pointer to where the Network Diagnostic TLV information will be placed.

Requires OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE.

@Note A subsequent call to this function is allowed only when current return value is OT_ERROR_NONE.


Definition at line 304 of file include/openthread/netdiag.h

otThreadSendDiagnosticGet#

otError otThreadSendDiagnosticGet (otInstance * aInstance, const otIp6Address * aDestination, const uint8_t aTlvTypes, uint8_t aCount, otReceiveDiagnosticGetCallback aCallback, void * aCallbackContext)

Send a Network Diagnostic Get request.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDestination

A pointer to destination address.

[in]aTlvTypes

An array of Network Diagnostic TLV types.

[in]aCount

Number of types in aTlvTypes.

[in]aCallback

A pointer to a function that is called when Network Diagnostic Get response is received or NULL to disable the callback.

[in]aCallbackContext

A pointer to application-specific context.

Requires OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE.


Definition at line 341 of file include/openthread/netdiag.h

otThreadSendDiagnosticReset#

otError otThreadSendDiagnosticReset (otInstance * aInstance, const otIp6Address * aDestination, const uint8_t aTlvTypes, uint8_t aCount)

Send a Network Diagnostic Reset request.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDestination

A pointer to destination address.

[in]aTlvTypes

An array of Network Diagnostic TLV types. Currently only Type 9 is allowed.

[in]aCount

Number of types in aTlvTypes

Requires OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE.


Definition at line 362 of file include/openthread/netdiag.h

otThreadGetVendorName#

const char * otThreadGetVendorName (otInstance * aInstance)

Get the vendor name string.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The vendor name string.


Definition at line 375 of file include/openthread/netdiag.h

otThreadGetVendorModel#

const char * otThreadGetVendorModel (otInstance * aInstance)

Get the vendor model string.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The vendor model string.


Definition at line 385 of file include/openthread/netdiag.h

otThreadGetVendorSwVersion#

const char * otThreadGetVendorSwVersion (otInstance * aInstance)

Get the vendor sw version string.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The vendor sw version string.


Definition at line 395 of file include/openthread/netdiag.h

otThreadSetVendorName#

otError otThreadSetVendorName (otInstance * aInstance, const char * aVendorName)

Set the vendor name string.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aVendorName

The vendor name string.

Requires OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE.

aVendorName should be UTF8 with max length of 32 chars (MAX_VENDOR_NAME_TLV_LENGTH). Maximum length does not include the null \0 character.


Definition at line 412 of file include/openthread/netdiag.h

otThreadSetVendorModel#

otError otThreadSetVendorModel (otInstance * aInstance, const char * aVendorModel)

Set the vendor model string.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aVendorModel

The vendor model string.

Requires OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE.

aVendorModel should be UTF8 with max length of 32 chars (MAX_VENDOR_MODEL_TLV_LENGTH). Maximum length does not include the null \0 character.


Definition at line 429 of file include/openthread/netdiag.h

otThreadSetVendorSwVersion#

otError otThreadSetVendorSwVersion (otInstance * aInstance, const char * aVendorSwVersion)

Set the vendor software version string.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aVendorSwVersion

The vendor software version string.

Requires OPENTHREAD_CONFIG_NET_DIAG_VENDOR_INFO_SET_API_ENABLE.

aVendorSwVersion should be UTF8 with max length of 16 chars(MAX_VENDOR_SW_VERSION_TLV_LENGTH). Maximum length does not include the null \0 character.


Definition at line 446 of file include/openthread/netdiag.h

otThreadSetEnabled#

otError otThreadSetEnabled (otInstance * aInstance, bool aEnabled)

This function starts Thread protocol operation.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEnabled

TRUE if Thread is enabled, FALSE otherwise.

The interface must be up when calling this function.

Calling this function with aEnabled set to FALSE stops any ongoing processes of detaching started by otThreadDetachGracefully(). Its callback will be called.


Definition at line 244 of file include/openthread/thread.h

otThreadGetVersion#

uint16_t otThreadGetVersion (void )

This function gets the Thread protocol version.

Parameters
N/A

Returns

  • the Thread protocol version.


Definition at line 252 of file include/openthread/thread.h

otThreadIsSingleton#

bool otThreadIsSingleton (otInstance * aInstance)

This function indicates whether a node is the only router on the network.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 263 of file include/openthread/thread.h

otThreadDiscover#

otError otThreadDiscover (otInstance * aInstance, uint32_t aScanChannels, uint16_t aPanId, bool aJoiner, bool aEnableEui64Filtering, otHandleActiveScanResult aCallback, void * aCallbackContext)

This function starts a Thread Discovery scan.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aScanChannels

A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK).

[in]aPanId

The PAN ID filter (set to Broadcast PAN to disable filter).

[in]aJoiner

Value of the Joiner Flag in the Discovery Request TLV.

[in]aEnableEui64Filtering

TRUE to filter responses on EUI-64, FALSE otherwise.

[in]aCallback

A pointer to a function called on receiving an MLE Discovery Response or scan completes.

[in]aCallbackContext

A pointer to application-specific context.

Note

  • A successful call to this function enables the rx-on-when-idle mode for the entire scan procedure.


Definition at line 285 of file include/openthread/thread.h

otThreadIsDiscoverInProgress#

bool otThreadIsDiscoverInProgress (otInstance * aInstance)

This function determines if an MLE Thread Discovery is currently in progress.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 299 of file include/openthread/thread.h

otThreadSetJoinerAdvertisement#

otError otThreadSetJoinerAdvertisement (otInstance * aInstance, uint32_t aOui, const uint8_t * aAdvData, uint8_t aAdvDataLength)

This method sets the Thread Joiner Advertisement when discovering Thread network.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aOui

The Vendor IEEE OUI value that will be included in the Joiner Advertisement. Only the least significant 3 bytes will be used, and the most significant byte will be ignored.

[in]aAdvData

A pointer to the AdvData that will be included in the Joiner Advertisement.

[in]aAdvDataLength

The length of AdvData in bytes.

Thread Joiner Advertisement is used to allow a Joiner to advertise its own application-specific information (such as Vendor ID, Product ID, Discriminator, etc.) via a newly-proposed Joiner Advertisement TLV, and to make this information available to Commissioners or Commissioner Candidates without human interaction.


Definition at line 318 of file include/openthread/thread.h

otThreadGetChildTimeout#

uint32_t otThreadGetChildTimeout (otInstance * aInstance)

Gets the Thread Child Timeout (in seconds) used when operating in the Child role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Thread Child Timeout value in seconds.

See Also


Definition at line 335 of file include/openthread/thread.h

otThreadSetChildTimeout#

void otThreadSetChildTimeout (otInstance * aInstance, uint32_t aTimeout)

Sets the Thread Child Timeout (in seconds) used when operating in the Child role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aTimeout

The timeout value in seconds.

See Also


Definition at line 346 of file include/openthread/thread.h

otThreadGetExtendedPanId#

const otExtendedPanId * otThreadGetExtendedPanId (otInstance * aInstance)

Gets the IEEE 802.15.4 Extended PAN ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the IEEE 802.15.4 Extended PAN ID.

See Also


Definition at line 358 of file include/openthread/thread.h

otThreadSetExtendedPanId#

otError otThreadSetExtendedPanId (otInstance * aInstance, const otExtendedPanId * aExtendedPanId)

Sets the IEEE 802.15.4 Extended PAN ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aExtendedPanId

A pointer to the IEEE 802.15.4 Extended PAN ID.

Note

  • Can only be called while Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.

See Also


Definition at line 376 of file include/openthread/thread.h

otThreadGetLeaderRloc#

otError otThreadGetLeaderRloc (otInstance * aInstance, otIp6Address * aLeaderRloc)

This function returns a pointer to the Leader's RLOC.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aLeaderRloc

A pointer to the Leader's RLOC.


Definition at line 389 of file include/openthread/thread.h

otThreadGetLinkMode#

otLinkModeConfig otThreadGetLinkMode (otInstance * aInstance)

Get the MLE Link Mode configuration.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The MLE Link Mode configuration.

See Also


Definition at line 401 of file include/openthread/thread.h

otThreadSetLinkMode#

otError otThreadSetLinkMode (otInstance * aInstance, otLinkModeConfig aConfig)

Set the MLE Link Mode configuration.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aConfig

A pointer to the Link Mode configuration.

See Also


Definition at line 414 of file include/openthread/thread.h

otThreadGetNetworkKey#

void otThreadGetNetworkKey (otInstance * aInstance, otNetworkKey * aNetworkKey)

Get the Thread Network Key.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aNetworkKey

A pointer to an otNetworkKey to return the Thread Network Key.

See Also


Definition at line 425 of file include/openthread/thread.h

otThreadGetNetworkKeyRef#

otNetworkKeyRef otThreadGetNetworkKeyRef (otInstance * aInstance)

Get the otNetworkKeyRef for Thread Network Key.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

This function requires the build-time feature OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE to be enabled.

Returns

  • Reference to the Thread Network Key stored in memory.

See Also


Definition at line 439 of file include/openthread/thread.h

otThreadSetNetworkKey#

otError otThreadSetNetworkKey (otInstance * aInstance, const otNetworkKey * aKey)

Set the Thread Network Key.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aKey

A pointer to a buffer containing the Thread Network Key.

This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.

See Also


Definition at line 457 of file include/openthread/thread.h

otThreadSetNetworkKeyRef#

otError otThreadSetNetworkKeyRef (otInstance * aInstance, otNetworkKeyRef aKeyRef)

Set the Thread Network Key as a otNetworkKeyRef.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aKeyRef

Reference to the Thread Network Key.

This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.

This function requires the build-time feature OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE to be enabled.

See Also


Definition at line 477 of file include/openthread/thread.h

otThreadGetRloc#

const otIp6Address * otThreadGetRloc (otInstance * aInstance)

Gets the Thread Routing Locator (RLOC) address.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the Thread Routing Locator (RLOC) address.


Definition at line 487 of file include/openthread/thread.h

otThreadGetMeshLocalEid#

const otIp6Address * otThreadGetMeshLocalEid (otInstance * aInstance)

Gets the Mesh Local EID address.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the Mesh Local EID address.


Definition at line 497 of file include/openthread/thread.h

otThreadGetMeshLocalPrefix#

const otMeshLocalPrefix * otThreadGetMeshLocalPrefix (otInstance * aInstance)

This function returns a pointer to the Mesh Local Prefix.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the Mesh Local Prefix.


Definition at line 507 of file include/openthread/thread.h

otThreadSetMeshLocalPrefix#

otError otThreadSetMeshLocalPrefix (otInstance * aInstance, const otMeshLocalPrefix * aMeshLocalPrefix)

This function sets the Mesh Local Prefix.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aMeshLocalPrefix

A pointer to the Mesh Local Prefix.

This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.


Definition at line 523 of file include/openthread/thread.h

otThreadGetLinkLocalIp6Address#

const otIp6Address * otThreadGetLinkLocalIp6Address (otInstance * aInstance)

Gets the Thread link-local IPv6 address.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

The Thread link local address is derived using IEEE802.15.4 Extended Address as Interface Identifier.

Returns

  • A pointer to Thread link-local IPv6 address.


Definition at line 535 of file include/openthread/thread.h

otThreadGetLinkLocalAllThreadNodesMulticastAddress#

const otIp6Address * otThreadGetLinkLocalAllThreadNodesMulticastAddress (otInstance * aInstance)

Gets the Thread Link-Local All Thread Nodes multicast address.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

The address is a link-local Unicast Prefix-Based Multicast Address [RFC 3306], with:

  • flgs set to 3 (P = 1 and T = 1)

  • scop set to 2

  • plen set to 64

  • network prefix set to the Mesh Local Prefix

  • group ID set to 1

Returns

  • A pointer to Thread Link-Local All Thread Nodes multicast address.


Definition at line 552 of file include/openthread/thread.h

otThreadGetRealmLocalAllThreadNodesMulticastAddress#

const otIp6Address * otThreadGetRealmLocalAllThreadNodesMulticastAddress (otInstance * aInstance)

Gets the Thread Realm-Local All Thread Nodes multicast address.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

The address is a realm-local Unicast Prefix-Based Multicast Address [RFC 3306], with:

  • flgs set to 3 (P = 1 and T = 1)

  • scop set to 3

  • plen set to 64

  • network prefix set to the Mesh Local Prefix

  • group ID set to 1

Returns

  • A pointer to Thread Realm-Local All Thread Nodes multicast address.


Definition at line 569 of file include/openthread/thread.h

otThreadGetServiceAloc#

otError otThreadGetServiceAloc (otInstance * aInstance, uint8_t aServiceId, otIp6Address * aServiceAloc)

This function retrieves the Service ALOC for given Service ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aServiceId

Service ID to get ALOC for.

[out]aServiceAloc

A pointer to output the Service ALOC. MUST NOT BE NULL.


Definition at line 581 of file include/openthread/thread.h

otThreadGetNetworkName#

const char * otThreadGetNetworkName (otInstance * aInstance)

Get the Thread Network Name.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the Thread Network Name.

See Also


Definition at line 593 of file include/openthread/thread.h

otThreadSetNetworkName#

otError otThreadSetNetworkName (otInstance * aInstance, const char * aNetworkName)

Set the Thread Network Name.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aNetworkName

A pointer to the Thread Network Name.

This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.

See Also


Definition at line 611 of file include/openthread/thread.h

otThreadGetDomainName#

const char * otThreadGetDomainName (otInstance * aInstance)

Gets the Thread Domain Name.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Note

  • Available since Thread 1.2.

Returns

  • A pointer to the Thread Domain Name.

See Also


Definition at line 625 of file include/openthread/thread.h

otThreadSetDomainName#

otError otThreadSetDomainName (otInstance * aInstance, const char * aDomainName)

Sets the Thread Domain Name.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDomainName

A pointer to the Thread Domain Name.

Only succeeds when Thread protocols are disabled.

Note

  • Available since Thread 1.2.

See Also


Definition at line 641 of file include/openthread/thread.h

otThreadSetFixedDuaInterfaceIdentifier#

otError otThreadSetFixedDuaInterfaceIdentifier (otInstance * aInstance, const otIp6InterfaceIdentifier * aIid)

Sets or clears the Interface Identifier manually specified for the Thread Domain Unicast Address.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aIid

A pointer to the Interface Identifier to set or NULL to clear.

Available when OPENTHREAD_CONFIG_DUA_ENABLE is enabled.

Note

  • Only available since Thread 1.2.

See Also


Definition at line 658 of file include/openthread/thread.h

otThreadGetFixedDuaInterfaceIdentifier#

const otIp6InterfaceIdentifier * otThreadGetFixedDuaInterfaceIdentifier (otInstance * aInstance)

Gets the Interface Identifier manually specified for the Thread Domain Unicast Address.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Available when OPENTHREAD_CONFIG_DUA_ENABLE is enabled.

Note

  • Only available since Thread 1.2.

Returns

  • A pointer to the Interface Identifier which was set manually, or NULL if none was set.

See Also


Definition at line 674 of file include/openthread/thread.h

otThreadGetKeySequenceCounter#

uint32_t otThreadGetKeySequenceCounter (otInstance * aInstance)

Gets the thrKeySequenceCounter.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The thrKeySequenceCounter value.

See Also


Definition at line 686 of file include/openthread/thread.h

otThreadSetKeySequenceCounter#

void otThreadSetKeySequenceCounter (otInstance * aInstance, uint32_t aKeySequenceCounter)

Sets the thrKeySequenceCounter.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aKeySequenceCounter

The thrKeySequenceCounter value.

Note

  • This API is reserved for testing and demo purposes only. Changing settings with this API will render a production application non-compliant with the Thread Specification.

See Also


Definition at line 700 of file include/openthread/thread.h

otThreadGetKeySwitchGuardTime#

uint32_t otThreadGetKeySwitchGuardTime (otInstance * aInstance)

Gets the thrKeySwitchGuardTime (in hours).

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The thrKeySwitchGuardTime value (in hours).

See Also


Definition at line 712 of file include/openthread/thread.h

otThreadSetKeySwitchGuardTime#

void otThreadSetKeySwitchGuardTime (otInstance * aInstance, uint32_t aKeySwitchGuardTime)

Sets the thrKeySwitchGuardTime (in hours).

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aKeySwitchGuardTime

The thrKeySwitchGuardTime value (in hours).

Note

  • This API is reserved for testing and demo purposes only. Changing settings with this API will render a production application non-compliant with the Thread Specification.

See Also


Definition at line 726 of file include/openthread/thread.h

otThreadBecomeDetached#

otError otThreadBecomeDetached (otInstance * aInstance)

Detach from the Thread network.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 737 of file include/openthread/thread.h

otThreadBecomeChild#

otError otThreadBecomeChild (otInstance * aInstance)

Attempt to reattach as a child.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Note

  • This API is reserved for testing and demo purposes only. Changing settings with this API will render a production application non-compliant with the Thread Specification.


Definition at line 751 of file include/openthread/thread.h

otThreadGetNextNeighborInfo#

otError otThreadGetNextNeighborInfo (otInstance * aInstance, otNeighborInfoIterator * aIterator, otNeighborInfo * aInfo)

This function gets the next neighbor information.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[inout]aIterator

A pointer to the iterator context. To get the first neighbor entry it should be set to OT_NEIGHBOR_INFO_ITERATOR_INIT.

[out]aInfo

A pointer to the neighbor information.

It is used to go through the entries of the neighbor table.


Definition at line 767 of file include/openthread/thread.h

otThreadGetDeviceRole#

otDeviceRole otThreadGetDeviceRole (otInstance * aInstance)

Get the device role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 781 of file include/openthread/thread.h

otThreadDeviceRoleToString#

const char * otThreadDeviceRoleToString (otDeviceRole aRole)

Convert the device role to human-readable string.

Parameters
[in]aRole

The device role to convert.

Returns

  • A string representing aRole.


Definition at line 791 of file include/openthread/thread.h

otThreadGetLeaderData#

otError otThreadGetLeaderData (otInstance * aInstance, otLeaderData * aLeaderData)

This function get the Thread Leader Data.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aLeaderData

A pointer to where the leader data is placed.


Definition at line 803 of file include/openthread/thread.h

otThreadGetLeaderRouterId#

uint8_t otThreadGetLeaderRouterId (otInstance * aInstance)

Get the Leader's Router ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Leader's Router ID.


Definition at line 813 of file include/openthread/thread.h

otThreadGetLeaderWeight#

uint8_t otThreadGetLeaderWeight (otInstance * aInstance)

Get the Leader's Weight.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Leader's Weight.


Definition at line 823 of file include/openthread/thread.h

otThreadGetPartitionId#

uint32_t otThreadGetPartitionId (otInstance * aInstance)

Get the Partition ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Partition ID.


Definition at line 833 of file include/openthread/thread.h

otThreadGetRloc16#

uint16_t otThreadGetRloc16 (otInstance * aInstance)

Get the RLOC16.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The RLOC16.


Definition at line 843 of file include/openthread/thread.h

otThreadGetParentInfo#

otError otThreadGetParentInfo (otInstance * aInstance, otRouterInfo * aParentInfo)

The function retrieves diagnostic information for a Thread Router as parent.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aParentInfo

A pointer to where the parent router information is placed.


Definition at line 852 of file include/openthread/thread.h

otThreadGetParentAverageRssi#

otError otThreadGetParentAverageRssi (otInstance * aInstance, int8_t * aParentRssi)

The function retrieves the average RSSI for the Thread Parent.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aParentRssi

A pointer to where the parent RSSI should be placed.


Definition at line 861 of file include/openthread/thread.h

otThreadGetParentLastRssi#

otError otThreadGetParentLastRssi (otInstance * aInstance, int8_t * aLastRssi)

The function retrieves the RSSI of the last packet from the Thread Parent.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aLastRssi

A pointer to where the last RSSI should be placed.


Definition at line 874 of file include/openthread/thread.h

otThreadSearchForBetterParent#

otError otThreadSearchForBetterParent (otInstance * aInstance)

Starts the process for child to search for a better parent while staying attached to its current parent.

Parameters
N/AaInstance

Must be used when device is attached as a child.


Definition at line 885 of file include/openthread/thread.h

otThreadGetIp6Counters#

const otIpCounters * otThreadGetIp6Counters (otInstance * aInstance)

Gets the IPv6 counters.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the IPv6 counters.


Definition at line 895 of file include/openthread/thread.h

otThreadResetIp6Counters#

void otThreadResetIp6Counters (otInstance * aInstance)

Resets the IPv6 counters.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 903 of file include/openthread/thread.h

otThreadGetMleCounters#

const otMleCounters * otThreadGetMleCounters (otInstance * aInstance)

Gets the Thread MLE counters.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • A pointer to the Thread MLE counters.


Definition at line 913 of file include/openthread/thread.h

otThreadResetMleCounters#

void otThreadResetMleCounters (otInstance * aInstance)

Resets the Thread MLE counters.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 921 of file include/openthread/thread.h

otThreadRegisterParentResponseCallback#

void otThreadRegisterParentResponseCallback (otInstance * aInstance, otThreadParentResponseCallback aCallback, void * aContext)

This function registers a callback to receive MLE Parent Response data.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aCallback

A pointer to a function that is called upon receiving an MLE Parent Response message.

[in]aContext

A pointer to callback client-specific context.

This function requires OPENTHREAD_CONFIG_MLE_PARENT_RESPONSE_CALLBACK_API_ENABLE.


Definition at line 944 of file include/openthread/thread.h

otThreadSetDiscoveryRequestCallback#

void otThreadSetDiscoveryRequestCallback (otInstance * aInstance, otThreadDiscoveryRequestCallback aCallback, void * aContext)

This function sets a callback to receive MLE Discovery Request data.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aCallback

A pointer to a function that is called upon receiving an MLE Discovery Request message.

[in]aContext

A pointer to callback application-specific context.


Definition at line 976 of file include/openthread/thread.h

otThreadLocateAnycastDestination#

otError otThreadLocateAnycastDestination (otInstance * aInstance, const otIp6Address * aAnycastAddress, otThreadAnycastLocatorCallback aCallback, void * aContext)

This function requests the closest destination of a given anycast address to be located.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aAnycastAddress

The anycast address to locate. MUST NOT be NULL.

[in]aCallback

The callback function to report the result.

[in]aContext

An arbitrary context used with aCallback.

This function is only available when OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE is enabled.

If a previous request is ongoing, a subsequent call to this function will cancel and replace the earlier request.


Definition at line 1015 of file include/openthread/thread.h

otThreadIsAnycastLocateInProgress#

bool otThreadIsAnycastLocateInProgress (otInstance * aInstance)

This function indicates whether an anycast locate request is currently in progress.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

This function is only available when OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE is enabled.

Returns

  • TRUE if an anycast locate request is currently in progress, FALSE otherwise.


Definition at line 1030 of file include/openthread/thread.h

otThreadSendAddressNotification#

void otThreadSendAddressNotification (otInstance * aInstance, otIp6Address * aDestination, otIp6Address * aTarget, otIp6InterfaceIdentifier * aMlIid)

This function sends a Proactive Address Notification (ADDR_NTF.ntf) message.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDestination

The destination to send the ADDR_NTF.ntf message.

[in]aTarget

The target address of the ADDR_NTF.ntf message.

[in]aMlIid

The ML-IID of the ADDR_NTF.ntf message.

This function is only available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE is enabled.


Definition at line 1043 of file include/openthread/thread.h

otThreadSendProactiveBackboneNotification#

otError otThreadSendProactiveBackboneNotification (otInstance * aInstance, otIp6Address * aTarget, otIp6InterfaceIdentifier * aMlIid, uint32_t aTimeSinceLastTransaction)

This function sends a Proactive Backbone Notification (PRO_BB.ntf) message on the Backbone link.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aTarget

The target address of the PRO_BB.ntf message.

[in]aMlIid

The ML-IID of the PRO_BB.ntf message.

[in]aTimeSinceLastTransaction

Time since last transaction (in seconds).

This function is only available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE is enabled.


Definition at line 1062 of file include/openthread/thread.h

otThreadDetachGracefully#

otError otThreadDetachGracefully (otInstance * aInstance, otDetachGracefullyCallback aCallback, void * aContext)

This function notifies other nodes in the network (if any) and then stops Thread protocol operation.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aCallback

A pointer to a function that is called upon finishing detaching.

[in]aContext

A pointer to callback application-specific context.

It sends an Address Release if it's a router, or sets its child timeout to 0 if it's a child.


Definition at line 1080 of file include/openthread/thread.h

otConvertDurationInSecondsToString#

void otConvertDurationInSecondsToString (uint32_t aDuration, char * aBuffer, uint16_t aSize)

This function converts an uint32_t duration (in seconds) to a human-readable string.

Parameters
[in]aDuration

A duration interval in seconds.

[out]aBuffer

A pointer to a char array to output the string.

[in]aSize

The size of aBuffer (in bytes). Recommended to use OT_DURATION_STRING_SIZE.

This function requires OPENTHREAD_CONFIG_UPTIME_ENABLE to be enabled.

The string follows the format "<hh>:<mm>:<ss>" for hours, minutes, seconds (if duration is shorter than one day) or "<dd>d.<hh>:<mm>:<ss>" (if longer than a day).

If the resulting string does not fit in aBuffer (within its aSize characters), the string will be truncated but the outputted string is always null-terminated.

This function is intended for use with mAge or mConnectionTime in otNeighborInfo or otChildInfo structures.


Definition at line 1102 of file include/openthread/thread.h

Macro Definition Documentation#

OT_NETWORK_DATA_ITERATOR_INIT#

#define OT_NETWORK_DATA_ITERATOR_INIT
Value:
0

Value to initialize otNetworkDataIterator.


Definition at line 51 of file include/openthread/netdata.h

OT_SERVICE_DATA_MAX_SIZE#

#define OT_SERVICE_DATA_MAX_SIZE
Value:
252

Max size of Service Data in bytes.


Definition at line 110 of file include/openthread/netdata.h

OT_SERVER_DATA_MAX_SIZE#

#define OT_SERVER_DATA_MAX_SIZE
Value:
248

Max size of Server Data in bytes. Theoretical limit, practically much lower.


Definition at line 111 of file include/openthread/netdata.h

OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES#

#define OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES
Value:
19

Maximum Number of Network Diagnostic TLV Types to Request or Reset.


Definition at line 55 of file include/openthread/netdiag.h

OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_ENTRY_SIZE#

#define OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_ENTRY_SIZE
Value:
3

Size of Network Diagnostic Child Table entry.


Definition at line 60 of file include/openthread/netdiag.h

OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT#

#define OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT
Value:
0

Initializer for otNetworkDiagIterator.


Definition at line 65 of file include/openthread/netdiag.h

OT_NETWORK_DIAGNOSTIC_MAX_VENDOR_NAME_TLV_LENGTH#

#define OT_NETWORK_DIAGNOSTIC_MAX_VENDOR_NAME_TLV_LENGTH
Value:
32

Max length of Vendor Name TLV.


Definition at line 92 of file include/openthread/netdiag.h

OT_NETWORK_DIAGNOSTIC_MAX_VENDOR_MODEL_TLV_LENGTH#

#define OT_NETWORK_DIAGNOSTIC_MAX_VENDOR_MODEL_TLV_LENGTH
Value:
32

Max length of Vendor Model TLV.


Definition at line 93 of file include/openthread/netdiag.h

OT_NETWORK_DIAGNOSTIC_MAX_VENDOR_SW_VERSION_TLV_LENGTH#

#define OT_NETWORK_DIAGNOSTIC_MAX_VENDOR_SW_VERSION_TLV_LENGTH
Value:
16

Max length of Vendor SW Version TLV.


Definition at line 94 of file include/openthread/netdiag.h

OT_NETWORK_DIAGNOSTIC_MAX_THREAD_STACK_VERSION_TLV_LENGTH#

#define OT_NETWORK_DIAGNOSTIC_MAX_THREAD_STACK_VERSION_TLV_LENGTH
Value:
64

Max length of Thread Stack Version TLV.


Definition at line 95 of file include/openthread/netdiag.h

OT_NETWORK_BASE_TLV_MAX_LENGTH#

#define OT_NETWORK_BASE_TLV_MAX_LENGTH
Value:
254

Maximum value length of Thread Base TLV.


Definition at line 59 of file include/openthread/thread.h

OT_NETWORK_MAX_ROUTER_ID#

#define OT_NETWORK_MAX_ROUTER_ID
Value:
62

Maximum Router ID.


Definition at line 61 of file include/openthread/thread.h

OT_NEIGHBOR_INFO_ITERATOR_INIT#

#define OT_NEIGHBOR_INFO_ITERATOR_INIT
Value:
0

Initializer for otNeighborInfoIterator.


Definition at line 111 of file include/openthread/thread.h

OT_JOINER_ADVDATA_MAX_LENGTH#

#define OT_JOINER_ADVDATA_MAX_LENGTH
Value:
64

Maximum AdvData Length of Joiner Advertisement.


Definition at line 323 of file include/openthread/thread.h

OT_DURATION_STRING_SIZE#

#define OT_DURATION_STRING_SIZE
Value:
21

Recommended size for string representation of uint32_t duration in seconds.


Definition at line 1082 of file include/openthread/thread.h