Operational Dataset
This module includes functions for Dataset Updater.
Summary
The functions in this module are available when Dataset Updater feature is enabled (i.e. OPENTHREAD_CONFIG_DATASET_UPDATER_ENABLE
is set to 1). Further this feature is available only on an FTD build.
Typedefs |
|
---|---|
otChannelMask
|
typedefuint32_t
This type represents Channel Mask. |
otDatasetMgmtSetCallback)(otError aResult, void *aContext)
|
typedefvoid(*
This function pointer is called when a response to a MGMT_SET request is received or times out. |
otDatasetUpdaterCallback)(otError aError, void *aContext)
|
typedefvoid(*
This callback function pointer is called when a Dataset update request finishes, reporting success or failure status of the Dataset update request. |
otExtendedPanId
|
typedefstruct otExtendedPanId
This structure represents an Extended PAN ID. |
otMeshLocalPrefix
|
typedef This structure represents a Mesh Local Prefix. |
otMeshcopTlvType
|
typedefenum otMeshcopTlvType
This enumeration represents meshcop TLV types. |
otNetworkKey
|
typedefstruct otNetworkKey
This structure represents a Thread Network Key. |
otNetworkKeyRef
|
typedef This datatype represents KeyRef to NetworkKey. |
otNetworkName
|
typedefstruct otNetworkName
This structure represents a Network Name. |
otOperationalDataset
|
typedefstruct otOperationalDataset
This structure represents an Active or Pending Operational Dataset. |
otOperationalDatasetComponents
|
typedef This structure represents presence of different components in Active or Pending Operational Dataset. |
otOperationalDatasetTlvs
|
typedefstruct otOperationalDatasetTlvs
This structure represents an Active or Pending Operational Dataset. |
otPskc
|
typedefstruct otPskc
This structure represents a PSKc. |
otPskcRef
|
typedef This datatype represents KeyRef to PSKc. |
otSecurityPolicy
|
typedefstruct otSecurityPolicy
This structure represent Security Policy. |
otTimestamp
|
typedefstruct otTimestamp
This structure represents a Thread Dataset timestamp component. |
Variables |
|
---|---|
OT_TOOL_PACKED_END
|
OT_TOOL_PACKED_BEGIN struct otNetworkKey
|
Functions |
|
---|---|
otDatasetCreateNewNetwork(otInstance *aInstance, otOperationalDataset *aDataset)
|
This method creates a new Operational Dataset to use when forming a new network.
|
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.
|
otDatasetGetActive(otInstance *aInstance, otOperationalDataset *aDataset)
|
This function gets the Active Operational Dataset.
|
otDatasetGetActiveTlvs(otInstance *aInstance, otOperationalDatasetTlvs *aDataset)
|
This function gets the Active Operational Dataset.
|
otDatasetGetDelayTimerMinimal(otInstance *aInstance)
|
uint32_t
Get minimal delay timer.
|
otDatasetGetPending(otInstance *aInstance, otOperationalDataset *aDataset)
|
This function gets the Pending Operational Dataset.
|
otDatasetGetPendingTlvs(otInstance *aInstance, otOperationalDatasetTlvs *aDataset)
|
This function gets the Pending Operational Dataset.
|
otDatasetIsCommissioned(otInstance *aInstance)
|
bool
This function indicates whether a valid network is present in the Active Operational Dataset or not.
|
otDatasetParseTlvs(const otOperationalDatasetTlvs *aDatasetTlvs, otOperationalDataset *aDataset)
|
This function parses an Operational Dataset from a
otOperationalDatasetTlvs . |
otDatasetSendMgmtActiveGet(otInstance *aInstance, const otOperationalDatasetComponents *aDatasetComponents, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress)
|
This function sends MGMT_ACTIVE_GET.
|
otDatasetSendMgmtActiveSet(otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void *aContext)
|
This function sends MGMT_ACTIVE_SET.
|
otDatasetSendMgmtPendingGet(otInstance *aInstance, const otOperationalDatasetComponents *aDatasetComponents, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress)
|
This function sends MGMT_PENDING_GET.
|
otDatasetSendMgmtPendingSet(otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void *aContext)
|
This function sends MGMT_PENDING_SET.
|
otDatasetSetActive(otInstance *aInstance, const otOperationalDataset *aDataset)
|
This function sets the Active Operational Dataset.
|
otDatasetSetActiveTlvs(otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)
|
This function sets the Active Operational Dataset.
|
otDatasetSetDelayTimerMinimal(otInstance *aInstance, uint32_t aDelayTimerMinimal)
|
Set minimal delay timer.
|
otDatasetSetPending(otInstance *aInstance, const otOperationalDataset *aDataset)
|
This function sets the Pending Operational Dataset.
|
otDatasetSetPendingTlvs(otInstance *aInstance, const otOperationalDatasetTlvs *aDataset)
|
This function sets the Pending Operational Dataset.
|
otDatasetUpdaterCancelUpdate(otInstance *aInstance)
|
void
This function cancels an ongoing (if any) Operational Dataset update request.
|
otDatasetUpdaterIsUpdateOngoing(otInstance *aInstance)
|
bool
This function indicates whether there is an ongoing Operation Dataset update request.
|
otDatasetUpdaterRequestUpdate(otInstance *aInstance, const otOperationalDataset *aDataset, otDatasetUpdaterCallback aCallback, void *aContext)
|
This function requests an update to Operational Dataset.
|
otNetworkNameFromString(otNetworkName *aNetworkName, const char *aNameString)
|
This function sets an
otNetworkName instance from a given null terminated C string. |
Macros |
|
---|---|
OT_CHANNEL_10_MASK (1 << 10)
|
Channel 10.
|
OT_CHANNEL_11_MASK (1 << 11)
|
Channel 11.
|
OT_CHANNEL_12_MASK (1 << 12)
|
Channel 12.
|
OT_CHANNEL_13_MASK (1 << 13)
|
Channel 13.
|
OT_CHANNEL_14_MASK (1 << 14)
|
Channel 14.
|
OT_CHANNEL_15_MASK (1 << 15)
|
Channel 15.
|
OT_CHANNEL_16_MASK (1 << 16)
|
Channel 16.
|
OT_CHANNEL_17_MASK (1 << 17)
|
Channel 17.
|
OT_CHANNEL_18_MASK (1 << 18)
|
Channel 18.
|
OT_CHANNEL_19_MASK (1 << 19)
|
Channel 19.
|
OT_CHANNEL_1_MASK (1 << 1)
|
Channel 1.
|
OT_CHANNEL_20_MASK (1 << 20)
|
Channel 20.
|
OT_CHANNEL_21_MASK (1 << 21)
|
Channel 21.
|
OT_CHANNEL_22_MASK (1 << 22)
|
Channel 22.
|
OT_CHANNEL_23_MASK (1 << 23)
|
Channel 23.
|
OT_CHANNEL_24_MASK (1 << 24)
|
Channel 24.
|
OT_CHANNEL_25_MASK (1 << 25)
|
Channel 25.
|
OT_CHANNEL_26_MASK (1 << 26)
|
Channel 26.
|
OT_CHANNEL_2_MASK (1 << 2)
|
Channel 2.
|
OT_CHANNEL_3_MASK (1 << 3)
|
Channel 3.
|
OT_CHANNEL_4_MASK (1 << 4)
|
Channel 4.
|
OT_CHANNEL_5_MASK (1 << 5)
|
Channel 5.
|
OT_CHANNEL_6_MASK (1 << 6)
|
Channel 6.
|
OT_CHANNEL_7_MASK (1 << 7)
|
Channel 7.
|
OT_CHANNEL_8_MASK (1 << 8)
|
Channel 8.
|
OT_CHANNEL_9_MASK (1 << 9)
|
Channel 9.
|
OT_EXT_PAN_ID_SIZE 8
|
Size of a Thread PAN ID (bytes)
|
OT_MESH_LOCAL_PREFIX_SIZE OT_IP6_PREFIX_SIZE
|
Size of the Mesh Local Prefix (bytes)
|
OT_NETWORK_KEY_SIZE 16
|
Size of the Thread Network Key (bytes)
|
OT_NETWORK_NAME_MAX_SIZE 16
|
Maximum size of the Thread Network Name field (bytes)
|
OT_OPERATIONAL_DATASET_MAX_LENGTH 254
|
Maximum length of Operational Dataset in bytes.
|
OT_PSKC_MAX_SIZE 16
|
Maximum size of the PSKc (bytes)
|
Structs |
|
---|---|
otExtendedPanId |
This structure represents an Extended PAN ID. |
otNetworkKey |
This structure represents a Thread Network Key. |
otNetworkName |
This structure represents a Network Name. |
otOperationalDataset |
This structure represents an Active or Pending Operational Dataset. |
otOperationalDatasetComponents |
This structure represents presence of different components in Active or Pending Operational Dataset. |
otOperationalDatasetTlvs |
This structure represents an Active or Pending Operational Dataset. |
otPskc |
This structure represents PSKc. |
otSecurityPolicy |
This structure represent Security Policy. |
otTimestamp |
This structure represents a Thread Dataset timestamp component. |
Enumerations
otMeshcopTlvType
otMeshcopTlvType
This enumeration represents meshcop TLV types.
Typedefs
otChannelMask
uint32_t otChannelMask
This type represents Channel Mask.
otDatasetMgmtSetCallback
void(* otDatasetMgmtSetCallback)(otError aResult, void *aContext)
This function pointer is called when a response to a MGMT_SET request is received or times out.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otDatasetUpdaterCallback
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otExtendedPanId
struct otExtendedPanId otExtendedPanId
This structure represents an Extended PAN ID.
otMeshLocalPrefix
otIp6NetworkPrefix otMeshLocalPrefix
This structure represents a Mesh Local Prefix.
otMeshcopTlvType
enum otMeshcopTlvType otMeshcopTlvType
This enumeration represents meshcop TLV types.
otNetworkKeyRef
otCryptoKeyRef otNetworkKeyRef
This datatype represents KeyRef to NetworkKey.
Reference to Key
otNetworkName
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
).
otOperationalDataset
struct otOperationalDataset 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.
otOperationalDatasetComponents
struct otOperationalDatasetComponents otOperationalDatasetComponents
This structure represents presence of different components in Active or Pending Operational Dataset.
otOperationalDatasetTlvs
struct otOperationalDatasetTlvs otOperationalDatasetTlvs
This structure represents an Active or Pending Operational Dataset.
The Operational Dataset is TLV encoded as specified by Thread.
otTimestamp
struct otTimestamp otTimestamp
This structure represents a Thread Dataset timestamp component.
Variables
OT_TOOL_PACKED_END
OT_TOOL_PACKED_BEGIN struct otNetworkKey OT_TOOL_PACKED_END
Functions
otDatasetCreateNewNetwork
otError otDatasetCreateNewNetwork( otInstance *aInstance, otOperationalDataset *aDataset )
This method creates a new Operational Dataset to use when forming a new network.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
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.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otDatasetGetActive
otError otDatasetGetActive( otInstance *aInstance, otOperationalDataset *aDataset )
This function gets the Active Operational Dataset.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otDatasetGetActiveTlvs
otError otDatasetGetActiveTlvs( otInstance *aInstance, otOperationalDatasetTlvs *aDataset )
This function gets the Active Operational Dataset.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otDatasetGetDelayTimerMinimal
uint32_t otDatasetGetDelayTimerMinimal( otInstance *aInstance )
Get minimal delay timer.
Details | |||
---|---|---|---|
Parameters |
|
||
Return Values |
|
otDatasetGetPending
otError otDatasetGetPending( otInstance *aInstance, otOperationalDataset *aDataset )
This function gets the Pending Operational Dataset.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otDatasetGetPendingTlvs
otError otDatasetGetPendingTlvs( otInstance *aInstance, otOperationalDatasetTlvs *aDataset )
This function gets the Pending Operational Dataset.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otDatasetIsCommissioned
bool otDatasetIsCommissioned( otInstance *aInstance )
This function indicates whether a valid network is present in the Active Operational Dataset or not.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
TRUE if a valid network is present in the Active Operational Dataset, FALSE otherwise.
|
otDatasetParseTlvs
otError otDatasetParseTlvs( const otOperationalDatasetTlvs *aDatasetTlvs, otOperationalDataset *aDataset )
This function parses an Operational Dataset from a otOperationalDatasetTlvs
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otDatasetSendMgmtActiveGet
otError otDatasetSendMgmtActiveGet( otInstance *aInstance, const otOperationalDatasetComponents *aDatasetComponents, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress )
This function sends MGMT_ACTIVE_GET.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otDatasetSendMgmtActiveSet
otError otDatasetSendMgmtActiveSet( otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void *aContext )
This function sends MGMT_ACTIVE_SET.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
otDatasetSendMgmtPendingGet
otError otDatasetSendMgmtPendingGet( otInstance *aInstance, const otOperationalDatasetComponents *aDatasetComponents, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress )
This function sends MGMT_PENDING_GET.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otDatasetSendMgmtPendingSet
otError otDatasetSendMgmtPendingSet( otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength, otDatasetMgmtSetCallback aCallback, void *aContext )
This function sends MGMT_PENDING_SET.
Details | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||
Return Values |
|
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 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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
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 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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otDatasetSetDelayTimerMinimal
otError otDatasetSetDelayTimerMinimal( otInstance *aInstance, uint32_t aDelayTimerMinimal )
Set minimal delay timer.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otDatasetSetPending
otError otDatasetSetPending( otInstance *aInstance, const otOperationalDataset *aDataset )
This function sets the Pending Operational Dataset.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otDatasetSetPendingTlvs
otError otDatasetSetPendingTlvs( otInstance *aInstance, const otOperationalDatasetTlvs *aDataset )
This function sets the Pending Operational Dataset.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otDatasetUpdaterCancelUpdate
void otDatasetUpdaterCancelUpdate( otInstance *aInstance )
This function cancels an ongoing (if any) Operational Dataset update request.
Details | |||
---|---|---|---|
Parameters |
|
otDatasetUpdaterIsUpdateOngoing
bool otDatasetUpdaterIsUpdateOngoing( otInstance *aInstance )
This function indicates whether there is an ongoing Operation Dataset update request.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otDatasetUpdaterRequestUpdate
otError otDatasetUpdaterRequestUpdate( otInstance *aInstance, const otOperationalDataset *aDataset, otDatasetUpdaterCallback aCallback, void *aContext )
This function requests an update to Operational Dataset.
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.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otNetworkNameFromString
otError otNetworkNameFromString( otNetworkName *aNetworkName, const char *aNameString )
This function sets an otNetworkName
instance from a given null terminated C string.
This function also validates that the given aNameString
follows UTF-8 encoding and its length is not longer than OT_NETWORK_NAME_MAX_SIZE
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
Macros
OT_CHANNEL_10_MASK
OT_CHANNEL_10_MASK (1 << 10)
Channel 10.
OT_CHANNEL_11_MASK
OT_CHANNEL_11_MASK (1 << 11)
Channel 11.
OT_CHANNEL_12_MASK
OT_CHANNEL_12_MASK (1 << 12)
Channel 12.
OT_CHANNEL_13_MASK
OT_CHANNEL_13_MASK (1 << 13)
Channel 13.
OT_CHANNEL_14_MASK
OT_CHANNEL_14_MASK (1 << 14)
Channel 14.
OT_CHANNEL_15_MASK
OT_CHANNEL_15_MASK (1 << 15)
Channel 15.
OT_CHANNEL_16_MASK
OT_CHANNEL_16_MASK (1 << 16)
Channel 16.
OT_CHANNEL_17_MASK
OT_CHANNEL_17_MASK (1 << 17)
Channel 17.
OT_CHANNEL_18_MASK
OT_CHANNEL_18_MASK (1 << 18)
Channel 18.
OT_CHANNEL_19_MASK
OT_CHANNEL_19_MASK (1 << 19)
Channel 19.
OT_CHANNEL_1_MASK
OT_CHANNEL_1_MASK (1 << 1)
Channel 1.
OT_CHANNEL_20_MASK
OT_CHANNEL_20_MASK (1 << 20)
Channel 20.
OT_CHANNEL_21_MASK
OT_CHANNEL_21_MASK (1 << 21)
Channel 21.
OT_CHANNEL_22_MASK
OT_CHANNEL_22_MASK (1 << 22)
Channel 22.
OT_CHANNEL_23_MASK
OT_CHANNEL_23_MASK (1 << 23)
Channel 23.
OT_CHANNEL_24_MASK
OT_CHANNEL_24_MASK (1 << 24)
Channel 24.
OT_CHANNEL_25_MASK
OT_CHANNEL_25_MASK (1 << 25)
Channel 25.
OT_CHANNEL_26_MASK
OT_CHANNEL_26_MASK (1 << 26)
Channel 26.
OT_CHANNEL_2_MASK
OT_CHANNEL_2_MASK (1 << 2)
Channel 2.
OT_CHANNEL_3_MASK
OT_CHANNEL_3_MASK (1 << 3)
Channel 3.
OT_CHANNEL_4_MASK
OT_CHANNEL_4_MASK (1 << 4)
Channel 4.
OT_CHANNEL_5_MASK
OT_CHANNEL_5_MASK (1 << 5)
Channel 5.
OT_CHANNEL_6_MASK
OT_CHANNEL_6_MASK (1 << 6)
Channel 6.
OT_CHANNEL_7_MASK
OT_CHANNEL_7_MASK (1 << 7)
Channel 7.
OT_CHANNEL_8_MASK
OT_CHANNEL_8_MASK (1 << 8)
Channel 8.
OT_CHANNEL_9_MASK
OT_CHANNEL_9_MASK (1 << 9)
Channel 9.
OT_EXT_PAN_ID_SIZE
OT_EXT_PAN_ID_SIZE 8
Size of a Thread PAN ID (bytes)
OT_MESH_LOCAL_PREFIX_SIZE
OT_MESH_LOCAL_PREFIX_SIZE OT_IP6_PREFIX_SIZE
Size of the Mesh Local Prefix (bytes)
OT_NETWORK_KEY_SIZE
OT_NETWORK_KEY_SIZE 16
Size of the Thread Network Key (bytes)
OT_NETWORK_NAME_MAX_SIZE
OT_NETWORK_NAME_MAX_SIZE 16
Maximum size of the Thread Network Name field (bytes)
OT_OPERATIONAL_DATASET_MAX_LENGTH
OT_OPERATIONAL_DATASET_MAX_LENGTH 254
Maximum length of Operational Dataset in bytes.
OT_PSKC_MAX_SIZE
OT_PSKC_MAX_SIZE 16
Maximum size of the PSKc (bytes)
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.