Modules#

otNetworkKey

otNetworkName

otExtendedPanId

otPskc

otSecurityPolicy

otOperationalDatasetComponents

otTimestamp

otOperationalDataset

otOperationalDatasetTlvs

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.

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_DISCOVERYREQUEST = 128
OT_MESHCOP_TLV_DISCOVERYRESPONSE = 129
OT_MESHCOP_TLV_JOINERADVERTISEMENT = 241
}

This enumeration represents meshcop TLV types.

Typedefs#

typedef struct otNetworkKey

This structure represents a Thread Network Key.

This datatype represents KeyRef to NetworkKey.

typedef struct otNetworkName

This structure represents a Network Name.

typedef struct otExtendedPanId

This structure represents an Extended PAN ID.

This structure represents a Mesh Local Prefix.

typedef struct otPskc

This structure represents a PSKc.

This datatype represents KeyRef to PSKc.

typedef struct otSecurityPolicy

This structure represent Security Policy.

typedef uint32_t

This type represents Channel Mask.

This structure represents presence of different components in Active or Pending Operational Dataset.

typedef struct otTimestamp

This structure represents a Thread Dataset timestamp component.

typedef struct otOperationalDataset

This structure represents an Active or Pending Operational Dataset.

This structure represents an Active or Pending Operational Dataset.

typedef enum otMeshcopTlvType

This enumeration represents meshcop TLV types.

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

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

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

This function gets the Active Operational Dataset.

otDatasetSetActive(otInstance *aInstance, const otOperationalDataset *aDataset)

Sets the Active Operational Dataset.

otDatasetSetActiveTlvs(otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)

This function sets the Active Operational Dataset.

otDatasetGetPending(otInstance *aInstance, otOperationalDataset *aDataset)

This function gets the Pending Operational Dataset.

otDatasetGetPendingTlvs(otInstance *aInstance, otOperationalDatasetTlvs *aDataset)

This function gets the Pending Operational Dataset.

otDatasetSetPending(otInstance *aInstance, const otOperationalDataset *aDataset)

Sets the Pending Operational Dataset.

otDatasetSetPendingTlvs(otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)

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

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

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)

This function requests an update to Operational Dataset.

void
otDatasetUpdaterCancelUpdate(otInstance *aInstance)

This function cancels an ongoing (if any) Operational Dataset update request.

bool
otDatasetUpdaterIsUpdateOngoing(otInstance *aInstance)

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

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_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_DISCOVERYREQUEST

meshcop Discovery Request TLV

OT_MESHCOP_TLV_DISCOVERYRESPONSE

meshcop Discovery Response TLV

OT_MESHCOP_TLV_JOINERADVERTISEMENT

meshcop Joiner Advertisement TLV


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

Typedef Documentation#

otNetworkKey#

typedef struct otNetworkKey otNetworkKey

This structure represents a Thread Network Key.


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

otNetworkKeyRef#

typedef otCryptoKeyRef otNetworkKeyRef

This datatype represents KeyRef to NetworkKey.

Reference to Key


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

otNetworkName#

typedef struct otNetworkName otNetworkName

This structure 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 93 of file include/openthread/dataset.h

otExtendedPanId#

typedef struct otExtendedPanId otExtendedPanId

This structure represents an Extended PAN ID.


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

otMeshLocalPrefix#

typedef otIp6NetworkPrefix otMeshLocalPrefix

This structure represents a Mesh Local Prefix.


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

otPskc#

typedef struct otPskc otPskc

This structure represents a PSKc.


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

otPskcRef#

typedef otCryptoKeyRef otPskcRef

This datatype represents KeyRef to PSKc.

Reference to Key


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

otSecurityPolicy#

typedef struct otSecurityPolicy otSecurityPolicy

This structure represent Security Policy.


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

otChannelMask#

typedef uint32_t otChannelMask

This type represents Channel Mask.


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

otOperationalDatasetComponents#

typedef struct otOperationalDatasetComponents otOperationalDatasetComponents

This structure represents presence of different components in Active or Pending Operational Dataset.


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

otTimestamp#

typedef struct otTimestamp otTimestamp

This structure represents a Thread Dataset timestamp component.


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

otOperationalDataset#

typedef struct otOperationalDataset otOperationalDataset

This structure 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 250 of file include/openthread/dataset.h

otOperationalDatasetTlvs#

typedef struct otOperationalDatasetTlvs otOperationalDatasetTlvs

This structure represents an Active or Pending Operational Dataset.

The Operational Dataset is TLV encoded as specified by Thread.


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

otMeshcopTlvType#

typedef enum otMeshcopTlvType otMeshcopTlvType

This enumeration represents meshcop TLV types.


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

otDatasetMgmtSetCallback#

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

This function 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 331 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 69 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 68 of file include/openthread/dataset.h

Function Documentation#

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.


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