Operational Dataset#

Includes functions for the Operational Dataset API.

For FTD builds only, Dataset Updater includes functions to manage dataset updates.

For FTD and MTD builds, the Operational Dataset API includes functions to manage Active and Pending datasets and dataset TLVs.

Modules#

otNetworkKey

otNetworkName

otExtendedPanId

otPskc

otSecurityPolicy

otOperationalDatasetComponents

otTimestamp

otOperationalDataset

otOperationalDatasetTlvs

Enumerations#

enum
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_NETWORKKEY = 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_THREAD_DOMAIN_NAME = 59
OT_MESHCOP_TLV_WAKEUP_CHANNEL = 74
OT_MESHCOP_TLV_DISCOVERYREQUEST = 128
OT_MESHCOP_TLV_DISCOVERYRESPONSE = 129
OT_MESHCOP_TLV_JOINERADVERTISEMENT = 241
}

Represents meshcop TLV types.

Typedefs#

typedef struct otNetworkKey

Represents a Thread Network Key.

This datatype represents KeyRef to NetworkKey.

typedef struct otNetworkName

Represents a Network Name.

typedef struct otExtendedPanId

Represents an Extended PAN ID.

Represents a Mesh Local Prefix.

typedef struct otPskc

Represents a PSKc.

This datatype represents KeyRef to PSKc.

typedef struct otSecurityPolicy

Represent Security Policy.

typedef uint32_t

Represents Channel Mask.

Represents presence of different components in Active or Pending Operational Dataset.

typedef struct otTimestamp

Represents a Thread Dataset timestamp component.

typedef struct otOperationalDataset

Represents an Active or Pending Operational Dataset.

Represents an Active or Pending Operational Dataset.

typedef enum otMeshcopTlvType

Represents meshcop TLV types.

typedef void(*
otDatasetMgmtSetCallback)(otError aResult, void *aContext)

Pointer is called when a response to a MGMT_SET request is received or times out.

typedef void(*
otDatasetUpdaterCallback)(otError aError, void *aContext)

This callback function pointer is called when a Dataset update request finishes, reporting success or failure status of the Dataset update request.

Functions#

bool
otDatasetIsCommissioned(otInstance *aInstance)

Indicates whether a valid network is present in the Active Operational Dataset or not.

otDatasetGetActive(otInstance *aInstance, otOperationalDataset *aDataset)

Gets the Active Operational Dataset.

otDatasetGetActiveTlvs(otInstance *aInstance, otOperationalDatasetTlvs *aDataset)

Gets the Active Operational Dataset.

otDatasetSetActive(otInstance *aInstance, const otOperationalDataset *aDataset)

Sets the Active Operational Dataset.

otDatasetSetActiveTlvs(otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)

Sets the Active Operational Dataset.

otDatasetGetPending(otInstance *aInstance, otOperationalDataset *aDataset)

Gets the Pending Operational Dataset.

otDatasetGetPendingTlvs(otInstance *aInstance, otOperationalDatasetTlvs *aDataset)

Gets the Pending Operational Dataset.

otDatasetSetPending(otInstance *aInstance, const otOperationalDataset *aDataset)

Sets the Pending Operational Dataset.

otDatasetSetPendingTlvs(otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)

Sets the Pending Operational Dataset.

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

Sends MGMT_ACTIVE_GET.

otDatasetSendMgmtActiveSet(otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void *aContext)

Sends MGMT_ACTIVE_SET.

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

Sends MGMT_PENDING_GET.

otDatasetSendMgmtPendingSet(otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void *aContext)

Sends MGMT_PENDING_SET.

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

Generates PSKc from a given pass-phrase, network name, and extended PAN ID.

otNetworkNameFromString(otNetworkName *aNetworkName, const char *aNameString)

Sets an otNetworkName instance from a given null terminated C string.

otDatasetParseTlvs(const otOperationalDatasetTlvs *aDatasetTlvs, otOperationalDataset *aDataset)

Parses an Operational Dataset from a given otOperationalDatasetTlvs.

void
otDatasetConvertToTlvs(const otOperationalDataset *aDataset, otOperationalDatasetTlvs *aDatasetTlvs)

Converts a given Operational Dataset to otOperationalDatasetTlvs.

otDatasetUpdateTlvs(const otOperationalDataset *aDataset, otOperationalDatasetTlvs *aDatasetTlvs)

Updates a given Operational Dataset.

otDatasetCreateNewNetwork(otInstance *aInstance, otOperationalDataset *aDataset)

For FTD only, creates a new Operational Dataset to use when forming a new network.

uint32_t
otDatasetGetDelayTimerMinimal(otInstance *aInstance)

For FTD only, gets a minimal delay timer.

otDatasetSetDelayTimerMinimal(otInstance *aInstance, uint32_t aDelayTimerMinimal)

For FTD only, sets a minimal delay timer.

otDatasetUpdaterRequestUpdate(otInstance *aInstance, const otOperationalDataset *aDataset, otDatasetUpdaterCallback aCallback, void *aContext)

Requests an update to Operational Dataset.

void
otDatasetUpdaterCancelUpdate(otInstance *aInstance)

Cancels an ongoing (if any) Operational Dataset update request.

bool
otDatasetUpdaterIsUpdateOngoing(otInstance *aInstance)

Indicates whether there is an ongoing Operation Dataset update request.

Macros#

#define

Size of the Thread Network Key (bytes)

#define

Maximum size of the Thread Network Name field (bytes)

#define

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

Maximum size of the PSKc (bytes)

#define

Channel 1.

#define

Channel 2.

#define

Channel 3.

#define

Channel 4.

#define

Channel 5.

#define

Channel 6.

#define

Channel 7.

#define

Channel 8.

#define

Channel 9.

#define

Channel 10.

#define

Channel 11.

#define

Channel 12.

#define

Channel 13.

#define

Channel 14.

#define

Channel 15.

#define

Channel 16.

#define

Channel 17.

#define

Channel 18.

#define

Channel 19.

#define

Channel 20.

#define

Channel 21.

#define

Channel 22.

#define

Channel 23.

#define

Channel 24.

#define

Channel 25.

#define

Channel 26.

#define

Maximum length of Operational Dataset in bytes.

Enumeration Documentation#

otMeshcopTlvType#

otMeshcopTlvType

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_NETWORKKEY

meshcop Network 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_THREAD_DOMAIN_NAME

meshcop Thread Domain Name TLV

OT_MESHCOP_TLV_WAKEUP_CHANNEL

meshcop Wake-up Channel 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


Definition at line 258 of file include/openthread/dataset.h

Typedef Documentation#

otNetworkKey#

typedef struct otNetworkKey otNetworkKey

Represents a Thread Network Key.


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

otNetworkKeyRef#

typedef otCryptoKeyRef otNetworkKeyRef

This datatype represents KeyRef to NetworkKey.

Reference to Key


Definition at line 77 of file include/openthread/dataset.h

otNetworkName#

typedef struct otNetworkName otNetworkName

Represents a Network Name.

The otNetworkName is a null terminated C string (i.e., m8 char array MUST end with null char \0).


Definition at line 89 of file include/openthread/dataset.h

otExtendedPanId#

typedef struct otExtendedPanId otExtendedPanId

Represents an Extended PAN ID.


Definition at line 105 of file include/openthread/dataset.h

otMeshLocalPrefix#

typedef otIp6NetworkPrefix otMeshLocalPrefix

Represents a Mesh Local Prefix.


Definition at line 112 of file include/openthread/dataset.h

otPskc#

typedef struct otPskc otPskc

Represents a PSKc.


Definition at line 128 of file include/openthread/dataset.h

otPskcRef#

typedef otCryptoKeyRef otPskcRef

This datatype represents KeyRef to PSKc.

Reference to Key


Definition at line 133 of file include/openthread/dataset.h

otSecurityPolicy#

typedef struct otSecurityPolicy otSecurityPolicy

Represent Security Policy.


Definition at line 152 of file include/openthread/dataset.h

otChannelMask#

typedef uint32_t otChannelMask

Represents Channel Mask.


Definition at line 157 of file include/openthread/dataset.h

otOperationalDatasetComponents#

typedef struct otOperationalDatasetComponents otOperationalDatasetComponents

Represents presence of different components in Active or Pending Operational Dataset.


Definition at line 204 of file include/openthread/dataset.h

otTimestamp#

typedef struct otTimestamp otTimestamp

Represents a Thread Dataset timestamp component.


Definition at line 214 of file include/openthread/dataset.h

otOperationalDataset#

typedef struct otOperationalDataset otOperationalDataset

Represents an Active or Pending Operational Dataset.

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


Definition at line 237 of file include/openthread/dataset.h

otOperationalDatasetTlvs#

typedef struct otOperationalDatasetTlvs otOperationalDatasetTlvs

Represents an Active or Pending Operational Dataset.

The Operational Dataset is TLV encoded as specified by Thread.


Definition at line 253 of file include/openthread/dataset.h

otMeshcopTlvType#

typedef enum otMeshcopTlvType otMeshcopTlvType

Represents meshcop TLV types.


Definition at line 302 of file include/openthread/dataset.h

otDatasetMgmtSetCallback#

typedef void(* otDatasetMgmtSetCallback) (otError aResult, void *aContext) )(otError aResult, void *aContext)

Pointer is called when a response to a MGMT_SET request is received or times out.

Parameters
[in]aResult

A result of the operation.

[in]aContext

A pointer to application-specific context.


Definition at line 316 of file include/openthread/dataset.h

otDatasetUpdaterCallback#

typedef void(* otDatasetUpdaterCallback) (otError aError, void *aContext) )(otError aError, void *aContext)

This callback function pointer is called when a Dataset update request finishes, reporting success or failure status of the Dataset update request.

Parameters
[in]aError

The error status. OT_ERROR_NONE indicates successful Dataset update. OT_ERROR_INVALID_STATE indicates failure due invalid state (MLE being disabled). OT_ERROR_ALREADY indicates failure due to another device within network requesting a conflicting Dataset update.

[in]aContext

A pointer to the arbitrary context (provided by user in otDatasetUpdaterRequestUpdate()).

Available when OPENTHREAD_CONFIG_DATASET_UPDATER_ENABLE is enabled.


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

Variable Documentation#

OT_TOOL_PACKED_END#

OT_TOOL_PACKED_BEGIN struct otPskc OT_TOOL_PACKED_END

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

Function Documentation#

otDatasetIsCommissioned#

bool otDatasetIsCommissioned (otInstance * aInstance)

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.


Definition at line 325 of file include/openthread/dataset.h

otDatasetGetActive#

otError otDatasetGetActive (otInstance * aInstance, otOperationalDataset * aDataset)

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.


Definition at line 336 of file include/openthread/dataset.h

otDatasetGetActiveTlvs#

otError otDatasetGetActiveTlvs (otInstance * aInstance, otOperationalDatasetTlvs * aDataset)

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.


Definition at line 347 of file include/openthread/dataset.h

otDatasetSetActive#

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

Sets the Active Operational Dataset.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDataset

A pointer to 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 Network 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.

This function consistently returns OT_ERROR_NONE and can effectively be treated as having a void return type. Previously, other errors (e.g., OT_ERROR_NOT_IMPLEMENTED) were allowed for legacy reasons. However, as non-volatile storage is now mandatory for Thread operation, any failure to save the dataset will trigger an assertion. The otError return type is retained for backward compatibility.


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

otDatasetSetActiveTlvs#

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

Sets the Active Operational Dataset.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDataset

A pointer to 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 Network 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.


Definition at line 399 of file include/openthread/dataset.h

otDatasetGetPending#

otError otDatasetGetPending (otInstance * aInstance, otOperationalDataset * aDataset)

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.


Definition at line 410 of file include/openthread/dataset.h

otDatasetGetPendingTlvs#

otError otDatasetGetPendingTlvs (otInstance * aInstance, otOperationalDatasetTlvs * aDataset)

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.


Definition at line 421 of file include/openthread/dataset.h

otDatasetSetPending#

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

Sets the Pending Operational Dataset.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDataset

A pointer to the Pending Operational Dataset.

This function consistently returns OT_ERROR_NONE and can effectively be treated as having a void return type. Previously, other errors (e.g., OT_ERROR_NOT_IMPLEMENTED) were allowed for legacy reasons. However, as non-volatile storage is now mandatory for Thread operation, any failure to save the dataset will trigger an assertion. The otError return type is retained for backward compatibility.


Definition at line 436 of file include/openthread/dataset.h

otDatasetSetPendingTlvs#

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

Sets the Pending Operational Dataset.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDataset

A pointer to the Pending Operational Dataset.


Definition at line 447 of file include/openthread/dataset.h

otDatasetSendMgmtActiveGet#

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

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.


Definition at line 461 of file include/openthread/dataset.h

otDatasetSendMgmtActiveSet#

otError otDatasetSendMgmtActiveSet (otInstance * aInstance, const otOperationalDataset * aDataset, const uint8_t * aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void * aContext)

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.

[in]aCallback

A pointer to a function that is called on response reception or timeout.

[in]aContext

A pointer to application-specific context for aCallback.


Definition at line 481 of file include/openthread/dataset.h

otDatasetSendMgmtPendingGet#

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

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.


Definition at line 500 of file include/openthread/dataset.h

otDatasetSendMgmtPendingSet#

otError otDatasetSendMgmtPendingSet (otInstance * aInstance, const otOperationalDataset * aDataset, const uint8_t * aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void * aContext)

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.

[in]aCallback

A pointer to a function that is called on response reception or timeout.

[in]aContext

A pointer to application-specific context for aCallback.


Definition at line 520 of file include/openthread/dataset.h

otDatasetGeneratePskc#

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

Generates PSKc from a given pass-phrase, network name, and extended PAN ID.

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.

PSKc is used to establish the Commissioner Session.


Definition at line 540 of file include/openthread/dataset.h

otNetworkNameFromString#

otError otNetworkNameFromString (otNetworkName * aNetworkName, const char * aNameString)

Sets an otNetworkName instance from a given null terminated C string.

Parameters
[out]aNetworkName

A pointer to the otNetworkName to set.

[in]aNameString

A name C string.

aNameString must follow UTF-8 encoding and the Network Name length must not be longer than OT_NETWORK_NAME_MAX_SIZE.


Definition at line 557 of file include/openthread/dataset.h

otDatasetParseTlvs#

otError otDatasetParseTlvs (const otOperationalDatasetTlvs * aDatasetTlvs, otOperationalDataset * aDataset)

Parses an Operational Dataset from a given otOperationalDatasetTlvs.

Parameters
[in]aDatasetTlvs

A pointer to dataset TLVs.

[out]aDataset

A pointer to where the dataset will be placed.


Definition at line 568 of file include/openthread/dataset.h

otDatasetConvertToTlvs#

void otDatasetConvertToTlvs (const otOperationalDataset * aDataset, otOperationalDatasetTlvs * aDatasetTlvs)

Converts a given Operational Dataset to otOperationalDatasetTlvs.

Parameters
[in]aDataset

An Operational dataset to convert to TLVs.

[out]aDatasetTlvs

A pointer to dataset TLVs to return the result.


Definition at line 576 of file include/openthread/dataset.h

otDatasetUpdateTlvs#

otError otDatasetUpdateTlvs (const otOperationalDataset * aDataset, otOperationalDatasetTlvs * aDatasetTlvs)

Updates a given Operational Dataset.

Parameters
[in]aDataset

Specifies the set of types and values to update.

[inout]aDatasetTlvs

A pointer to dataset TLVs to update.

aDataset contains the fields to be updated and their new value.


Definition at line 590 of file include/openthread/dataset.h

otDatasetCreateNewNetwork#

otError otDatasetCreateNewNetwork (otInstance * aInstance, otOperationalDataset * aDataset)

For FTD only, 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.


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

otDatasetGetDelayTimerMinimal#

uint32_t otDatasetGetDelayTimerMinimal (otInstance * aInstance)

For FTD only, gets a minimal delay timer.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


Definition at line 69 of file include/openthread/dataset_ftd.h

otDatasetSetDelayTimerMinimal#

otError otDatasetSetDelayTimerMinimal (otInstance * aInstance, uint32_t aDelayTimerMinimal)

For FTD only, sets a minimal delay timer.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDelayTimerMinimal

The value of minimal delay timer (in ms).

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 83 of file include/openthread/dataset_ftd.h

otDatasetUpdaterRequestUpdate#

otError otDatasetUpdaterRequestUpdate (otInstance * aInstance, const otOperationalDataset * aDataset, otDatasetUpdaterCallback aCallback, void * aContext)

Requests an update to Operational Dataset.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDataset

A pointer to the Dataset containing the fields to change.

[in]aCallback

A callback to indicate when Dataset update request finishes.

[in]aContext

An arbitrary context passed to callback.

Available when OPENTHREAD_CONFIG_DATASET_UPDATER_ENABLE is enabled.

aDataset should contain the fields to be updated and their new value. It must not contain Active or Pending Timestamp fields. The Delay field is optional, if not provided a default value (1000 ms) would be used.


Definition at line 89 of file include/openthread/dataset_updater.h

otDatasetUpdaterCancelUpdate#

void otDatasetUpdaterCancelUpdate (otInstance * aInstance)

Cancels an ongoing (if any) Operational Dataset update request.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Available when OPENTHREAD_CONFIG_DATASET_UPDATER_ENABLE is enabled.


Definition at line 101 of file include/openthread/dataset_updater.h

otDatasetUpdaterIsUpdateOngoing#

bool otDatasetUpdaterIsUpdateOngoing (otInstance * aInstance)

Indicates whether there is an ongoing Operation Dataset update request.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Available when OPENTHREAD_CONFIG_DATASET_UPDATER_ENABLE is enabled.


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

Macro Definition Documentation#

OT_NETWORK_KEY_SIZE#

#define OT_NETWORK_KEY_SIZE
Value:
16

Size of the Thread Network Key (bytes)


Definition at line 56 of file include/openthread/dataset.h

OT_NETWORK_NAME_MAX_SIZE#

#define OT_NETWORK_NAME_MAX_SIZE
Value:
16

Maximum size of the Thread Network Name field (bytes)


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

OT_EXT_PAN_ID_SIZE#

#define OT_EXT_PAN_ID_SIZE
Value:
8

Size of a Thread PAN ID (bytes)


Definition at line 91 of file include/openthread/dataset.h

OT_MESH_LOCAL_PREFIX_SIZE#

#define OT_MESH_LOCAL_PREFIX_SIZE
Value:
OT_IP6_PREFIX_SIZE

Size of the Mesh Local Prefix (bytes)


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

OT_PSKC_MAX_SIZE#

#define OT_PSKC_MAX_SIZE
Value:
16

Maximum size of the PSKc (bytes)


Definition at line 114 of file include/openthread/dataset.h

OT_CHANNEL_1_MASK#

#define OT_CHANNEL_1_MASK
Value:
(1 << 1)

Channel 1.


Definition at line 159 of file include/openthread/dataset.h

OT_CHANNEL_2_MASK#

#define OT_CHANNEL_2_MASK
Value:
(1 << 2)

Channel 2.


Definition at line 160 of file include/openthread/dataset.h

OT_CHANNEL_3_MASK#

#define OT_CHANNEL_3_MASK
Value:
(1 << 3)

Channel 3.


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

OT_CHANNEL_4_MASK#

#define OT_CHANNEL_4_MASK
Value:
(1 << 4)

Channel 4.


Definition at line 162 of file include/openthread/dataset.h

OT_CHANNEL_5_MASK#

#define OT_CHANNEL_5_MASK
Value:
(1 << 5)

Channel 5.


Definition at line 163 of file include/openthread/dataset.h

OT_CHANNEL_6_MASK#

#define OT_CHANNEL_6_MASK
Value:
(1 << 6)

Channel 6.


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

OT_CHANNEL_7_MASK#

#define OT_CHANNEL_7_MASK
Value:
(1 << 7)

Channel 7.


Definition at line 165 of file include/openthread/dataset.h

OT_CHANNEL_8_MASK#

#define OT_CHANNEL_8_MASK
Value:
(1 << 8)

Channel 8.


Definition at line 166 of file include/openthread/dataset.h

OT_CHANNEL_9_MASK#

#define OT_CHANNEL_9_MASK
Value:
(1 << 9)

Channel 9.


Definition at line 167 of file include/openthread/dataset.h

OT_CHANNEL_10_MASK#

#define OT_CHANNEL_10_MASK
Value:
(1 << 10)

Channel 10.


Definition at line 168 of file include/openthread/dataset.h

OT_CHANNEL_11_MASK#

#define OT_CHANNEL_11_MASK
Value:
(1 << 11)

Channel 11.


Definition at line 169 of file include/openthread/dataset.h

OT_CHANNEL_12_MASK#

#define OT_CHANNEL_12_MASK
Value:
(1 << 12)

Channel 12.


Definition at line 170 of file include/openthread/dataset.h

OT_CHANNEL_13_MASK#

#define OT_CHANNEL_13_MASK
Value:
(1 << 13)

Channel 13.


Definition at line 171 of file include/openthread/dataset.h

OT_CHANNEL_14_MASK#

#define OT_CHANNEL_14_MASK
Value:
(1 << 14)

Channel 14.


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

OT_CHANNEL_15_MASK#

#define OT_CHANNEL_15_MASK
Value:
(1 << 15)

Channel 15.


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

OT_CHANNEL_16_MASK#

#define OT_CHANNEL_16_MASK
Value:
(1 << 16)

Channel 16.


Definition at line 174 of file include/openthread/dataset.h

OT_CHANNEL_17_MASK#

#define OT_CHANNEL_17_MASK
Value:
(1 << 17)

Channel 17.


Definition at line 175 of file include/openthread/dataset.h

OT_CHANNEL_18_MASK#

#define OT_CHANNEL_18_MASK
Value:
(1 << 18)

Channel 18.


Definition at line 176 of file include/openthread/dataset.h

OT_CHANNEL_19_MASK#

#define OT_CHANNEL_19_MASK
Value:
(1 << 19)

Channel 19.


Definition at line 177 of file include/openthread/dataset.h

OT_CHANNEL_20_MASK#

#define OT_CHANNEL_20_MASK
Value:
(1 << 20)

Channel 20.


Definition at line 178 of file include/openthread/dataset.h

OT_CHANNEL_21_MASK#

#define OT_CHANNEL_21_MASK
Value:
(1 << 21)

Channel 21.


Definition at line 179 of file include/openthread/dataset.h

OT_CHANNEL_22_MASK#

#define OT_CHANNEL_22_MASK
Value:
(1 << 22)

Channel 22.


Definition at line 180 of file include/openthread/dataset.h

OT_CHANNEL_23_MASK#

#define OT_CHANNEL_23_MASK
Value:
(1 << 23)

Channel 23.


Definition at line 181 of file include/openthread/dataset.h

OT_CHANNEL_24_MASK#

#define OT_CHANNEL_24_MASK
Value:
(1 << 24)

Channel 24.


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

OT_CHANNEL_25_MASK#

#define OT_CHANNEL_25_MASK
Value:
(1 << 25)

Channel 25.


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

OT_CHANNEL_26_MASK#

#define OT_CHANNEL_26_MASK
Value:
(1 << 26)

Channel 26.


Definition at line 184 of file include/openthread/dataset.h

OT_OPERATIONAL_DATASET_MAX_LENGTH#

#define OT_OPERATIONAL_DATASET_MAX_LENGTH
Value:
254

Maximum length of Operational Dataset in bytes.


Definition at line 242 of file include/openthread/dataset.h