Router/Leader#

This module includes functions for Thread Routers and Leaders.

Modules#

otChildInfo

otCacheEntryInfo

otCacheEntryIterator

otDeviceProperties

otNeighborTableEntryInfo

Enumerations#

enum
OT_CACHE_ENTRY_STATE_CACHED = 0
OT_CACHE_ENTRY_STATE_SNOOPED = 1
OT_CACHE_ENTRY_STATE_QUERY = 2
OT_CACHE_ENTRY_STATE_RETRY_QUERY = 3
}

Defines the EID cache entry state.

enum
OT_POWER_SUPPLY_BATTERY = 0
OT_POWER_SUPPLY_EXTERNAL = 1
OT_POWER_SUPPLY_EXTERNAL_STABLE = 2
OT_POWER_SUPPLY_EXTERNAL_UNSTABLE = 3
}

Represents the power supply property on a device.

enum
OT_NEIGHBOR_TABLE_EVENT_CHILD_ADDED
OT_NEIGHBOR_TABLE_EVENT_CHILD_REMOVED
OT_NEIGHBOR_TABLE_EVENT_CHILD_MODE_CHANGED
OT_NEIGHBOR_TABLE_EVENT_ROUTER_ADDED
OT_NEIGHBOR_TABLE_EVENT_ROUTER_REMOVED
}

Defines the constants used in otNeighborTableCallback to indicate changes in neighbor table.

Typedefs#

typedef uint16_t

Used to iterate through IPv6 addresses of a Thread Child entry.

typedef enum otCacheEntryState

Defines the EID cache entry state.

typedef struct otCacheEntryInfo

Represents an EID cache entry.

typedef struct otCacheEntryIterator

Represents an iterator used for iterating through the EID cache table entries.

typedef struct otDeviceProperties

Represents the device properties which are used for calculating the local leader weight on a device.

typedef void(*
otNeighborTableCallback)(otNeighborTableEvent aEvent, const otNeighborTableEntryInfo *aEntryInfo)

Pointer is called to notify that there is a change in the neighbor table.

Functions#

uint16_t
otThreadGetMaxAllowedChildren(otInstance *aInstance)

Gets the maximum number of children currently allowed.

otThreadSetMaxAllowedChildren(otInstance *aInstance, uint16_t aMaxChildren)

Sets the maximum number of children currently allowed.

bool
otThreadIsRouterEligible(otInstance *aInstance)

Indicates whether or not the device is router-eligible.

otThreadSetRouterEligible(otInstance *aInstance, bool aEligible)

Sets whether or not the device is router-eligible.

otThreadSetPreferredRouterId(otInstance *aInstance, uint8_t aRouterId)

Set the preferred Router Id.

otThreadGetDeviceProperties(otInstance *aInstance)

Get the current device properties.

void
otThreadSetDeviceProperties(otInstance *aInstance, const otDeviceProperties *aDeviceProperties)

Set the device properties which are then used to determine and set the Leader Weight.

uint8_t
otThreadGetLocalLeaderWeight(otInstance *aInstance)

Gets the Thread Leader Weight used when operating in the Leader role.

void
otThreadSetLocalLeaderWeight(otInstance *aInstance, uint8_t aWeight)

Sets the Thread Leader Weight used when operating in the Leader role.

uint32_t

Get the preferred Thread Leader Partition Id used when operating in the Leader role.

void
otThreadSetPreferredLeaderPartitionId(otInstance *aInstance, uint32_t aPartitionId)

Set the preferred Thread Leader Partition Id used when operating in the Leader role.

uint16_t
otThreadGetJoinerUdpPort(otInstance *aInstance)

Gets the Joiner UDP Port.

otThreadSetJoinerUdpPort(otInstance *aInstance, uint16_t aJoinerUdpPort)

Sets the Joiner UDP Port.

void
otThreadSetSteeringData(otInstance *aInstance, const otExtAddress *aExtAddress)

Set Steering data out of band.

uint32_t
otThreadGetContextIdReuseDelay(otInstance *aInstance)

Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.

void
otThreadSetContextIdReuseDelay(otInstance *aInstance, uint32_t aDelay)

Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.

uint8_t
otThreadGetNetworkIdTimeout(otInstance *aInstance)

Get the NETWORK_ID_TIMEOUT parameter.

void
otThreadSetNetworkIdTimeout(otInstance *aInstance, uint8_t aTimeout)

Set the NETWORK_ID_TIMEOUT parameter.

uint8_t
otThreadGetRouterUpgradeThreshold(otInstance *aInstance)

Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.

void
otThreadSetRouterUpgradeThreshold(otInstance *aInstance, uint8_t aThreshold)

Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.

uint8_t
otThreadGetChildRouterLinks(otInstance *aInstance)

Get the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.

otThreadSetChildRouterLinks(otInstance *aInstance, uint8_t aChildRouterLinks)

Set the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.

otThreadReleaseRouterId(otInstance *aInstance, uint8_t aRouterId)

Release a Router ID that has been allocated by the device in the Leader role.

otThreadBecomeRouter(otInstance *aInstance)

Attempt to become a router.

otThreadBecomeLeader(otInstance *aInstance)

Become a leader and start a new partition.

uint8_t

Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.

void
otThreadSetRouterDowngradeThreshold(otInstance *aInstance, uint8_t aThreshold)

Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.

uint8_t
otThreadGetRouterSelectionJitter(otInstance *aInstance)

Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.

void
otThreadSetRouterSelectionJitter(otInstance *aInstance, uint8_t aRouterJitter)

Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.

otThreadGetChildInfoById(otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo)

Gets diagnostic information for an attached Child by its Child ID or RLOC16.

otThreadGetChildInfoByIndex(otInstance *aInstance, uint16_t aChildIndex, otChildInfo *aChildInfo)

The function retains diagnostic information for an attached Child by the internal table index.

otThreadGetChildNextIp6Address(otInstance *aInstance, uint16_t aChildIndex, otChildIp6AddressIterator *aIterator, otIp6Address *aAddress)

Gets the next IPv6 address (using an iterator) for a given child.

uint8_t
otThreadGetRouterIdSequence(otInstance *aInstance)

Get the current Router ID Sequence.

uint8_t
otThreadGetMaxRouterId(otInstance *aInstance)

The function returns the maximum allowed router ID.

otThreadGetRouterInfo(otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo)

The function retains diagnostic information for a given Thread Router.

otThreadGetNextCacheEntry(otInstance *aInstance, otCacheEntryInfo *aEntryInfo, otCacheEntryIterator *aIterator)

Gets the next EID cache entry (using an iterator).

void
otThreadGetPskc(otInstance *aInstance, otPskc *aPskc)

Get the Thread PSKc.

otThreadGetPskcRef(otInstance *aInstance)

Get Key Reference to Thread PSKc stored.

otThreadSetPskc(otInstance *aInstance, const otPskc *aPskc)

Set the Thread PSKc.

otThreadSetPskcRef(otInstance *aInstance, otPskcRef aKeyRef)

Set the Key Reference to the Thread PSKc.

int8_t
otThreadGetParentPriority(otInstance *aInstance)

Get the assigned parent priority.

otThreadSetParentPriority(otInstance *aInstance, int8_t aParentPriority)

Set the parent priority.

uint8_t
otThreadGetMaxChildIpAddresses(otInstance *aInstance)

Gets the maximum number of IP addresses that each MTD child may register with this device as parent.

otThreadSetMaxChildIpAddresses(otInstance *aInstance, uint8_t aMaxIpAddresses)

Sets or restores the maximum number of IP addresses that each MTD child may register with this device as parent.

void
otThreadRegisterNeighborTableCallback(otInstance *aInstance, otNeighborTableCallback aCallback)

Registers a neighbor table callback function.

void
otThreadSetCcmEnabled(otInstance *aInstance, bool aEnabled)

Sets whether the device was commissioned using CCM.

void
otThreadSetThreadVersionCheckEnabled(otInstance *aInstance, bool aEnabled)

Sets whether the Security Policy TLV version-threshold for routing (VR field) is enabled.

void
otThreadSetTmfOriginFilterEnabled(otInstance *aInstance, bool aEnabled)

Enables or disables the filter to drop TMF UDP messages from untrusted origin.

bool
otThreadIsTmfOriginFilterEnabled(otInstance *aInstance)

Indicates whether the filter that drops TMF UDP messages from untrusted origin is enabled or not.

void
otThreadGetRouterIdRange(otInstance *aInstance, uint8_t *aMinRouterId, uint8_t *aMaxRouterId)

Gets the range of router IDs that are allowed to assign to nodes within the thread network.

otThreadSetRouterIdRange(otInstance *aInstance, uint8_t aMinRouterId, uint8_t aMaxRouterId)

Sets the range of router IDs that are allowed to assign to nodes within the thread network.

uint32_t

Gets the current Interval Max value used by Advertisement trickle timer.

bool
otThreadIsRouterIdAllocated(otInstance *aInstance, uint8_t aRouterId)

Indicates whether or not a Router ID is currently allocated.

void
otThreadGetNextHopAndPathCost(otInstance *aInstance, uint16_t aDestRloc16, uint16_t *aNextHopRloc16, uint8_t *aPathCost)

Gets the next hop and path cost towards a given RLOC16 destination.

Macros#

#define

Initializer for otChildIP6AddressIterator.

Enumeration Documentation#

otCacheEntryState#

otCacheEntryState

Defines the EID cache entry state.

Enumerator
OT_CACHE_ENTRY_STATE_CACHED
OT_CACHE_ENTRY_STATE_SNOOPED
OT_CACHE_ENTRY_STATE_QUERY
OT_CACHE_ENTRY_STATE_RETRY_QUERY

Definition at line 86 of file include/openthread/thread_ftd.h

otPowerSupply#

otPowerSupply

Represents the power supply property on a device.

This is used as a property in otDeviceProperties to calculate the leader weight.

Enumerator
OT_POWER_SUPPLY_BATTERY

Battery powered.

OT_POWER_SUPPLY_EXTERNAL

Externally powered (mains-powered).

OT_POWER_SUPPLY_EXTERNAL_STABLE

Stable external power with a battery backup or UPS.

OT_POWER_SUPPLY_EXTERNAL_UNSTABLE

Potentially unstable ext power (e.g. light bulb powered via a switch).


Definition at line 196 of file include/openthread/thread_ftd.h

otNeighborTableEvent#

otNeighborTableEvent

Defines the constants used in otNeighborTableCallback to indicate changes in neighbor table.

Enumerator
OT_NEIGHBOR_TABLE_EVENT_CHILD_ADDED

A child is being added.

OT_NEIGHBOR_TABLE_EVENT_CHILD_REMOVED

A child is being removed.

OT_NEIGHBOR_TABLE_EVENT_CHILD_MODE_CHANGED

An existing child's mode is changed.

OT_NEIGHBOR_TABLE_EVENT_ROUTER_ADDED

A router is being added.

OT_NEIGHBOR_TABLE_EVENT_ROUTER_REMOVED

A router is being removed.


Definition at line 743 of file include/openthread/thread_ftd.h

Typedef Documentation#

otChildIp6AddressIterator#

typedef uint16_t otChildIp6AddressIterator

Used to iterate through IPv6 addresses of a Thread Child entry.


Definition at line 81 of file include/openthread/thread_ftd.h

otCacheEntryState#

typedef enum otCacheEntryState otCacheEntryState

Defines the EID cache entry state.


Definition at line 92 of file include/openthread/thread_ftd.h

otCacheEntryInfo#

typedef struct otCacheEntryInfo otCacheEntryInfo

Represents an EID cache entry.


Definition at line 109 of file include/openthread/thread_ftd.h

otCacheEntryIterator#

typedef struct otCacheEntryIterator otCacheEntryIterator

Represents an iterator used for iterating through the EID cache table entries.

To initialize the iterator and start from the first entry in the cache table, set all its fields in the structure to zero (e.g., memset the iterator to zero).


Definition at line 120 of file include/openthread/thread_ftd.h

otDeviceProperties#

typedef struct otDeviceProperties otDeviceProperties

Represents the device properties which are used for calculating the local leader weight on a device.

The parameters are set based on device's capability, whether acting as border router, its power supply config, etc.

mIsUnstable indicates operational stability of device and is determined via a vendor specific mechanism. It can include the following cases:

  • Device internally detects that it loses external power supply more often than usual. What is usual is determined by the vendor.

  • Device internally detects that it reboots more often than usual. What is usual is determined by the vendor.


Definition at line 223 of file include/openthread/thread_ftd.h

otNeighborTableCallback#

typedef void(* otNeighborTableCallback) (otNeighborTableEvent aEvent, const otNeighborTableEntryInfo *aEntryInfo) )(otNeighborTableEvent aEvent, const otNeighborTableEntryInfo *aEntryInfo)

Pointer is called to notify that there is a change in the neighbor table.

Parameters
[in]aEvent

A event flag.

[in]aEntryInfo

A pointer to table entry info.


Definition at line 772 of file include/openthread/thread_ftd.h

Function Documentation#

otThreadGetMaxAllowedChildren#

uint16_t otThreadGetMaxAllowedChildren (otInstance * aInstance)

Gets the maximum number of children currently allowed.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The maximum number of children currently allowed.

See Also


Definition at line 131 of file include/openthread/thread_ftd.h

otThreadSetMaxAllowedChildren#

otError otThreadSetMaxAllowedChildren (otInstance * aInstance, uint16_t aMaxChildren)

Sets the maximum number of children currently allowed.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aMaxChildren

The maximum allowed children.

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

See Also


Definition at line 147 of file include/openthread/thread_ftd.h

otThreadIsRouterEligible#

bool otThreadIsRouterEligible (otInstance * aInstance)

Indicates whether or not the device is router-eligible.

Parameters
[in]aInstance

A pointer to an OpenThread instance.


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

otThreadSetRouterEligible#

otError otThreadSetRouterEligible (otInstance * aInstance, bool aEligible)

Sets whether or not the device is router-eligible.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEligible

TRUE to configure the device as router-eligible, FALSE otherwise.

If aEligible is false and the device is currently operating as a router, this call will cause the device to detach and attempt to reattach as a child.


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

otThreadSetPreferredRouterId#

otError otThreadSetPreferredRouterId (otInstance * aInstance, uint8_t aRouterId)

Set the preferred Router Id.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aRouterId

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.

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 189 of file include/openthread/thread_ftd.h

otThreadGetDeviceProperties#

const otDeviceProperties * otThreadGetDeviceProperties (otInstance * aInstance)

Get the current device properties.

Parameters
N/AaInstance

Requires OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE.

Returns

  • The device properties otDeviceProperties.


Definition at line 232 of file include/openthread/thread_ftd.h

otThreadSetDeviceProperties#

void otThreadSetDeviceProperties (otInstance * aInstance, const otDeviceProperties * aDeviceProperties)

Set the device properties which are then used to determine and set the Leader Weight.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDeviceProperties

The device properties.

Requires OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE.


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

otThreadGetLocalLeaderWeight#

uint8_t otThreadGetLocalLeaderWeight (otInstance * aInstance)

Gets the Thread Leader Weight used when operating in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Thread Leader Weight value.

See Also


Definition at line 254 of file include/openthread/thread_ftd.h

otThreadSetLocalLeaderWeight#

void otThreadSetLocalLeaderWeight (otInstance * aInstance, uint8_t aWeight)

Sets the Thread Leader Weight used when operating in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aWeight

The Thread Leader Weight value.

Directly sets the Leader Weight to the new value, replacing its previous value (which may have been determined from the current otDeviceProperties).

See Also


Definition at line 267 of file include/openthread/thread_ftd.h

otThreadGetPreferredLeaderPartitionId#

uint32_t otThreadGetPreferredLeaderPartitionId (otInstance * aInstance)

Get the preferred Thread Leader Partition Id used when operating in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Thread Leader Partition Id value.


Definition at line 276 of file include/openthread/thread_ftd.h

otThreadSetPreferredLeaderPartitionId#

void otThreadSetPreferredLeaderPartitionId (otInstance * aInstance, uint32_t aPartitionId)

Set the preferred Thread Leader Partition Id used when operating in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aPartitionId

The Thread Leader Partition Id value.


Definition at line 284 of file include/openthread/thread_ftd.h

otThreadGetJoinerUdpPort#

uint16_t otThreadGetJoinerUdpPort (otInstance * aInstance)

Gets the Joiner UDP Port.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Joiner UDP Port number.

See Also


Definition at line 295 of file include/openthread/thread_ftd.h

otThreadSetJoinerUdpPort#

otError otThreadSetJoinerUdpPort (otInstance * aInstance, uint16_t aJoinerUdpPort)

Sets the Joiner UDP Port.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aJoinerUdpPort

The Joiner UDP Port number.

See Also


Definition at line 307 of file include/openthread/thread_ftd.h

otThreadSetSteeringData#

void otThreadSetSteeringData (otInstance * aInstance, const otExtAddress * aExtAddress)

Set Steering data out of band.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aExtAddress

Address used to update the steering data. All zeros to clear the steering data (no steering data). All 0xFFs to set steering data/bloom filter to accept/allow all. A specific EUI64 which is then added to current steering data/bloom filter.

Configuration option OPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE should be set to enable setting of steering data out of band.


Definition at line 321 of file include/openthread/thread_ftd.h

otThreadGetContextIdReuseDelay#

uint32_t otThreadGetContextIdReuseDelay (otInstance * aInstance)

Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The CONTEXT_ID_REUSE_DELAY value.

See Also


Definition at line 332 of file include/openthread/thread_ftd.h

otThreadSetContextIdReuseDelay#

void otThreadSetContextIdReuseDelay (otInstance * aInstance, uint32_t aDelay)

Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDelay

The CONTEXT_ID_REUSE_DELAY value.

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.

See Also


Definition at line 345 of file include/openthread/thread_ftd.h

otThreadGetNetworkIdTimeout#

uint8_t otThreadGetNetworkIdTimeout (otInstance * aInstance)

Get the NETWORK_ID_TIMEOUT parameter.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

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.

Returns

  • The NETWORK_ID_TIMEOUT value.

See Also


Definition at line 359 of file include/openthread/thread_ftd.h

otThreadSetNetworkIdTimeout#

void otThreadSetNetworkIdTimeout (otInstance * aInstance, uint8_t aTimeout)

Set the NETWORK_ID_TIMEOUT parameter.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aTimeout

The NETWORK_ID_TIMEOUT value.

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.

See Also


Definition at line 372 of file include/openthread/thread_ftd.h

otThreadGetRouterUpgradeThreshold#

uint8_t otThreadGetRouterUpgradeThreshold (otInstance * aInstance)

Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The ROUTER_UPGRADE_THRESHOLD value.

See Also


Definition at line 383 of file include/openthread/thread_ftd.h

otThreadSetRouterUpgradeThreshold#

void otThreadSetRouterUpgradeThreshold (otInstance * aInstance, uint8_t aThreshold)

Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aThreshold

The ROUTER_UPGRADE_THRESHOLD value.

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.

See Also


Definition at line 396 of file include/openthread/thread_ftd.h

otThreadGetChildRouterLinks#

uint8_t otThreadGetChildRouterLinks (otInstance * aInstance)

Get the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

This parameter specifies the max number of neighboring routers with which the device (as an FED) will try to establish link.

Returns

  • The MLE_CHILD_ROUTER_LINKS value.

See Also


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

otThreadSetChildRouterLinks#

otError otThreadSetChildRouterLinks (otInstance * aInstance, uint8_t aChildRouterLinks)

Set the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aChildRouterLinks

The MLE_CHILD_ROUTER_LINKS value.

See Also


Definition at line 423 of file include/openthread/thread_ftd.h

otThreadReleaseRouterId#

otError otThreadReleaseRouterId (otInstance * aInstance, uint8_t aRouterId)

Release a Router ID that has been allocated by the device in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aRouterId

The Router ID to release. Valid range is [0, 62].

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 439 of file include/openthread/thread_ftd.h

otThreadBecomeRouter#

otError otThreadBecomeRouter (otInstance * aInstance)

Attempt to become a router.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

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 452 of file include/openthread/thread_ftd.h

otThreadBecomeLeader#

otError otThreadBecomeLeader (otInstance * aInstance)

Become a leader and start a new partition.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

If the device is not attached, this API will force the device to start as the leader of the network. This use case is only intended for testing and demo purposes, and using the API while the device is detached can make a production application non-compliant with the Thread Specification.

If the device is already attached, this API can be used to try to take over as the leader, creating a new partition. For this to work, the local leader weight (otThreadGetLocalLeaderWeight()) must be larger than the weight of the current leader (otThreadGetLeaderWeight()). If it is not, OT_ERROR_NOT_CAPABLE is returned to indicate to the caller that they need to adjust the weight.

Taking over the leader role in this way is only allowed when triggered by an explicit user action. Using this API without such user action can make a production application non-compliant with the Thread Specification.


Definition at line 476 of file include/openthread/thread_ftd.h

otThreadGetRouterDowngradeThreshold#

uint8_t otThreadGetRouterDowngradeThreshold (otInstance * aInstance)

Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The ROUTER_DOWNGRADE_THRESHOLD value.

See Also


Definition at line 487 of file include/openthread/thread_ftd.h

otThreadSetRouterDowngradeThreshold#

void otThreadSetRouterDowngradeThreshold (otInstance * aInstance, uint8_t aThreshold)

Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aThreshold

The ROUTER_DOWNGRADE_THRESHOLD value.

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.

See Also


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

otThreadGetRouterSelectionJitter#

uint8_t otThreadGetRouterSelectionJitter (otInstance * aInstance)

Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The ROUTER_SELECTION_JITTER value.

See Also


Definition at line 511 of file include/openthread/thread_ftd.h

otThreadSetRouterSelectionJitter#

void otThreadSetRouterSelectionJitter (otInstance * aInstance, uint8_t aRouterJitter)

Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aRouterJitter

The ROUTER_SELECTION_JITTER value.

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.

See Also


Definition at line 524 of file include/openthread/thread_ftd.h

otThreadGetChildInfoById#

otError otThreadGetChildInfoById (otInstance * aInstance, uint16_t aChildId, otChildInfo * aChildInfo)

Gets diagnostic information for an attached Child by its Child ID or RLOC16.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aChildId

The Child ID or RLOC16 for the attached child.

[out]aChildInfo

A pointer to where the child information is placed.


Definition at line 537 of file include/openthread/thread_ftd.h

otThreadGetChildInfoByIndex#

otError otThreadGetChildInfoByIndex (otInstance * aInstance, uint16_t aChildIndex, otChildInfo * aChildInfo)

The function retains diagnostic information for an attached Child by the internal table index.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aChildIndex

The table index.

[out]aChildInfo

A pointer to where the child information is placed.

See Also

  • otGetMaxAllowedChildren


Definition at line 553 of file include/openthread/thread_ftd.h

otThreadGetChildNextIp6Address#

otError otThreadGetChildNextIp6Address (otInstance * aInstance, uint16_t aChildIndex, otChildIp6AddressIterator * aIterator, otIp6Address * aAddress)

Gets the next IPv6 address (using an iterator) for a given child.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aChildIndex

The child index.

[inout]aIterator

A pointer to the iterator. On success the iterator will be updated to point to next entry in the list. To get the first IPv6 address the iterator should be set to OT_CHILD_IP6_ADDRESS_ITERATOR_INIT.

[out]aAddress

A pointer to an IPv6 address where the child's next address is placed (on success).

See Also


Definition at line 571 of file include/openthread/thread_ftd.h

otThreadGetRouterIdSequence#

uint8_t otThreadGetRouterIdSequence (otInstance * aInstance)

Get the current Router ID Sequence.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The Router ID Sequence.


Definition at line 583 of file include/openthread/thread_ftd.h

otThreadGetMaxRouterId#

uint8_t otThreadGetMaxRouterId (otInstance * aInstance)

The function returns the maximum allowed router ID.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The maximum allowed router ID.


Definition at line 592 of file include/openthread/thread_ftd.h

otThreadGetRouterInfo#

otError otThreadGetRouterInfo (otInstance * aInstance, uint16_t aRouterId, otRouterInfo * aRouterInfo)

The function retains diagnostic information for a given Thread Router.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aRouterId

The router ID or RLOC16 for a given router.

[out]aRouterInfo

A pointer to where the router information is placed.


Definition at line 605 of file include/openthread/thread_ftd.h

otThreadGetNextCacheEntry#

otError otThreadGetNextCacheEntry (otInstance * aInstance, otCacheEntryInfo * aEntryInfo, otCacheEntryIterator * aIterator)

Gets the next EID cache entry (using an iterator).

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aEntryInfo

A pointer to where the EID cache entry information is placed.

[inout]aIterator

A pointer to an iterator. It will be updated to point to next entry on success. To get the first entry, initialize the iterator by setting all its fields to zero (e.g., memset the iterator structure to zero).


Definition at line 619 of file include/openthread/thread_ftd.h

otThreadGetPskc#

void otThreadGetPskc (otInstance * aInstance, otPskc * aPskc)

Get the Thread PSKc.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aPskc

A pointer to an otPskc to return the retrieved Thread PSKc.

See Also


Definition at line 629 of file include/openthread/thread_ftd.h

otThreadGetPskcRef#

otPskcRef otThreadGetPskcRef (otInstance * aInstance)

Get Key Reference to Thread PSKc stored.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Requires the build-time feature OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE to be enabled.

Returns

  • Key Reference to PSKc

See Also


Definition at line 642 of file include/openthread/thread_ftd.h

otThreadSetPskc#

otError otThreadSetPskc (otInstance * aInstance, const otPskc * aPskc)

Set the Thread PSKc.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aPskc

A pointer to the new Thread PSKc.

Will only succeed when Thread protocols are disabled. A successful call to this function will also invalidate the Active and Pending Operational Datasets in non-volatile memory.

See Also


Definition at line 659 of file include/openthread/thread_ftd.h

otThreadSetPskcRef#

otError otThreadSetPskcRef (otInstance * aInstance, otPskcRef aKeyRef)

Set the Key Reference to the Thread PSKc.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aKeyRef

Key Reference to the new Thread PSKc.

Requires the build-time feature OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE to be enabled.

Will only succeed when Thread protocols are disabled. Upon success, this will also invalidate the Active and Pending Operational Datasets in non-volatile memory.

See Also


Definition at line 678 of file include/openthread/thread_ftd.h

otThreadGetParentPriority#

int8_t otThreadGetParentPriority (otInstance * aInstance)

Get the assigned parent priority.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The assigned parent priority value, -2 means not assigned.

See Also


Definition at line 689 of file include/openthread/thread_ftd.h

otThreadSetParentPriority#

otError otThreadSetParentPriority (otInstance * aInstance, int8_t aParentPriority)

Set the parent priority.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aParentPriority

The parent priority value.

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.

See Also


Definition at line 705 of file include/openthread/thread_ftd.h

otThreadGetMaxChildIpAddresses#

uint8_t otThreadGetMaxChildIpAddresses (otInstance * aInstance)

Gets the maximum number of IP addresses that each MTD child may register with this device as parent.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

Returns

  • The maximum number of IP addresses that each MTD child may register with this device as parent.

See Also


Definition at line 716 of file include/openthread/thread_ftd.h

otThreadSetMaxChildIpAddresses#

otError otThreadSetMaxChildIpAddresses (otInstance * aInstance, uint8_t aMaxIpAddresses)

Sets or restores the maximum number of IP addresses that each MTD child may register with this device as parent.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aMaxIpAddresses

The maximum number of IP addresses that each MTD child may register with this device as parent. 0 to clear the setting and restore the default.

Pass 0 to clear the setting and restore the default.

Available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE is enabled.

Note

  • Only used by Thread Test Harness to limit the address registrations of the reference parent in order to test the MTD DUT reaction.

See Also


Definition at line 738 of file include/openthread/thread_ftd.h

otThreadRegisterNeighborTableCallback#

void otThreadRegisterNeighborTableCallback (otInstance * aInstance, otNeighborTableCallback aCallback)

Registers a neighbor table callback function.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aCallback

A pointer to callback handler function.

The provided callback (if non-NULL) will be invoked when there is a change in the neighbor table (e.g., a child or a router neighbor entry is being added/removed or an existing child's mode is changed).

Subsequent calls to this method will overwrite the previous callback. Note that this callback in invoked while the neighbor/child table is being updated and always before the otStateChangedCallback.


Definition at line 786 of file include/openthread/thread_ftd.h

otThreadSetCcmEnabled#

void otThreadSetCcmEnabled (otInstance * aInstance, bool aEnabled)

Sets whether the device was commissioned using CCM.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEnabled

TRUE if the device was commissioned using CCM, FALSE otherwise.

Note

  • This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE, and is only used by Thread Test Harness to indicate whether this device was commissioned using CCM.


Definition at line 797 of file include/openthread/thread_ftd.h

otThreadSetThreadVersionCheckEnabled#

void otThreadSetThreadVersionCheckEnabled (otInstance * aInstance, bool aEnabled)

Sets whether the Security Policy TLV version-threshold for routing (VR field) is enabled.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEnabled

TRUE to enable Security Policy TLV version-threshold for routing, FALSE otherwise.

Note

  • This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE, and is only used by Thread Test Harness to indicate that thread protocol version check VR should be skipped.


Definition at line 808 of file include/openthread/thread_ftd.h

otThreadSetTmfOriginFilterEnabled#

void otThreadSetTmfOriginFilterEnabled (otInstance * aInstance, bool aEnabled)

Enables or disables the filter to drop TMF UDP messages from untrusted origin.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aEnabled

TRUE to enable filter, FALSE otherwise.

TMF messages are only trusted when they originate from a trusted source, such as the Thread interface. In special cases, such as when a device uses platform UDP socket to send TMF messages, they will be dropped due to untrusted origin. This filter is enabled by default.

When this filter is disabled, UDP messages sent to the TMF port that originate from untrusted origin (such as host, CLI or an external IPv6 node) will be allowed.

Note

  • This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE and is only used by Thread Test Harness to test network behavior by sending special TMF messages from the CLI on a POSIX host.


Definition at line 826 of file include/openthread/thread_ftd.h

otThreadIsTmfOriginFilterEnabled#

bool otThreadIsTmfOriginFilterEnabled (otInstance * aInstance)

Indicates whether the filter that drops TMF UDP messages from untrusted origin is enabled or not.

Parameters
N/AaInstance

This is intended for testing only and available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE config is enabled.


Definition at line 836 of file include/openthread/thread_ftd.h

otThreadGetRouterIdRange#

void otThreadGetRouterIdRange (otInstance * aInstance, uint8_t * aMinRouterId, uint8_t * aMaxRouterId)

Gets the range of router IDs that are allowed to assign to nodes within the thread network.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[out]aMinRouterId

The minimum router ID.

[out]aMaxRouterId

The maximum router ID.

Note

  • This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE, and is only used for test purpose. All the router IDs in the range [aMinRouterId, aMaxRouterId] are allowed.

See Also


Definition at line 850 of file include/openthread/thread_ftd.h

otThreadSetRouterIdRange#

otError otThreadSetRouterIdRange (otInstance * aInstance, uint8_t aMinRouterId, uint8_t aMaxRouterId)

Sets the range of router IDs that are allowed to assign to nodes within the thread network.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aMinRouterId

The minimum router ID.

[in]aMaxRouterId

The maximum router ID.

Note

  • This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE, and is only used for test purpose. All the router IDs in the range [aMinRouterId, aMaxRouterId] are allowed.

See Also


Definition at line 867 of file include/openthread/thread_ftd.h

otThreadGetAdvertisementTrickleIntervalMax#

uint32_t otThreadGetAdvertisementTrickleIntervalMax (otInstance * aInstance)

Gets the current Interval Max value used by Advertisement trickle timer.

Parameters
N/AaInstance

This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE, and is intended for testing only.

Returns

  • The Interval Max of Advertisement trickle timer in milliseconds.


Definition at line 876 of file include/openthread/thread_ftd.h

otThreadIsRouterIdAllocated#

bool otThreadIsRouterIdAllocated (otInstance * aInstance, uint8_t aRouterId)

Indicates whether or not a Router ID is currently allocated.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aRouterId

The router ID to check.


Definition at line 887 of file include/openthread/thread_ftd.h

otThreadGetNextHopAndPathCost#

void otThreadGetNextHopAndPathCost (otInstance * aInstance, uint16_t aDestRloc16, uint16_t * aNextHopRloc16, uint8_t * aPathCost)

Gets the next hop and path cost towards a given RLOC16 destination.

Parameters
[in]aInstance

A pointer to an OpenThread instance.

[in]aDestRloc16

The RLOC16 of destination.

[out]aNextHopRloc16

A pointer to return RLOC16 of next hop, 0xfffe if no next hop.

[out]aPathCost

A pointer to return path cost towards destination.

Can be used with either aNextHopRloc16 or aPathCost being NULL indicating caller does not want to get the value.


Definition at line 900 of file include/openthread/thread_ftd.h

Macro Definition Documentation#

OT_CHILD_IP6_ADDRESS_ITERATOR_INIT#

#define OT_CHILD_IP6_ADDRESS_ITERATOR_INIT
Value:
0

Initializer for otChildIP6AddressIterator.


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