nRF5 SDK for Thread
Data Structures | Typedefs | Enumerations | Functions

This module includes functions that manage configuration parameters for the Thread Child, Router, and Leader roles. More...

Data Structures

struct  otOperationalDataset
 
struct  otCommissioningDataset
 
struct  otLinkModeConfig
 

Typedefs

typedef struct otOperationalDataset otOperationalDataset
 
typedef struct
otCommissioningDataset 
otCommissioningDataset
 
typedef enum otMeshcopTlvType otMeshcopTlvType
 
typedef struct otLinkModeConfig otLinkModeConfig
 

Enumerations

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_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_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
}
 
enum  {
  OT_IP6_ADDRESS_ADDED = 1 << 0, OT_IP6_ADDRESS_REMOVED = 1 << 1, OT_NET_ROLE = 1 << 3, OT_NET_PARTITION_ID = 1 << 4,
  OT_NET_KEY_SEQUENCE_COUNTER = 1 << 5, OT_THREAD_CHILD_ADDED = 1 << 6, OT_THREAD_CHILD_REMOVED = 1 << 7, OT_THREAD_NETDATA_UPDATED = 1 << 8,
  OT_IP6_LL_ADDR_CHANGED = 1 << 9, OT_IP6_ML_ADDR_CHANGED = 1 << 10, OT_IP6_RLOC_ADDED = 1 << 11, OT_IP6_RLOC_REMOVED = 1 << 12
}
 

Functions

OTAPI uint8_t OTCALL otThreadGetMaxAllowedChildren (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otThreadSetMaxAllowedChildren (otInstance *aInstance, uint8_t aMaxChildren)
 
OTAPI uint32_t OTCALL otThreadGetChildTimeout (otInstance *aInstance)
 
OTAPI void OTCALL otThreadSetChildTimeout (otInstance *aInstance, uint32_t aTimeout)
 
OTAPI const uint8_t *OTCALL otThreadGetExtendedPanId (otInstance *aInstance)
 
OTAPI void OTCALL otThreadSetExtendedPanId (otInstance *aInstance, const uint8_t *aExtendedPanId)
 
OTAPI ThreadError OTCALL otThreadGetLeaderRloc (otInstance *aInstance, otIp6Address *aLeaderRloc)
 
OTAPI otLinkModeConfig OTCALL otThreadGetLinkMode (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otThreadSetLinkMode (otInstance *aInstance, otLinkModeConfig aConfig)
 
OTAPI const uint8_t *OTCALL otThreadGetMasterKey (otInstance *aInstance, uint8_t *aKeyLength)
 
OTAPI ThreadError OTCALL otThreadSetMasterKey (otInstance *aInstance, const uint8_t *aKey, uint8_t aKeyLength)
 
OTAPI const otIp6Address *OTCALL otThreadGetMeshLocalEid (otInstance *aInstance)
 
OTAPI const uint8_t *OTCALL otThreadGetMeshLocalPrefix (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otThreadSetMeshLocalPrefix (otInstance *aInstance, const uint8_t *aMeshLocalPrefix)
 
OTAPI const char *OTCALL otThreadGetNetworkName (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otThreadSetNetworkName (otInstance *aInstance, const char *aNetworkName)
 
OTAPI bool OTCALL otThreadIsRouterRoleEnabled (otInstance *aInstance)
 
OTAPI void OTCALL otThreadSetRouterRoleEnabled (otInstance *aInstance, bool aEnabled)
 
ThreadError otThreadSetPreferredRouterId (otInstance *aInstance, uint8_t aRouterId)
 

Detailed Description

This module includes functions that manage configuration parameters for the Thread Child, Router, and Leader roles.

Typedef Documentation

This structure represents a Commissioning Dataset.

This structure represents an MLE Link Mode configuration.

This enumeration represents meshcop TLV types.

This structure represents an Active or Pending Operational Dataset.

Enumeration Type Documentation

anonymous enum

This enumeration represents flags that indicate what configuration or state has changed within OpenThread.

Enumerator
OT_IP6_ADDRESS_ADDED 

IPv6 address was added.

OT_IP6_ADDRESS_REMOVED 

IPv6 address was removed.

OT_NET_ROLE 

Device role (disabled, detached, child, router, leader) changed.

OT_NET_PARTITION_ID 

Partition ID changed.

OT_NET_KEY_SEQUENCE_COUNTER 

Thread Key Sequence changed.

OT_THREAD_CHILD_ADDED 

Child was added.

OT_THREAD_CHILD_REMOVED 

Child was removed.

OT_THREAD_NETDATA_UPDATED 

Thread Network Data updated.

OT_IP6_LL_ADDR_CHANGED 

The link-local address has changed.

OT_IP6_ML_ADDR_CHANGED 

The mesh-local address has changed.

OT_IP6_RLOC_ADDED 

RLOC was added.

OT_IP6_RLOC_REMOVED 

RLOC was removed.

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

Function Documentation

OTAPI uint32_t OTCALL otThreadGetChildTimeout ( otInstance *  aInstance)

Get the Thread Child Timeout used when operating in the Child role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Thread Child Timeout value.
See Also
otThreadSetChildTimeout
OTAPI const uint8_t* OTCALL otThreadGetExtendedPanId ( otInstance *  aInstance)

Get the IEEE 802.15.4 Extended PAN ID.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the IEEE 802.15.4 Extended PAN ID.
See Also
otThreadSetExtendedPanId
OTAPI ThreadError OTCALL otThreadGetLeaderRloc ( otInstance *  aInstance,
otIp6Address aLeaderRloc 
)

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

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aLeaderRlocA pointer to where the Leader's RLOC will be written.
Return values
kThreadError_NoneThe Leader's RLOC was successfully written to aLeaderRloc.
kThreadError_InvalidArgsaLeaderRloc was NULL.
kThreadError_DetachedNot currently attached to a Thread Partition.
OTAPI otLinkModeConfig OTCALL otThreadGetLinkMode ( otInstance *  aInstance)

Get the MLE Link Mode configuration.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The MLE Link Mode configuration.
See Also
otThreadSetLinkMode
OTAPI const uint8_t* OTCALL otThreadGetMasterKey ( otInstance *  aInstance,
uint8_t *  aKeyLength 
)

Get the thrMasterKey.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aKeyLengthA pointer to an unsigned 8-bit value that the function will set to the number of bytes that represent the thrMasterKey. Caller may set to NULL.
Returns
A pointer to a buffer containing the thrMasterKey.
See Also
otThreadSetMasterKey
OTAPI uint8_t OTCALL otThreadGetMaxAllowedChildren ( otInstance *  aInstance)

Get the maximum number of children currently allowed.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The maximum number of children currently allowed.
See Also
otThreadSetMaxAllowedChildren
OTAPI const otIp6Address* OTCALL otThreadGetMeshLocalEid ( otInstance *  aInstance)

This function returns a pointer to the Mesh Local EID.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the Mesh Local EID.
OTAPI const uint8_t* OTCALL otThreadGetMeshLocalPrefix ( otInstance *  aInstance)

This function returns a pointer to the Mesh Local Prefix.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the Mesh Local Prefix.
OTAPI const char* OTCALL otThreadGetNetworkName ( otInstance *  aInstance)

Get the Thread Network Name.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the Thread Network Name.
See Also
otThreadSetNetworkName
OTAPI bool OTCALL otThreadIsRouterRoleEnabled ( otInstance *  aInstance)

This function indicates whether or not the Router Role is enabled.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
TRUEIf the Router Role is enabled.
FALSEIf the Router Role is not enabled.
OTAPI void OTCALL otThreadSetChildTimeout ( otInstance *  aInstance,
uint32_t  aTimeout 
)

Set the Thread Child Timeout used when operating in the Child role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
See Also
otThreadSetChildTimeout
OTAPI void OTCALL otThreadSetExtendedPanId ( otInstance *  aInstance,
const uint8_t *  aExtendedPanId 
)

Set the IEEE 802.15.4 Extended PAN ID.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aExtendedPanIdA pointer to the IEEE 802.15.4 Extended PAN ID.
See Also
otThreadGetExtendedPanId
OTAPI ThreadError OTCALL otThreadSetLinkMode ( otInstance *  aInstance,
otLinkModeConfig  aConfig 
)

Set the MLE Link Mode configuration.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aConfigA pointer to the Link Mode configuration.
Return values
kThreadErrorNoneSuccessfully set the MLE Link Mode configuration.
See Also
otThreadGetLinkMode
OTAPI ThreadError OTCALL otThreadSetMasterKey ( otInstance *  aInstance,
const uint8_t *  aKey,
uint8_t  aKeyLength 
)

Set the thrMasterKey.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aKeyA pointer to a buffer containing the thrMasterKey.
[in]aKeyLengthNumber of bytes representing the thrMasterKey stored at aKey. Valid range is [0, 16].
Return values
kThreadErrorNoneSuccessfully set the thrMasterKey.
kThreadErrorInvalidArgsIf aKeyLength is larger than 16.
See Also
otThreadGetMasterKey
OTAPI ThreadError OTCALL otThreadSetMaxAllowedChildren ( otInstance *  aInstance,
uint8_t  aMaxChildren 
)

Set the maximum number of children currently allowed.

This parameter can only be set when Thread protocol operation has been stopped.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aMaxChildrenThe maximum allowed children.
Return values
kThreadErrorNoneSuccessfully set the max.
kThreadError_InvalidArgsIf aMaxChildren is not in the range [1, OPENTHREAD_CONFIG_MAX_CHILDREN].
kThreadError_InvalidStateIf Thread isn't stopped.
See Also
otThreadGetMaxAllowedChildren, otThreadStop
OTAPI ThreadError OTCALL otThreadSetMeshLocalPrefix ( otInstance *  aInstance,
const uint8_t *  aMeshLocalPrefix 
)

This function sets the Mesh Local Prefix.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aMeshLocalPrefixA pointer to the Mesh Local Prefix.
Return values
kThreadError_NoneSuccessfully set the Mesh Local Prefix.
OTAPI ThreadError OTCALL otThreadSetNetworkName ( otInstance *  aInstance,
const char *  aNetworkName 
)

Set the Thread Network Name.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aNetworkNameA pointer to the Thread Network Name.
Return values
kThreadErrorNoneSuccessfully set the Thread Network Name.
See Also
otThreadGetNetworkName
ThreadError otThreadSetPreferredRouterId ( otInstance *  aInstance,
uint8_t  aRouterId 
)

Set the preferred Router Id.

Upon becoming a router/leader the node attempts to use this Router Id. If the preferred Router Id is not set or if it can not be used, a randomly generated router id is picked. This property can be set only when the device role is either detached or disabled.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aRouterIdThe preferred Router Id.
Return values
kThreadError_NoneSuccessfully set the preferred Router Id.
kThreadError_InvalidStateCould not set (role is not detached or disabled)
OTAPI void OTCALL otThreadSetRouterRoleEnabled ( otInstance *  aInstance,
bool  aEnabled 
)

This function sets whether or not the Router Role is enabled.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aEnabledTRUE if the Router Role is enabled, FALSE otherwise.

Documentation feedback | Developer Zone | Subscribe | Updated