Router/Leader
This module includes functions for Thread Routers and Leaders.
Summary
Enumerations |
|
---|---|
otCacheEntryState
|
enum Defines the EID cache entry state. |
otNeighborTableEvent{
|
enum Defines the constants used in otNeighborTableCallback to indicate changes in neighbor table. |
otPowerSupply{
|
enum Represents the power supply property on a device. |
Typedefs |
|
---|---|
otCacheEntryInfo
|
typedefstruct otCacheEntryInfo
Represents an EID cache entry. |
otCacheEntryIterator
|
typedefstruct otCacheEntryIterator
Represents an iterator used for iterating through the EID cache table entries. |
otCacheEntryState
|
typedefenum otCacheEntryState
Defines the EID cache entry state. |
otChildIp6AddressIterator
|
typedefuint16_t
Used to iterate through IPv6 addresses of a Thread Child entry. |
otDeviceProperties
|
typedefstruct otDeviceProperties
Represents the device properties which are used for calculating the local leader weight on a device. |
otNeighborTableCallback)(otNeighborTableEvent aEvent, const otNeighborTableEntryInfo *aEntryInfo)
|
typedefvoid(*
Pointer is called to notify that there is a change in the neighbor table. |
Functions |
|
---|---|
otThreadBecomeLeader(otInstance *aInstance)
|
Become a leader and start a new partition.
|
otThreadBecomeRouter(otInstance *aInstance)
|
Attempt to become a router.
|
otThreadGetAdvertisementTrickleIntervalMax(otInstance *aInstance)
|
uint32_t
Gets the current Interval Max value used by Advertisement trickle timer.
|
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.
|
otThreadGetChildRouterLinks(otInstance *aInstance)
|
uint8_t
Get the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
|
otThreadGetContextIdReuseDelay(otInstance *aInstance)
|
uint32_t
Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
|
otThreadGetDeviceProperties(otInstance *aInstance)
|
const otDeviceProperties *
Get the current device properties.
|
otThreadGetJoinerUdpPort(otInstance *aInstance)
|
uint16_t
Gets the Joiner UDP Port.
|
otThreadGetLocalLeaderWeight(otInstance *aInstance)
|
uint8_t
Gets the Thread Leader Weight used when operating in the Leader role.
|
otThreadGetMaxAllowedChildren(otInstance *aInstance)
|
uint16_t
Gets the maximum number of children currently allowed.
|
otThreadGetMaxChildIpAddresses(otInstance *aInstance)
|
uint8_t
Gets the maximum number of IP addresses that each MTD child may register with this device as parent.
|
otThreadGetMaxRouterId(otInstance *aInstance)
|
uint8_t
The function returns the maximum allowed router ID.
|
otThreadGetNetworkIdTimeout(otInstance *aInstance)
|
uint8_t
Get the
NETWORK_ID_TIMEOUT parameter. |
otThreadGetNextCacheEntry(otInstance *aInstance, otCacheEntryInfo *aEntryInfo, otCacheEntryIterator *aIterator)
|
Gets the next EID cache entry (using an iterator).
|
otThreadGetNextHopAndPathCost(otInstance *aInstance, uint16_t aDestRloc16, uint16_t *aNextHopRloc16, uint8_t *aPathCost)
|
void
Gets the next hop and path cost towards a given RLOC16 destination.
|
otThreadGetParentPriority(otInstance *aInstance)
|
int8_t
Get the assigned parent priority.
|
otThreadGetPreferredLeaderPartitionId(otInstance *aInstance)
|
uint32_t
Get the preferred Thread Leader Partition Id used when operating in the Leader role.
|
otThreadGetPskc(otInstance *aInstance, otPskc *aPskc)
|
void
Get the Thread PSKc.
|
otThreadGetPskcRef(otInstance *aInstance)
|
Get Key Reference to Thread PSKc stored.
|
otThreadGetRouterDowngradeThreshold(otInstance *aInstance)
|
uint8_t
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
|
otThreadGetRouterIdRange(otInstance *aInstance, uint8_t *aMinRouterId, uint8_t *aMaxRouterId)
|
void
Gets the range of router IDs that are allowed to assign to nodes within the thread network.
|
otThreadGetRouterIdSequence(otInstance *aInstance)
|
uint8_t
Get the current Router ID Sequence.
|
otThreadGetRouterInfo(otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo)
|
The function retains diagnostic information for a given Thread Router.
|
otThreadGetRouterSelectionJitter(otInstance *aInstance)
|
uint8_t
Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
|
otThreadGetRouterUpgradeThreshold(otInstance *aInstance)
|
uint8_t
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.
|
otThreadIsRouterEligible(otInstance *aInstance)
|
bool
Indicates whether or not the device is router-eligible.
|
otThreadIsRouterIdAllocated(otInstance *aInstance, uint8_t aRouterId)
|
bool
Indicates whether or not a Router ID is currently allocated.
|
otThreadIsTmfOriginFilterEnabled(otInstance *aInstance)
|
bool
Indicates whether the filter that drops TMF UDP messages from untrusted origin is enabled or not.
|
otThreadRegisterNeighborTableCallback(otInstance *aInstance, otNeighborTableCallback aCallback)
|
void
Registers a neighbor table callback function.
|
otThreadReleaseRouterId(otInstance *aInstance, uint8_t aRouterId)
|
Release a Router ID that has been allocated by the device in the Leader role.
|
otThreadSetCcmEnabled(otInstance *aInstance, bool aEnabled)
|
void
Sets whether the device was commissioned using CCM.
|
otThreadSetChildRouterLinks(otInstance *aInstance, uint8_t aChildRouterLinks)
|
Set the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
|
otThreadSetContextIdReuseDelay(otInstance *aInstance, uint32_t aDelay)
|
void
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
|
otThreadSetDeviceProperties(otInstance *aInstance, const otDeviceProperties *aDeviceProperties)
|
void
Set the device properties which are then used to determine and set the Leader Weight.
|
otThreadSetJoinerUdpPort(otInstance *aInstance, uint16_t aJoinerUdpPort)
|
Sets the Joiner UDP Port.
|
otThreadSetLocalLeaderWeight(otInstance *aInstance, uint8_t aWeight)
|
void
Sets the Thread Leader Weight used when operating in the Leader role.
|
otThreadSetMaxAllowedChildren(otInstance *aInstance, uint16_t aMaxChildren)
|
Sets the maximum number of children currently allowed.
|
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.
|
otThreadSetNetworkIdTimeout(otInstance *aInstance, uint8_t aTimeout)
|
void
Set the
NETWORK_ID_TIMEOUT parameter. |
otThreadSetParentPriority(otInstance *aInstance, int8_t aParentPriority)
|
Set the parent priority.
|
otThreadSetPreferredLeaderPartitionId(otInstance *aInstance, uint32_t aPartitionId)
|
void
Set the preferred Thread Leader Partition Id used when operating in the Leader role.
|
otThreadSetPreferredRouterId(otInstance *aInstance, uint8_t aRouterId)
|
Set the preferred Router Id.
|
otThreadSetPskc(otInstance *aInstance, const otPskc *aPskc)
|
Set the Thread PSKc.
|
otThreadSetPskcRef(otInstance *aInstance, otPskcRef aKeyRef)
|
Set the Key Reference to the Thread PSKc.
|
otThreadSetRouterDowngradeThreshold(otInstance *aInstance, uint8_t aThreshold)
|
void
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.
|
otThreadSetRouterEligible(otInstance *aInstance, bool aEligible)
|
Sets whether or not the device is router-eligible.
|
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.
|
otThreadSetRouterSelectionJitter(otInstance *aInstance, uint8_t aRouterJitter)
|
void
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
|
otThreadSetRouterUpgradeThreshold(otInstance *aInstance, uint8_t aThreshold)
|
void
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.
|
otThreadSetSteeringData(otInstance *aInstance, const otExtAddress *aExtAddress)
|
void
Set Steering data out of band.
|
otThreadSetThreadVersionCheckEnabled(otInstance *aInstance, bool aEnabled)
|
void
Sets whether the Security Policy TLV version-threshold for routing (VR field) is enabled.
|
otThreadSetTmfOriginFilterEnabled(otInstance *aInstance, bool aEnabled)
|
void
Enables or disables the filter to drop TMF UDP messages from untrusted origin.
|
Macros |
|
---|---|
OT_CHILD_IP6_ADDRESS_ITERATOR_INIT 0
|
Initializer for otChildIP6AddressIterator.
|
Structs |
|
---|---|
otCacheEntryInfo |
Represents an EID cache entry. |
otCacheEntryIterator |
Represents an iterator used for iterating through the EID cache table entries. |
otChildInfo |
Holds diagnostic information for a Thread Child. |
otDeviceProperties |
Represents the device properties which are used for calculating the local leader weight on a device. |
otNeighborTableEntryInfo |
Represent a neighbor table entry info (child or router) and is used as a parameter in the neighbor table callback |
Enumerations
otCacheEntryState
otCacheEntryState
Defines the EID cache entry state.
otNeighborTableEvent
otNeighborTableEvent
Defines the constants used in otNeighborTableCallback
to indicate changes in neighbor table.
otPowerSupply
otPowerSupply
Represents the power supply property on a device.
This is used as a property in otDeviceProperties
to calculate the leader weight.
Typedefs
otCacheEntryIterator
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).
otChildIp6AddressIterator
uint16_t otChildIp6AddressIterator
Used to iterate through IPv6 addresses of a Thread Child entry.
otDeviceProperties
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.
otNeighborTableCallback
void(* otNeighborTableCallback)(otNeighborTableEvent aEvent, const otNeighborTableEntryInfo *aEntryInfo)
Pointer is called to notify that there is a change in the neighbor table.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Functions
otThreadBecomeLeader
otError otThreadBecomeLeader( otInstance *aInstance )
Become a leader and start a new partition.
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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadBecomeRouter
otError otThreadBecomeRouter( otInstance *aInstance )
Attempt to become a router.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetAdvertisementTrickleIntervalMax
uint32_t otThreadGetAdvertisementTrickleIntervalMax( otInstance *aInstance )
Gets the current Interval Max value used by Advertisement trickle timer.
This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
, and is intended for testing only.
Details | |
---|---|
Returns |
The Interval Max of Advertisement trickle timer in milliseconds.
|
otThreadGetChildInfoById
otError otThreadGetChildInfoById( otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo )
Gets diagnostic information for an attached Child by its Child ID or RLOC16.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetChildInfoByIndex
otError otThreadGetChildInfoByIndex( otInstance *aInstance, uint16_t aChildIndex, otChildInfo *aChildInfo )
The function retains diagnostic information for an attached Child by the internal table index.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otGetMaxAllowedChildren
otThreadGetChildNextIp6Address
otError otThreadGetChildNextIp6Address( otInstance *aInstance, uint16_t aChildIndex, otChildIp6AddressIterator *aIterator, otIp6Address *aAddress )
Gets the next IPv6 address (using an iterator) for a given child.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otThreadGetChildInfoByIndex
otThreadGetChildRouterLinks
uint8_t otThreadGetChildRouterLinks( otInstance *aInstance )
Get the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
This parameter specifies the max number of neighboring routers with which the device (as an FED) will try to establish link.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The MLE_CHILD_ROUTER_LINKS value.
|
otThreadSetChildRouterLinks
otThreadGetContextIdReuseDelay
uint32_t otThreadGetContextIdReuseDelay( otInstance *aInstance )
Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The CONTEXT_ID_REUSE_DELAY value.
|
otThreadSetContextIdReuseDelay
otThreadGetDeviceProperties
const otDeviceProperties * otThreadGetDeviceProperties( otInstance *aInstance )
Get the current device properties.
Requires OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE
.
Details | |
---|---|
Returns |
The device properties
otDeviceProperties . |
otThreadGetJoinerUdpPort
uint16_t otThreadGetJoinerUdpPort( otInstance *aInstance )
Gets the Joiner UDP Port.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Joiner UDP Port number.
|
otThreadSetJoinerUdpPort
otThreadGetLocalLeaderWeight
uint8_t otThreadGetLocalLeaderWeight( otInstance *aInstance )
Gets the Thread Leader Weight used when operating in the Leader role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Thread Leader Weight value.
|
otThreadSetLeaderWeight
otThreadSetDeviceProperties
otThreadGetMaxAllowedChildren
uint16_t otThreadGetMaxAllowedChildren( otInstance *aInstance )
Gets the maximum number of children currently allowed.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The maximum number of children currently allowed.
|
otThreadSetMaxAllowedChildren
otThreadGetMaxChildIpAddresses
uint8_t otThreadGetMaxChildIpAddresses( otInstance *aInstance )
Gets the maximum number of IP addresses that each MTD child may register with this device as parent.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The maximum number of IP addresses that each MTD child may register with this device as parent.
|
otThreadSetMaxChildIpAddresses
otThreadGetMaxRouterId
uint8_t otThreadGetMaxRouterId( otInstance *aInstance )
The function returns the maximum allowed router ID.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The maximum allowed router ID.
|
otThreadGetNetworkIdTimeout
uint8_t otThreadGetNetworkIdTimeout( otInstance *aInstance )
Get the NETWORK_ID_TIMEOUT
parameter.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The
NETWORK_ID_TIMEOUT value. |
otThreadSetNetworkIdTimeout
otThreadGetNextCacheEntry
otError otThreadGetNextCacheEntry( otInstance *aInstance, otCacheEntryInfo *aEntryInfo, otCacheEntryIterator *aIterator )
Gets the next EID cache entry (using an iterator).
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
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.
Can be used with either aNextHopRloc16
or aPathCost
being NULL indicating caller does not want to get the value.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
otThreadGetParentPriority
int8_t otThreadGetParentPriority( otInstance *aInstance )
Get the assigned parent priority.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The assigned parent priority value, -2 means not assigned.
|
otThreadSetParentPriority
otThreadGetPreferredLeaderPartitionId
uint32_t otThreadGetPreferredLeaderPartitionId( otInstance *aInstance )
Get the preferred Thread Leader Partition Id used when operating in the Leader role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Thread Leader Partition Id value.
|
otThreadGetPskc
void otThreadGetPskc( otInstance *aInstance, otPskc *aPskc )
Get the Thread PSKc.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetPskc
otThreadGetPskcRef
otPskcRef otThreadGetPskcRef( otInstance *aInstance )
Get Key Reference to Thread PSKc stored.
Requires the build-time feature OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
to be enabled.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Key Reference to PSKc
|
otThreadSetPskcRef
otThreadGetRouterDowngradeThreshold
uint8_t otThreadGetRouterDowngradeThreshold( otInstance *aInstance )
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The ROUTER_DOWNGRADE_THRESHOLD value.
|
otThreadSetRouterDowngradeThreshold
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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otThreadSetRouterIdRange
otThreadGetRouterIdSequence
uint8_t otThreadGetRouterIdSequence( otInstance *aInstance )
Get the current Router ID Sequence.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Router ID Sequence.
|
otThreadGetRouterInfo
otError otThreadGetRouterInfo( otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo )
The function retains diagnostic information for a given Thread Router.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetRouterSelectionJitter
uint8_t otThreadGetRouterSelectionJitter( otInstance *aInstance )
Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The ROUTER_SELECTION_JITTER value.
|
otThreadSetRouterSelectionJitter
otThreadGetRouterUpgradeThreshold
uint8_t otThreadGetRouterUpgradeThreshold( otInstance *aInstance )
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The ROUTER_UPGRADE_THRESHOLD value.
|
otThreadSetRouterUpgradeThreshold
otThreadIsRouterEligible
bool otThreadIsRouterEligible( otInstance *aInstance )
Indicates whether or not the device is router-eligible.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadIsRouterIdAllocated
bool otThreadIsRouterIdAllocated( otInstance *aInstance, uint8_t aRouterId )
Indicates whether or not a Router ID is currently allocated.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadIsTmfOriginFilterEnabled
bool otThreadIsTmfOriginFilterEnabled( otInstance *aInstance )
Indicates whether the filter that drops TMF UDP messages from untrusted origin is enabled or not.
This is intended for testing only and available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
config is enabled.
Details | |||||
---|---|---|---|---|---|
Return Values |
|
otThreadRegisterNeighborTableCallback
void otThreadRegisterNeighborTableCallback( otInstance *aInstance, otNeighborTableCallback aCallback )
Registers a neighbor table callback 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
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadReleaseRouterId
otError otThreadReleaseRouterId( otInstance *aInstance, uint8_t aRouterId )
Release a Router ID that has been allocated by the device in the Leader role.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otThreadSetCcmEnabled
void otThreadSetCcmEnabled( otInstance *aInstance, bool aEnabled )
Sets whether the device was commissioned using CCM.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetChildRouterLinks
otError otThreadSetChildRouterLinks( otInstance *aInstance, uint8_t aChildRouterLinks )
Set the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetChildRouterLinks
otThreadSetContextIdReuseDelay
void otThreadSetContextIdReuseDelay( otInstance *aInstance, uint32_t aDelay )
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetContextIdReuseDelay
otThreadSetDeviceProperties
void otThreadSetDeviceProperties( otInstance *aInstance, const otDeviceProperties *aDeviceProperties )
Set the device properties which are then used to determine and set the Leader Weight.
Requires OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetJoinerUdpPort
otError otThreadSetJoinerUdpPort( otInstance *aInstance, uint16_t aJoinerUdpPort )
Sets the Joiner UDP Port.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetJoinerUdpPort
otThreadSetLocalLeaderWeight
void otThreadSetLocalLeaderWeight( otInstance *aInstance, uint8_t aWeight )
Sets the Thread Leader Weight used when operating in the Leader role.
Directly sets the Leader Weight to the new value, replacing its previous value (which may have been determined from the current otDeviceProperties
).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetLeaderWeight
otThreadSetMaxAllowedChildren
otError otThreadSetMaxAllowedChildren( otInstance *aInstance, uint16_t aMaxChildren )
Sets the maximum number of children currently allowed.
This parameter can only be set when Thread protocol operation has been stopped.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetMaxAllowedChildren
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.
Pass 0
to clear the setting and restore the default.
Available when OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetMaxChildIpAddresses
otThreadSetNetworkIdTimeout
void otThreadSetNetworkIdTimeout( otInstance *aInstance, uint8_t aTimeout )
Set the NETWORK_ID_TIMEOUT
parameter.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetNetworkIdTimeout
otThreadSetParentPriority
otError otThreadSetParentPriority( otInstance *aInstance, int8_t aParentPriority )
Set the parent priority.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetParentPriority
otThreadSetPreferredLeaderPartitionId
void otThreadSetPreferredLeaderPartitionId( otInstance *aInstance, uint32_t aPartitionId )
Set the preferred Thread Leader Partition Id used when operating in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetPreferredRouterId
otError 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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadSetPskc
otError otThreadSetPskc( otInstance *aInstance, const otPskc *aPskc )
Set the 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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetPskc
otThreadSetPskcRef
otError otThreadSetPskcRef( otInstance *aInstance, otPskcRef aKeyRef )
Set the Key Reference to the 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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetPskcRef
otThreadSetRouterDowngradeThreshold
void otThreadSetRouterDowngradeThreshold( otInstance *aInstance, uint8_t aThreshold )
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetRouterDowngradeThreshold
otThreadSetRouterEligible
otError otThreadSetRouterEligible( otInstance *aInstance, bool aEligible )
Sets whether or not the device is router-eligible.
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetRouterIdRange
otThreadSetRouterSelectionJitter
void otThreadSetRouterSelectionJitter( otInstance *aInstance, uint8_t aRouterJitter )
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetRouterSelectionJitter
otThreadSetRouterUpgradeThreshold
void otThreadSetRouterUpgradeThreshold( otInstance *aInstance, uint8_t aThreshold )
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetRouterUpgradeThreshold
otThreadSetSteeringData
void otThreadSetSteeringData( otInstance *aInstance, const otExtAddress *aExtAddress )
Set Steering data out of band.
Configuration option OPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE
should be set to enable setting of steering data out of band.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetThreadVersionCheckEnabled
void otThreadSetThreadVersionCheckEnabled( otInstance *aInstance, bool aEnabled )
Sets whether the Security Policy TLV version-threshold for routing (VR field) is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetTmfOriginFilterEnabled
void otThreadSetTmfOriginFilterEnabled( otInstance *aInstance, bool aEnabled )
Enables or disables the filter to drop TMF UDP messages from untrusted origin.
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
Macros
OT_CHILD_IP6_ADDRESS_ITERATOR_INIT
OT_CHILD_IP6_ADDRESS_ITERATOR_INIT 0
Initializer for otChildIP6AddressIterator.
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.