General

This module includes functions for all Thread roles.

Classes

struct otMasterKey
This structure represents a Thread Master Key.
struct otNetworkName
This structure represents a Network Name.
struct otExtendedPanId
This structure represents an Extended PAN ID.
struct otPskc
This structure represents PSKc.
struct otSecurityPolicy
This structure represent Security Policy.
struct otOperationalDatasetComponents
This structure represents presence of different components in Active or Pending Operational Dataset.
struct otOperationalDataset
This structure represents an Active or Pending Operational Dataset.
struct otOperationalDatasetTlvs
This structure represents an Active or Pending Operational Dataset.
struct otBorderRouterConfig
This structure represents a Border Router configuration.
struct otExternalRouteConfig
This structure represents an External Route configuration.
struct otServerConfig
This structure represents a Server configuration.
struct otServiceConfig
This structure represents a Service configuration.
struct otNetworkDiagConnectivity
This structure represents a Network Diagnostic Connectivity value.
struct otNetworkDiagRouteData
This structure represents a Network Diagnostic Route data.
struct otNetworkDiagRoute
This structure represents a Network Diagnostic Route TLV value.
struct otNetworkDiagMacCounters
This structure represents a Network Diagnostic Mac Counters value.
struct otNetworkDiagChildEntry
This structure represents a Network Diagnostic Child Table Entry.
struct otNetworkDiagTlv
This structure represents a Network Diagnostic TLV.
struct otLinkModeConfig
This structure represents an MLE Link Mode configuration.
struct otNeighborInfo
This structure holds diagnostic information for a neighboring Thread node.
struct otLeaderData
This structure represents the Thread Leader Data.
struct otRouterInfo
This structure holds diagnostic information for a Thread Router.
struct otIpCounters
This structure represents the IP level counters.
struct otMleCounters
This structure represents the Thread MLE counters.
struct otThreadParentResponseInfo
This structure represents the MLE Parent Response data.
struct otThreadDiscoveryRequestInfo
This structure represents the Thread Discovery Request data.

Macros

#define OT_MASTER_KEY_SIZE 16
Size of the Thread Master Key (bytes)
#define OT_NETWORK_NAME_MAX_SIZE 16
Maximum size of the Thread Network Name field (bytes)
#define OT_EXT_PAN_ID_SIZE 8
Size of a Thread PAN ID (bytes)
#define OT_MESH_LOCAL_PREFIX_SIZE OT_IP6_PREFIX_SIZE
Size of the Mesh Local Prefix (bytes)
#define OT_PSKC_MAX_SIZE 16
Maximum size of the PSKc (bytes)
#define OT_CHANNEL_1_MASK (1 << 1)
Channel 1.
#define OT_CHANNEL_2_MASK (1 << 2)
Channel 2.
#define OT_CHANNEL_3_MASK (1 << 3)
Channel 3.
#define OT_CHANNEL_4_MASK (1 << 4)
Channel 4.
#define OT_CHANNEL_5_MASK (1 << 5)
Channel 5.
#define OT_CHANNEL_6_MASK (1 << 6)
Channel 6.
#define OT_CHANNEL_7_MASK (1 << 7)
Channel 7.
#define OT_CHANNEL_8_MASK (1 << 8)
Channel 8.
#define OT_CHANNEL_9_MASK (1 << 9)
Channel 9.
#define OT_CHANNEL_10_MASK (1 << 10)
Channel 10.
#define OT_CHANNEL_11_MASK (1 << 11)
Channel 11.
#define OT_CHANNEL_12_MASK (1 << 12)
Channel 12.
#define OT_CHANNEL_13_MASK (1 << 13)
Channel 13.
#define OT_CHANNEL_14_MASK (1 << 14)
Channel 14.
#define OT_CHANNEL_15_MASK (1 << 15)
Channel 15.
#define OT_CHANNEL_16_MASK (1 << 16)
Channel 16.
#define OT_CHANNEL_17_MASK (1 << 17)
Channel 17.
#define OT_CHANNEL_18_MASK (1 << 18)
Channel 18.
#define OT_CHANNEL_19_MASK (1 << 19)
Channel 19.
#define OT_CHANNEL_20_MASK (1 << 20)
Channel 20.
#define OT_CHANNEL_21_MASK (1 << 21)
Channel 21.
#define OT_CHANNEL_22_MASK (1 << 22)
Channel 22.
#define OT_CHANNEL_23_MASK (1 << 23)
Channel 23.
#define OT_CHANNEL_24_MASK (1 << 24)
Channel 24.
#define OT_CHANNEL_25_MASK (1 << 25)
Channel 25.
#define OT_CHANNEL_26_MASK (1 << 26)
Channel 26.
#define OT_OPERATIONAL_DATASET_MAX_LENGTH 254
Maximum length of Operational Dataset in bytes.
#define OT_NETWORK_DATA_ITERATOR_INIT 0
Initializer for otNetworkDataIterator.
#define OT_SERVICE_DATA_MAX_SIZE 252
Maximum size of Service Data in bytes.
#define OT_SERVER_DATA_MAX_SIZE 248
Maximum size of Server Data in bytes. This is theoretical limit, practical one is much lower.
#define OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES 19
Maximum Number of Network Diagnostic TLV Types to Request or Reset.
#define OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_ENTRY_SIZE 3
Size of Network Diagnostic Child Table entry.
#define OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT 0
Initializer for otNetworkDiagIterator.
#define OT_NETWORK_BASE_TLV_MAX_LENGTH 254
Maximum value length of Thread Base TLV.
#define OT_NETWORK_MAX_ROUTER_ID 62
Maximum Router ID.
#define OT_NEIGHBOR_INFO_ITERATOR_INIT 0
Initializer for otNeighborInfoIterator.
#define OT_JOINER_ADVDATA_MAX_LENGTH 64
Maximum AdvData Length of Joiner Advertisement.

Typedefs

typedef struct otMasterKey otMasterKey
This structure represents a Thread Master Key.
typedef struct otNetworkName otNetworkName
This structure represents a Network Name.
typedef struct otExtendedPanId otExtendedPanId
This structure represents an Extended PAN ID.
typedef otIp6NetworkPrefix otMeshLocalPrefix
This structure represents a Mesh Local Prefix.
typedef struct otPskc otPskc
This structure represents a PSKc.
typedef struct otSecurityPolicy otSecurityPolicy
This structure represent Security Policy.
typedef uint32_t otChannelMask
This type represents Channel Mask.
typedef struct otOperationalDatasetComponents otOperationalDatasetComponents
This structure represents presence of different components in Active or Pending Operational Dataset.
typedef struct otOperationalDataset otOperationalDataset
This structure represents an Active or Pending Operational Dataset.
typedef struct otOperationalDatasetTlvs otOperationalDatasetTlvs
This structure represents an Active or Pending Operational Dataset.
typedef enum otMeshcopTlvType otMeshcopTlvType
This enumeration represents meshcop TLV types.
typedef uint32_t otNetworkDataIterator
Used to iterate through Network Data information.
typedef struct otBorderRouterConfig otBorderRouterConfig
This structure represents a Border Router configuration.
typedef struct otExternalRouteConfig otExternalRouteConfig
This structure represents an External Route configuration.
typedef enum otRoutePreference otRoutePreference
Defines valid values for member mPreference in otExternalRouteConfig and otBorderRouterConfig .
typedef struct otServerConfig otServerConfig
This structure represents a Server configuration.
typedef struct otServiceConfig otServiceConfig
This structure represents a Service configuration.
typedef uint16_t otNetworkDiagIterator
Used to iterate through Network Diagnostic TLV.
typedef struct otNetworkDiagConnectivity otNetworkDiagConnectivity
This structure represents a Network Diagnostic Connectivity value.
typedef struct otNetworkDiagRouteData otNetworkDiagRouteData
This structure represents a Network Diagnostic Route data.
typedef struct otNetworkDiagRoute otNetworkDiagRoute
This structure represents a Network Diagnostic Route TLV value.
typedef struct otNetworkDiagMacCounters otNetworkDiagMacCounters
This structure represents a Network Diagnostic Mac Counters value.
typedef struct otNetworkDiagChildEntry otNetworkDiagChildEntry
This structure represents a Network Diagnostic Child Table Entry.
typedef struct otNetworkDiagTlv 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 otLinkModeConfig
This structure represents an MLE Link Mode configuration.
typedef int16_t otNeighborInfoIterator
Used to iterate through neighbor table.
typedef struct otLeaderData otLeaderData
This structure represents the Thread Leader Data.
typedef struct otIpCounters otIpCounters
This structure represents the IP level counters.
typedef struct otMleCounters otMleCounters
This structure represents the Thread MLE counters.
typedef struct otThreadParentResponseInfo otThreadParentResponseInfo
This structure represents the MLE Parent Response data.
typedef void(* otThreadParentResponseCallback ) ( otThreadParentResponseInfo *aInfo, void *aContext)
This function pointer is called every time an MLE Parent Response message is received.
typedef struct otThreadDiscoveryRequestInfo otThreadDiscoveryRequestInfo
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.

Enumerations

enum {
OT_SECURITY_POLICY_OBTAIN_MASTER_KEY = 1 << 7,
OT_SECURITY_POLICY_NATIVE_COMMISSIONING = 1 << 6,
OT_SECURITY_POLICY_ROUTERS = 1 << 5,
OT_SECURITY_POLICY_EXTERNAL_COMMISSIONER = 1 << 4,
OT_SECURITY_POLICY_BEACONS = 1 << 3
}
This enumeration defines the Security Policy TLV flags.
enum otMeshcopTlvType {
OT_MESHCOP_TLV_CHANNEL = 0,
OT_MESHCOP_TLV_PANID = 1,
OT_MESHCOP_TLV_EXTPANID = 2,
OT_MESHCOP_TLV_NETWORKNAME = 3,
OT_MESHCOP_TLV_PSKC = 4,
OT_MESHCOP_TLV_MASTERKEY = 5,
OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE = 6,
OT_MESHCOP_TLV_MESHLOCALPREFIX = 7,
OT_MESHCOP_TLV_STEERING_DATA = 8,
OT_MESHCOP_TLV_BORDER_AGENT_RLOC = 9,
OT_MESHCOP_TLV_COMMISSIONER_ID = 10,
OT_MESHCOP_TLV_COMM_SESSION_ID = 11,
OT_MESHCOP_TLV_SECURITYPOLICY = 12,
OT_MESHCOP_TLV_GET = 13,
OT_MESHCOP_TLV_ACTIVETIMESTAMP = 14,
OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT = 15,
OT_MESHCOP_TLV_STATE = 16,
OT_MESHCOP_TLV_JOINER_DTLS = 17,
OT_MESHCOP_TLV_JOINER_UDP_PORT = 18,
OT_MESHCOP_TLV_JOINER_IID = 19,
OT_MESHCOP_TLV_JOINER_RLOC = 20,
OT_MESHCOP_TLV_JOINER_ROUTER_KEK = 21,
OT_MESHCOP_TLV_PROVISIONING_URL = 32,
OT_MESHCOP_TLV_VENDOR_NAME_TLV = 33,
OT_MESHCOP_TLV_VENDOR_MODEL_TLV = 34,
OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV = 35,
OT_MESHCOP_TLV_VENDOR_DATA_TLV = 36,
OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV = 37,
OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV = 48,
OT_MESHCOP_TLV_IPV6_ADDRESS_TLV = 49,
OT_MESHCOP_TLV_PENDINGTIMESTAMP = 51,
OT_MESHCOP_TLV_DELAYTIMER = 52,
OT_MESHCOP_TLV_CHANNELMASK = 53,
OT_MESHCOP_TLV_COUNT = 54,
OT_MESHCOP_TLV_PERIOD = 55,
OT_MESHCOP_TLV_SCAN_DURATION = 56,
OT_MESHCOP_TLV_ENERGY_LIST = 57,
OT_MESHCOP_TLV_DISCOVERYREQUEST = 128,
OT_MESHCOP_TLV_DISCOVERYRESPONSE = 129,
OT_MESHCOP_TLV_JOINERADVERTISEMENT = 241
}
This enumeration represents meshcop TLV types.
enum otRoutePreference {
OT_ROUTE_PREFERENCE_LOW = -1,
OT_ROUTE_PREFERENCE_MED = 0,
OT_ROUTE_PREFERENCE_HIGH = 1
}
Defines valid values for member mPreference in otExternalRouteConfig and otBorderRouterConfig .
enum {
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
}
enum otDeviceRole {
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.

Functions

bool otDatasetIsCommissioned ( otInstance *aInstance)
This function indicates whether a valid network is present in the Active Operational Dataset or not.
otError otDatasetGetActive ( otInstance *aInstance, otOperationalDataset *aDataset)
This function gets the Active Operational Dataset.
otError otDatasetGetActiveTlvs ( otInstance *aInstance, otOperationalDatasetTlvs *aDataset)
This function gets the Active Operational Dataset.
otError otDatasetSetActive ( otInstance *aInstance, const otOperationalDataset *aDataset)
This function sets the Active Operational Dataset.
otError otDatasetSetActiveTlvs ( otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)
This function sets the Active Operational Dataset.
otError otDatasetGetPending ( otInstance *aInstance, otOperationalDataset *aDataset)
This function gets the Pending Operational Dataset.
otError otDatasetGetPendingTlvs ( otInstance *aInstance, otOperationalDatasetTlvs *aDataset)
This function gets the Pending Operational Dataset.
otError otDatasetSetPending ( otInstance *aInstance, const otOperationalDataset *aDataset)
This function sets the Pending Operational Dataset.
otError otDatasetSetPendingTlvs ( otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)
This function sets the Pending Operational Dataset.
otError otDatasetSendMgmtActiveGet ( otInstance *aInstance, const otOperationalDatasetComponents *aDatasetComponents, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress)
This function sends MGMT_ACTIVE_GET.
otError otDatasetSendMgmtActiveSet ( otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength)
This function sends MGMT_ACTIVE_SET.
otError otDatasetSendMgmtPendingGet ( otInstance *aInstance, const otOperationalDatasetComponents *aDatasetComponents, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress)
This function sends MGMT_PENDING_GET.
otError otDatasetSendMgmtPendingSet ( otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength)
This function sends MGMT_PENDING_SET.
otError otDatasetGeneratePskc (const char *aPassPhrase, const otNetworkName *aNetworkName, const otExtendedPanId *aExtPanId, otPskc *aPskc)
This function generates PSKc from a given pass-phrase, network name, and extended PAN ID.
otError otDatasetCreateNewNetwork ( otInstance *aInstance, otOperationalDataset *aDataset)
This method creates a new Operational Dataset to use when forming a new network.
uint32_t otDatasetGetDelayTimerMinimal ( otInstance *aInstance)
Get minimal delay timer.
otError otDatasetSetDelayTimerMinimal ( otInstance *aInstance, uint32_t aDelayTimerMinimal)
Set minimal delay timer.
otError otNetDataGet ( otInstance *aInstance, bool aStable, uint8_t *aData, uint8_t *aDataLength)
This method provides a full or stable copy of the Partition's Thread Network Data.
otError otNetDataGetNextOnMeshPrefix ( otInstance *aInstance, otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig)
This function gets the next On Mesh Prefix in the partition's Network Data.
otError otNetDataGetNextRoute ( otInstance *aInstance, otNetworkDataIterator *aIterator, otExternalRouteConfig *aConfig)
This function gets the next external route in the partition's Network Data.
otError otNetDataGetNextService ( otInstance *aInstance, otNetworkDataIterator *aIterator, otServiceConfig *aConfig)
This function gets the next service 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.
otError otNetDataSteeringDataCheckJoiner ( otInstance *aInstance, const otExtAddress *aEui64)
Check if the steering data includes a Joiner.
otError otNetDataSteeringDataCheckJoinerWithDiscerner ( otInstance *aInstance, const struct otJoinerDiscerner *aDiscerner)
Check if the steering data includes a Joiner with a given discerner value.
otError otThreadGetNextDiagnosticTlv (const otMessage *aMessage, otNetworkDiagIterator *aIterator, otNetworkDiagTlv *aNetworkDiagTlv)
This function gets the next Network Diagnostic TLV in the message.
void otThreadSetReceiveDiagnosticGetCallback ( otInstance *aInstance, otReceiveDiagnosticGetCallback aCallback, void *aCallbackContext)
This function registers a callback to provide received raw Network Diagnostic Get response payload.
otError otThreadSendDiagnosticGet ( otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)
Send a Network Diagnostic Get request.
otError otThreadSendDiagnosticReset ( otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)
Send a Network Diagnostic Reset request.
otError otThreadSetEnabled ( otInstance *aInstance, bool aEnabled)
This function starts Thread protocol operation.
uint16_t otThreadGetVersion (void)
This function gets the Thread protocol version.
bool otThreadIsSingleton ( otInstance *aInstance)
This function indicates whether a node is the only router on the network.
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.
bool otThreadIsDiscoverInProgress ( otInstance *aInstance)
This function determines if an MLE Thread Discovery is currently in progress.
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.
uint32_t otThreadGetChildTimeout ( otInstance *aInstance)
Get the Thread Child Timeout used when operating in the Child role.
void otThreadSetChildTimeout ( otInstance *aInstance, uint32_t aTimeout)
Set the Thread Child Timeout used when operating in the Child role.
const otExtendedPanId * otThreadGetExtendedPanId ( otInstance *aInstance)
Get the IEEE 802.15.4 Extended PAN ID.
otError otThreadSetExtendedPanId ( otInstance *aInstance, const otExtendedPanId *aExtendedPanId)
Set the IEEE 802.15.4 Extended PAN ID.
otError otThreadGetLeaderRloc ( otInstance *aInstance, otIp6Address *aLeaderRloc)
This function returns a pointer to the Leader's RLOC.
otLinkModeConfig otThreadGetLinkMode ( otInstance *aInstance)
Get the MLE Link Mode configuration.
otError otThreadSetLinkMode ( otInstance *aInstance, otLinkModeConfig aConfig)
Set the MLE Link Mode configuration.
const otMasterKey * otThreadGetMasterKey ( otInstance *aInstance)
Get the thrMasterKey.
otError otThreadSetMasterKey ( otInstance *aInstance, const otMasterKey *aKey)
Set the thrMasterKey.
const otIp6Address * otThreadGetRloc ( otInstance *aInstance)
This function returns a pointer to the Thread Routing Locator (RLOC) address.
const otIp6Address * otThreadGetMeshLocalEid ( otInstance *aInstance)
This function returns a pointer to the Mesh Local EID address.
const otMeshLocalPrefix * otThreadGetMeshLocalPrefix ( otInstance *aInstance)
This function returns a pointer to the Mesh Local Prefix.
otError otThreadSetMeshLocalPrefix ( otInstance *aInstance, const otMeshLocalPrefix *aMeshLocalPrefix)
This function sets the Mesh Local Prefix.
const otIp6Address * otThreadGetLinkLocalIp6Address ( otInstance *aInstance)
This function returns the Thread link-local IPv6 address.
const char * otThreadGetNetworkName ( otInstance *aInstance)
Get the Thread Network Name.
otError otThreadSetNetworkName ( otInstance *aInstance, const char *aNetworkName)
Set the Thread Network Name.
const char * otThreadGetDomainName ( otInstance *aInstance)
Get the Thread Domain Name.
otError otThreadSetDomainName ( otInstance *aInstance, const char *aDomainName)
Set the Thread Domain Name.
otError otThreadSetFixedDuaInterfaceIdentifier ( otInstance *aInstance, const otIp6InterfaceIdentifier *aIid)
Set/Clear the Interface Identifier manually specified for the Thread Domain Unicast Address.
const otIp6InterfaceIdentifier * otThreadGetFixedDuaInterfaceIdentifier ( otInstance *aInstance)
Get the Interface Identifier manually specified for the Thread Domain Unicast Address.
uint32_t otThreadGetKeySequenceCounter ( otInstance *aInstance)
Get the thrKeySequenceCounter.
void otThreadSetKeySequenceCounter ( otInstance *aInstance, uint32_t aKeySequenceCounter)
Set the thrKeySequenceCounter.
uint32_t otThreadGetKeySwitchGuardTime ( otInstance *aInstance)
Get the thrKeySwitchGuardTime.
void otThreadSetKeySwitchGuardTime ( otInstance *aInstance, uint32_t aKeySwitchGuardTime)
Set the thrKeySwitchGuardTime.
otError otThreadBecomeDetached ( otInstance *aInstance)
Detach from the Thread network.
otError otThreadBecomeChild ( otInstance *aInstance)
Attempt to reattach as a child.
otError otThreadGetNextNeighborInfo ( otInstance *aInstance, otNeighborInfoIterator *aIterator, otNeighborInfo *aInfo)
This function gets the next neighbor information.
otDeviceRole otThreadGetDeviceRole ( otInstance *aInstance)
Get the device role.
otError 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.
otError otThreadGetParentInfo ( otInstance *aInstance, otRouterInfo *aParentInfo)
The function retrieves diagnostic information for a Thread Router as parent.
otError otThreadGetParentAverageRssi ( otInstance *aInstance, int8_t *aParentRssi)
The function retrieves the average RSSI for the Thread Parent.
otError otThreadGetParentLastRssi ( otInstance *aInstance, int8_t *aLastRssi)
The function retrieves the RSSI of the last packet from the Thread Parent.
const otIpCounters * otThreadGetIp6Counters ( otInstance *aInstance)
Get the IPv6 counters.
void otThreadResetIp6Counters ( otInstance *aInstance)
Reset the IPv6 counters.
const otMleCounters * otThreadGetMleCounters ( otInstance *aInstance)
Get the Thread MLE counters.
void otThreadResetMleCounters ( otInstance *aInstance)
Reset 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 *aInstnace, otThreadDiscoveryRequestCallback aCallback, void *aContext)
This function sets a callback to receive MLE Discovery Request data.
void otThreadSendAddressNotification ( otInstance *aInstance, otIp6Address *aDestination, otIp6Address *aTarget, otIp6InterfaceIdentifier *aMlIid)
This function sends a Proactive Address Notification (ADDR_NTF.ntf) message.
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.

Variables

OT_TOOL_PACKED_BEGIN struct otMasterKey OT_TOOL_PACKED_END

Detailed Description

This module includes functions for all Thread roles.

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

Typedef Documentation

otNetworkDiagMacCounters

This structure represents a Network Diagnostic Mac Counters value.

See RFC 2863 for definitions of member fields.

otOperationalDataset

This structure represents an Active or Pending Operational Dataset.

Components in Dataset are optional. mComponets structure specifies which components are present in the Dataset.

otOperationalDatasetTlvs

This structure represents an Active or Pending Operational Dataset.

The Operational Dataset is TLV encoded as specified by Thread.

otReceiveDiagnosticGetCallback

typedef void(* otReceiveDiagnosticGetCallback) ( 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.

otThreadDiscoveryRequestCallback

typedef void(* otThreadDiscoveryRequestCallback) (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.

otThreadParentResponseCallback

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

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

Parameters
[in] aStats pointer to a location on stack holding the stats data.
[in] aContext A pointer to callback client-specific context.

Enumeration Type Documentation

anonymous enum

anonymous enum

This enumeration defines the Security Policy TLV flags.

Enumerator
OT_SECURITY_POLICY_OBTAIN_MASTER_KEY

Obtaining the Master Key.

OT_SECURITY_POLICY_NATIVE_COMMISSIONING

Native Commissioning.

OT_SECURITY_POLICY_ROUTERS

Routers enabled.

OT_SECURITY_POLICY_EXTERNAL_COMMISSIONER

External Commissioner allowed.

OT_SECURITY_POLICY_BEACONS

Beacons enabled.

anonymous enum

anonymous enum
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.

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.

otMeshcopTlvType

This enumeration represents meshcop TLV types.

Enumerator
OT_MESHCOP_TLV_CHANNEL

meshcop Channel TLV

OT_MESHCOP_TLV_PANID

meshcop Pan Id TLV

OT_MESHCOP_TLV_EXTPANID

meshcop Extended Pan Id TLV

OT_MESHCOP_TLV_NETWORKNAME

meshcop Network Name TLV

OT_MESHCOP_TLV_PSKC

meshcop PSKc TLV

OT_MESHCOP_TLV_MASTERKEY

meshcop Network Master Key TLV

OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE

meshcop Network Key Sequence TLV

OT_MESHCOP_TLV_MESHLOCALPREFIX

meshcop Mesh Local Prefix TLV

OT_MESHCOP_TLV_STEERING_DATA

meshcop Steering Data TLV

OT_MESHCOP_TLV_BORDER_AGENT_RLOC

meshcop Border Agent Locator TLV

OT_MESHCOP_TLV_COMMISSIONER_ID

meshcop Commissioner ID TLV

OT_MESHCOP_TLV_COMM_SESSION_ID

meshcop Commissioner Session ID TLV

OT_MESHCOP_TLV_SECURITYPOLICY

meshcop Security Policy TLV

OT_MESHCOP_TLV_GET

meshcop Get TLV

OT_MESHCOP_TLV_ACTIVETIMESTAMP

meshcop Active Timestamp TLV

OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT

meshcop Commissioner UDP Port TLV

OT_MESHCOP_TLV_STATE

meshcop State TLV

OT_MESHCOP_TLV_JOINER_DTLS

meshcop Joiner DTLS Encapsulation TLV

OT_MESHCOP_TLV_JOINER_UDP_PORT

meshcop Joiner UDP Port TLV

OT_MESHCOP_TLV_JOINER_IID

meshcop Joiner IID TLV

OT_MESHCOP_TLV_JOINER_RLOC

meshcop Joiner Router Locator TLV

OT_MESHCOP_TLV_JOINER_ROUTER_KEK

meshcop Joiner Router KEK TLV

OT_MESHCOP_TLV_PROVISIONING_URL

meshcop Provisioning URL TLV

OT_MESHCOP_TLV_VENDOR_NAME_TLV

meshcop Vendor Name TLV

OT_MESHCOP_TLV_VENDOR_MODEL_TLV

meshcop Vendor Model TLV

OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV

meshcop Vendor SW Version TLV

OT_MESHCOP_TLV_VENDOR_DATA_TLV

meshcop Vendor Data TLV

OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV

meshcop Vendor Stack Version TLV

OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV

meshcop UDP encapsulation TLV

OT_MESHCOP_TLV_IPV6_ADDRESS_TLV

meshcop IPv6 address TLV

OT_MESHCOP_TLV_PENDINGTIMESTAMP

meshcop Pending Timestamp TLV

OT_MESHCOP_TLV_DELAYTIMER

meshcop Delay Timer TLV

OT_MESHCOP_TLV_CHANNELMASK

meshcop Channel Mask TLV

OT_MESHCOP_TLV_COUNT

meshcop Count TLV

OT_MESHCOP_TLV_PERIOD

meshcop Period TLV

OT_MESHCOP_TLV_SCAN_DURATION

meshcop Scan Duration TLV

OT_MESHCOP_TLV_ENERGY_LIST

meshcop Energy List TLV

OT_MESHCOP_TLV_DISCOVERYREQUEST

meshcop Discovery Request TLV

OT_MESHCOP_TLV_DISCOVERYRESPONSE

meshcop Discovery Response TLV

OT_MESHCOP_TLV_JOINERADVERTISEMENT

meshcop Joiner Advertisement TLV

otRoutePreference

Defines valid values for member 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.

Function Documentation

otDatasetCreateNewNetwork()

otError otDatasetCreateNewNetwork ( otInstance * aInstance,
otOperationalDataset * aDataset
)

This method creates a new Operational Dataset to use when forming a new network.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[out] aDataset The Operational Dataset.
Return values
OT_ERROR_NONE Successfully created a new Operational Dataset.
OT_ERROR_FAILED Failed to generate random values for new parameters.

otDatasetGeneratePskc()

otError otDatasetGeneratePskc ( const char * aPassPhrase,
const otNetworkName * aNetworkName,
const otExtendedPanId * aExtPanId,
otPskc * aPskc
)

This function generates PSKc from a given pass-phrase, network name, and extended PAN ID.

PSKc is used to establish the Commissioner Session.

Parameters
[in] aPassPhrase The commissioning pass-phrase.
[in] aNetworkName The network name for PSKc computation.
[in] aExtPanId The extended PAN ID for PSKc computation.
[out] aPskc A pointer to variable to output the generated PSKc.
Return values
OT_ERROR_NONE Successfully generate PSKc.
OT_ERROR_INVALID_ARGS If any of the input arguments is invalid.

otDatasetGetActive()

otError otDatasetGetActive ( otInstance * aInstance,
otOperationalDataset * aDataset
)

This function gets the Active Operational Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[out] aDataset A pointer to where the Active Operational Dataset will be placed.
Return values
OT_ERROR_NONE Successfully retrieved the Active Operational Dataset.
OT_ERROR_NOT_FOUND No corresponding value in the setting store.

otDatasetGetActiveTlvs()

otError otDatasetGetActiveTlvs ( otInstance * aInstance,
otOperationalDatasetTlvs * aDataset
)

This function gets the Active Operational Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[out] aDataset A pointer to where the Active Operational Dataset will be placed.
Return values
OT_ERROR_NONE Successfully retrieved the Active Operational Dataset.
OT_ERROR_NOT_FOUND No corresponding value in the setting store.

otDatasetGetDelayTimerMinimal()

uint32_t otDatasetGetDelayTimerMinimal ( otInstance * aInstance )

Get minimal delay timer.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Return values
the value of minimal delay timer (in ms).

otDatasetGetPending()

otError otDatasetGetPending ( otInstance * aInstance,
otOperationalDataset * aDataset
)

This function gets the Pending Operational Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[out] aDataset A pointer to where the Pending Operational Dataset will be placed.
Return values
OT_ERROR_NONE Successfully retrieved the Pending Operational Dataset.
OT_ERROR_NOT_FOUND No corresponding value in the setting store.

otDatasetGetPendingTlvs()

otError otDatasetGetPendingTlvs ( otInstance * aInstance,
otOperationalDatasetTlvs * aDataset
)

This function gets the Pending Operational Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[out] aDataset A pointer to where the Pending Operational Dataset will be placed.
Return values
OT_ERROR_NONE Successfully retrieved the Pending Operational Dataset.
OT_ERROR_NOT_FOUND No corresponding value in the setting store.

otDatasetIsCommissioned()

bool otDatasetIsCommissioned ( otInstance * aInstance )

This function indicates whether a valid network is present in the Active Operational Dataset or not.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
TRUE if a valid network is present in the Active Operational Dataset, FALSE otherwise.

otDatasetSendMgmtActiveGet()

otError otDatasetSendMgmtActiveGet ( otInstance * aInstance,
const otOperationalDatasetComponents * aDatasetComponents,
const uint8_t * aTlvTypes,
uint8_t aLength,
const otIp6Address * aAddress
)

This function sends MGMT_ACTIVE_GET.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDatasetComponents A pointer to a Dataset Components structure specifying which components to request.
[in] aTlvTypes A pointer to array containing additional raw TLV types to be requested.
[in] aLength The length of aTlvTypes .
[in] aAddress A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default.
Return values
OT_ERROR_NONE Successfully send the meshcop dataset command.
OT_ERROR_NO_BUFS Insufficient buffer space to send.

otDatasetSendMgmtActiveSet()

otError otDatasetSendMgmtActiveSet ( otInstance * aInstance,
const otOperationalDataset * aDataset,
const uint8_t * aTlvs,
uint8_t aLength
)

This function sends MGMT_ACTIVE_SET.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDataset A pointer to operational dataset.
[in] aTlvs A pointer to TLVs.
[in] aLength The length of TLVs.
Return values
OT_ERROR_NONE Successfully send the meshcop dataset command.
OT_ERROR_NO_BUFS Insufficient buffer space to send.

otDatasetSendMgmtPendingGet()

otError otDatasetSendMgmtPendingGet ( otInstance * aInstance,
const otOperationalDatasetComponents * aDatasetComponents,
const uint8_t * aTlvTypes,
uint8_t aLength,
const otIp6Address * aAddress
)

This function sends MGMT_PENDING_GET.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDatasetComponents A pointer to a Dataset Components structure specifying which components to request.
[in] aTlvTypes A pointer to array containing additional raw TLV types to be requested.
[in] aLength The length of aTlvTypes .
[in] aAddress A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default.
Return values
OT_ERROR_NONE Successfully send the meshcop dataset command.
OT_ERROR_NO_BUFS Insufficient buffer space to send.

otDatasetSendMgmtPendingSet()

otError otDatasetSendMgmtPendingSet ( otInstance * aInstance,
const otOperationalDataset * aDataset,
const uint8_t * aTlvs,
uint8_t aLength
)

This function sends MGMT_PENDING_SET.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDataset A pointer to operational dataset.
[in] aTlvs A pointer to TLVs.
[in] aLength The length of TLVs.
Return values
OT_ERROR_NONE Successfully send the meshcop dataset command.
OT_ERROR_NO_BUFS Insufficient buffer space to send.

otDatasetSetActive()

otError otDatasetSetActive ( otInstance * aInstance,
const otOperationalDataset * aDataset
)

This function sets the Active Operational Dataset.

If the dataset does not include an Active Timestamp, the dataset is only partially complete.

If Thread is enabled on a device that has a partially complete Active Dataset, the device will attempt to attach to an existing Thread network using any existing information in the dataset. Only the Thread Master Key is needed to attach to a network.

If channel is not included in the dataset, the device will send MLE Announce messages across different channels to find neighbors on other channels.

If the device successfully attaches to a Thread network, the device will then retrieve the full Active Dataset from its Parent. Note that a router-capable device will not transition to the Router or Leader roles until it has a complete Active Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDataset A pointer to the Active Operational Dataset.
Return values
OT_ERROR_NONE Successfully set the Active Operational Dataset.
OT_ERROR_NO_BUFS Insufficient buffer space to set the Active Operational Dataset.
OT_ERROR_NOT_IMPLEMENTED The platform does not implement settings functionality.

otDatasetSetActiveTlvs()

otError otDatasetSetActiveTlvs ( otInstance * aInstance,
const otOperationalDatasetTlvs * aDataset
)

This function sets the Active Operational Dataset.

If the dataset does not include an Active Timestamp, the dataset is only partially complete.

If Thread is enabled on a device that has a partially complete Active Dataset, the device will attempt to attach to an existing Thread network using any existing information in the dataset. Only the Thread Master Key is needed to attach to a network.

If channel is not included in the dataset, the device will send MLE Announce messages across different channels to find neighbors on other channels.

If the device successfully attaches to a Thread network, the device will then retrieve the full Active Dataset from its Parent. Note that a router-capable device will not transition to the Router or Leader roles until it has a complete Active Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDataset A pointer to the Active Operational Dataset.
Return values
OT_ERROR_NONE Successfully set the Active Operational Dataset.
OT_ERROR_NO_BUFS Insufficient buffer space to set the Active Operational Dataset.
OT_ERROR_NOT_IMPLEMENTED The platform does not implement settings functionality.

otDatasetSetDelayTimerMinimal()

otError otDatasetSetDelayTimerMinimal ( otInstance * aInstance,
uint32_t aDelayTimerMinimal
)

Set minimal delay timer.

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.
Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDelayTimerMinimal The value of minimal delay timer (in ms).
Return values
OT_ERROR_NONE Successfully set minimal delay timer.
OT_ERROR_INVALID_ARGS If aDelayTimerMinimal is not valid.

otDatasetSetPending()

otError otDatasetSetPending ( otInstance * aInstance,
const otOperationalDataset * aDataset
)

This function sets the Pending Operational Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDataset A pointer to the Pending Operational Dataset.
Return values
OT_ERROR_NONE Successfully set the Pending Operational Dataset.
OT_ERROR_NO_BUFS Insufficient buffer space to set the Pending Operational Dataset.
OT_ERROR_NOT_IMPLEMENTED The platform does not implement settings functionality.

otDatasetSetPendingTlvs()

otError otDatasetSetPendingTlvs ( otInstance * aInstance,
const otOperationalDatasetTlvs * aDataset
)

This function sets the Pending Operational Dataset.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDataset A pointer to the Pending Operational Dataset.
Return values
OT_ERROR_NONE Successfully set the Pending Operational Dataset.
OT_ERROR_NO_BUFS Insufficient buffer space to set the Pending Operational Dataset.
OT_ERROR_NOT_IMPLEMENTED The platform does not implement settings functionality.

otNetDataGet()

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

This method provides a 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.
[in,out] aDataLength On entry, size of the data buffer pointed to by aData . On exit, number of copied bytes.

otNetDataGetNextOnMeshPrefix()

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

This function gets the next On Mesh Prefix in the partition's Network Data.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in,out] 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.
Return values
OT_ERROR_NONE Successfully found the next On Mesh prefix.
OT_ERROR_NOT_FOUND No subsequent On Mesh prefix exists in the Thread Network Data.

otNetDataGetNextRoute()

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

This function gets the next external route in the partition's Network Data.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in,out] 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.
Return values
OT_ERROR_NONE Successfully found the next External Route.
OT_ERROR_NOT_FOUND No subsequent external route entry exists in the Thread Network Data.

otNetDataGetNextService()

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

This function gets the next service in the partition's Network Data.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in,out] 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.
Return values
OT_ERROR_NONE Successfully found the next service.
OT_ERROR_NOT_FOUND No subsequent service exists in the partition's Network Data.

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.

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.

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.
Return values
OT_ERROR_NONE aEui64 is included in the steering data.
OT_ERROR_INVALID_STATE No steering data present.
OT_ERROR_NOT_FOUND aEui64 is not included in the steering data.

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.
Return values
OT_ERROR_NONE aDiscerner is included in the steering data.
OT_ERROR_INVALID_STATE No steering data present.
OT_ERROR_NOT_FOUND aDiscerner is not included in the steering data.

otThreadBecomeChild()

otError otThreadBecomeChild ( otInstance * aInstance )

Attempt to reattach as a child.

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.
Parameters
[in] aInstance A pointer to an OpenThread instance.
Return values
OT_ERROR_NONE Successfully begin attempt to become a child.
OT_ERROR_INVALID_STATE Thread is disabled.

otThreadBecomeDetached()

otError otThreadBecomeDetached ( otInstance * aInstance )

Detach from the Thread network.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Return values
OT_ERROR_NONE Successfully detached from the Thread network.
OT_ERROR_INVALID_STATE Thread is disabled.

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.
Return values
OT_ERROR_NONE Accepted the Thread Discovery request.
OT_ERROR_BUSY Already performing an Thread Discovery.

otThreadGetChildTimeout()

uint32_t otThreadGetChildTimeout ( otInstance * aInstance )

Get the Thread Child Timeout 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
otThreadSetChildTimeout

otThreadGetDeviceRole()

otDeviceRole otThreadGetDeviceRole ( otInstance * aInstance )

Get the device role.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Return values
OT_DEVICE_ROLE_DISABLED The Thread stack is disabled.
OT_DEVICE_ROLE_DETACHED The device is not currently participating in a Thread network/partition.
OT_DEVICE_ROLE_CHILD The device is currently operating as a Thread Child.
OT_DEVICE_ROLE_ROUTER The device is currently operating as a Thread Router.
OT_DEVICE_ROLE_LEADER The device is currently operating as a Thread Leader.

otThreadGetDomainName()

const char* otThreadGetDomainName ( otInstance * aInstance )

Get the Thread Domain Name.

This function is only available since Thread 1.2.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
A pointer to the Thread Domain Name.
See also
otThreadSetDomainName

otThreadGetExtendedPanId()

const otExtendedPanId * otThreadGetExtendedPanId ( otInstance * aInstance )

Get 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
otThreadSetExtendedPanId

otThreadGetFixedDuaInterfaceIdentifier()

const otIp6InterfaceIdentifier * otThreadGetFixedDuaInterfaceIdentifier ( otInstance * aInstance )

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

This function is only available since Thread 1.2 when OPENTHREAD_CONFIG_DUA_ENABLE is enabled.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
A pointer to the Interface Identifier which was set manually, or NULL if none was set.
See also
otThreadSetFixedDuaInterfaceIdentifier

otThreadGetIp6Counters()

const otIpCounters * otThreadGetIp6Counters ( otInstance * aInstance )

Get the IPv6 counters.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
A pointer to the IPv6 counters.

otThreadGetKeySequenceCounter()

uint32_t otThreadGetKeySequenceCounter ( otInstance * aInstance )

Get the thrKeySequenceCounter.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
The thrKeySequenceCounter value.
See also
otThreadSetKeySequenceCounter

otThreadGetKeySwitchGuardTime()

uint32_t otThreadGetKeySwitchGuardTime ( otInstance * aInstance )

Get the thrKeySwitchGuardTime.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
The thrKeySwitchGuardTime value (in hours).
See also
otThreadSetKeySwitchGuardTime

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.
Return values
OT_ERROR_NONE Successfully retrieved the leader data.
OT_ERROR_DETACHED Not currently attached.

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.
Return values
OT_ERROR_NONE The Leader's RLOC was successfully written to aLeaderRloc .
OT_ERROR_INVALID_ARGS aLeaderRloc was NULL.
OT_ERROR_DETACHED Not currently attached to a Thread Partition.

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.

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.

otThreadGetLinkLocalIp6Address()

const otIp6Address * otThreadGetLinkLocalIp6Address ( otInstance * aInstance )

This function returns the Thread link-local IPv6 address.

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

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
A pointer to Thread link-local IPv6 address.

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
otThreadSetLinkMode

otThreadGetMasterKey()

const otMasterKey * otThreadGetMasterKey ( otInstance * aInstance )

Get the thrMasterKey.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
A pointer to a buffer containing the thrMasterKey.
See also
otThreadSetMasterKey

otThreadGetMeshLocalEid()

const otIp6Address * otThreadGetMeshLocalEid ( otInstance * aInstance )

This function returns a pointer to the Mesh Local EID address.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
A pointer to the Mesh Local EID address.

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.

otThreadGetMleCounters()

const otMleCounters * otThreadGetMleCounters ( otInstance * aInstance )

Get the Thread MLE counters.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
A pointer to the Thread MLE counters.

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
otThreadSetNetworkName

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.
[in,out] 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.
Return values
OT_ERROR_NONE Successfully found the next Network Diagnostic TLV.
OT_ERROR_NOT_FOUND No subsequent Network Diagnostic TLV exists in the message.
OT_ERROR_PARSE Parsing the next Network Diagnostic failed.

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

otThreadGetNextNeighborInfo()

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

This function gets the next neighbor information.

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

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in,out] 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.
Return values
OT_ERROR_NONE Successfully found the next neighbor entry in table.
OT_ERROR_NOT_FOUND No subsequent neighbor entry exists in the table.
OT_ERROR_INVALID_ARGS aIterator or aInfo was NULL.

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.

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.

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.
Return values
OT_ERROR_NONE Successfully retrieved the RSSI data.
OT_ERROR_FAILED Unable to get RSSI data.
OT_ERROR_INVALID_ARGS aLastRssi is NULL.

otThreadGetPartitionId()

uint32_t otThreadGetPartitionId ( otInstance * aInstance )

Get the Partition ID.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
The Partition ID.

otThreadGetRloc()

const otIp6Address * otThreadGetRloc ( otInstance * aInstance )

This function returns a pointer to 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.

otThreadGetRloc16()

uint16_t otThreadGetRloc16 ( otInstance * aInstance )

Get the RLOC16.

Parameters
[in] aInstance A pointer to an OpenThread instance.
Returns
The RLOC16.

otThreadGetVersion()

uint16_t otThreadGetVersion ( void )

This function gets the Thread protocol version.

Returns
the Thread protocol version.

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.

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.
Return values
TRUE It is the only router in the network.
FALSE It is a child or is not a single router in the network.

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.

otThreadResetIp6Counters()

void otThreadResetIp6Counters ( otInstance * aInstance )

Reset the IPv6 counters.

Parameters
[in] aInstance A pointer to an OpenThread instance.

otThreadResetMleCounters()

void otThreadResetMleCounters ( otInstance * aInstance )

Reset the Thread MLE counters.

Parameters
[in] aInstance A pointer to an OpenThread instance.

otThreadSendAddressNotification()

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

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

This function is only available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE is enabled.

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.

otThreadSendDiagnosticGet()

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

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.
Return values
OT_ERROR_NONE Successfully queued the DIAG_GET.req.
OT_ERROR_NO_BUFS Insufficient message buffers available to send DIAG_GET.req.

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
Return values
OT_ERROR_NONE Successfully queued the DIAG_RST.ntf.
OT_ERROR_NO_BUFS Insufficient message buffers available to send DIAG_RST.ntf.

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.

This function is only available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE is enabled.

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).
Return values
OT_ERROR_NONE Successfully sent PRO_BB.ntf on backbone link.
OT_ERROR_NO_BUFS If insufficient message buffers available.

otThreadSetChildTimeout()

void otThreadSetChildTimeout ( otInstance * aInstance,
uint32_t aTimeout
)

Set the Thread Child Timeout 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
otThreadGetChildTimeout

otThreadSetDiscoveryRequestCallback()

void otThreadSetDiscoveryRequestCallback ( otInstance * aInstnace,
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.

otThreadSetDomainName()

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

Set the Thread Domain Name.

This function is only available since Thread 1.2. This function succeeds only when Thread protocols are disabled.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aDomainName A pointer to the Thread Domain Name.
Return values
OT_ERROR_NONE Successfully set the Thread Domain Name.
OT_ERROR_INVALID_STATE Thread protocols are enabled.
See also
otThreadGetDomainName

otThreadSetEnabled()

otError otThreadSetEnabled ( otInstance * aInstance,
bool aEnabled
)

This function starts Thread protocol operation.

The interface must be up when calling this function.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aEnabled TRUE if Thread is enabled, FALSE otherwise.
Return values
OT_ERROR_NONE Successfully started Thread protocol operation.
OT_ERROR_INVALID_STATE The network interface was not not up.

otThreadSetExtendedPanId()

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

Set the IEEE 802.15.4 Extended PAN ID.

This function 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.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aExtendedPanId A pointer to the IEEE 802.15.4 Extended PAN ID.
Return values
OT_ERROR_NONE Successfully set the Extended PAN ID.
OT_ERROR_INVALID_STATE Thread protocols are enabled.
See also
otThreadGetExtendedPanId

otThreadSetFixedDuaInterfaceIdentifier()

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

Set/Clear the Interface Identifier manually specified for the Thread Domain Unicast Address.

This function is only available since Thread 1.2 when OPENTHREAD_CONFIG_DUA_ENABLE is enabled.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aIid A pointer to the Interface Identifier to set or NULL to clear.
Return values
OT_ERROR_NONE Successfully set/cleared the Interface Identifier.
OT_ERROR_INVALID_ARGS The specified Interface Identifier is reserved.
See also
otThreadGetFixedDuaInterfaceIdentifier

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.

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.

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.
Return values
OT_ERROR_NONE Successfully set Joiner Advertisement.
OT_ERROR_INVALID_ARGS Invalid AdvData.

otThreadSetKeySequenceCounter()

void otThreadSetKeySequenceCounter ( otInstance * aInstance,
uint32_t aKeySequenceCounter
)

Set the thrKeySequenceCounter.

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.
Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aKeySequenceCounter The thrKeySequenceCounter value.
See also
otThreadGetKeySequenceCounter

otThreadSetKeySwitchGuardTime()

void otThreadSetKeySwitchGuardTime ( otInstance * aInstance,
uint32_t aKeySwitchGuardTime
)

Set the thrKeySwitchGuardTime.

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.
Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aKeySwitchGuardTime The thrKeySwitchGuardTime value (in hours).
See also
otThreadGetKeySwitchGuardTime

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.
Return values
OT_ERROR_NONE Successfully set the MLE Link Mode configuration.
See also
otThreadGetLinkMode

otThreadSetMasterKey()

otError otThreadSetMasterKey ( otInstance * aInstance,
const otMasterKey * aKey
)

Set the thrMasterKey.

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.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aKey A pointer to a buffer containing the thrMasterKey.
Return values
OT_ERROR_NONE Successfully set the thrMasterKey.
OT_ERROR_INVALID_ARGS If aKeyLength is larger than 16.
OT_ERROR_INVALID_STATE Thread protocols are enabled.
See also
otThreadGetMasterKey

otThreadSetMeshLocalPrefix()

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

This function sets 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.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aMeshLocalPrefix A pointer to the Mesh Local Prefix.
Return values
OT_ERROR_NONE Successfully set the Mesh Local Prefix.
OT_ERROR_INVALID_STATE Thread protocols are enabled.

otThreadSetNetworkName()

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

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

Parameters
[in] aInstance A pointer to an OpenThread instance.
[in] aNetworkName A pointer to the Thread Network Name.
Return values
OT_ERROR_NONE Successfully set the Thread Network Name.
OT_ERROR_INVALID_STATE Thread protocols are enabled.
See also
otThreadGetNetworkName

otThreadSetReceiveDiagnosticGetCallback()

void otThreadSetReceiveDiagnosticGetCallback ( otInstance * aInstance,
otReceiveDiagnosticGetCallback aCallback,
void * aCallbackContext
)

This function registers a callback to provide received raw Network Diagnostic Get response payload.

Parameters
[in] aInstance A pointer to an OpenThread instance.
[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.