Router/Leader
This module includes functions for Thread Routers and Leaders.
Summary
Enumerations |
|
---|---|
otThreadChildTableEvent{
|
enum This enumeration defines the constants used in otThreadChildTableCallback to indicate whether a child is added or removed. |
Typedefs |
|
---|---|
otChildIp6AddressIterator
|
typedefuint16_t
Used to iterate through IPv6 addresses of a Thread Child entry. |
otEidCacheEntry
|
typedefstruct otEidCacheEntry
This structure represents an EID cache entry. |
otThreadChildTableCallback)(otThreadChildTableEvent aEvent, const otChildInfo *aChildInfo)
|
typedefvoid(*
This function pointer is called to notify that a child is being added to or removed from child table. |
otThreadChildTableEvent
|
typedef This enumeration defines the constants used in otThreadChildTableCallback to indicate whether a child is added or removed. |
Functions |
|
---|---|
otThreadBecomeLeader(otInstance *aInstance)
|
Become a leader and start a new partition.
|
otThreadBecomeRouter(otInstance *aInstance)
|
Attempt to become a router.
|
otThreadGetChildInfoById(otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo)
|
The function retains diagnostic information for an attached Child by its Child ID or RLOC16.
|
otThreadGetChildInfoByIndex(otInstance *aInstance, uint8_t aChildIndex, otChildInfo *aChildInfo)
|
The function retains diagnostic information for an attached Child by the internal table index.
|
otThreadGetChildNextIp6Address(otInstance *aInstance, uint8_t aChildIndex, otChildIp6AddressIterator *aIterator, otIp6Address *aAddress)
|
This function gets the next IPv6 address (using an iterator) for a given child.
|
otThreadGetChildTableCallback(otInstance *aInstance)
|
This function gets the child table callback function.
|
otThreadGetContextIdReuseDelay(otInstance *aInstance)
|
Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
|
otThreadGetEidCacheEntry(otInstance *aInstance, uint8_t aIndex, otEidCacheEntry *aEntry)
|
This function gets an EID cache entry.
|
otThreadGetJoinerUdpPort(otInstance *aInstance)
|
Get the Joiner UDP Port.
|
otThreadGetLocalLeaderPartitionId(otInstance *aInstance)
|
Get the Thread Leader Partition Id used when operating in the Leader role.
|
otThreadGetLocalLeaderWeight(otInstance *aInstance)
|
Get the Thread Leader Weight used when operating in the Leader role.
|
otThreadGetMaxAllowedChildren(otInstance *aInstance)
|
Get the maximum number of children currently allowed.
|
otThreadGetMaxRouterId(otInstance *aInstance)
|
The function returns the maximum allowed router ID.
|
otThreadGetNetworkIdTimeout(otInstance *aInstance)
|
Get the NETWORK_ID_TIMEOUT parameter used in the Router role.
|
otThreadGetPSKc(otInstance *aInstance)
|
Get the thrPSKc.
|
otThreadGetParentPriority(otInstance *aInstance)
|
Get the assigned parent priority.
|
otThreadGetRouterDowngradeThreshold(otInstance *aInstance)
|
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
|
otThreadGetRouterIdSequence(otInstance *aInstance)
|
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)
|
Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
|
otThreadGetRouterUpgradeThreshold(otInstance *aInstance)
|
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.
|
otThreadIsRouterRoleEnabled(otInstance *aInstance)
|
This function indicates whether or not the Router Role is enabled.
|
otThreadReleaseRouterId(otInstance *aInstance, uint8_t aRouterId)
|
Release a Router ID that has been allocated by the device in the Leader role.
|
otThreadSetChildTableCallback(otInstance *aInstance, otThreadChildTableCallback aCallback)
|
void
This function sets the child table callback function.
|
otThreadSetContextIdReuseDelay(otInstance *aInstance, uint32_t aDelay)
|
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
|
otThreadSetJoinerUdpPort(otInstance *aInstance, uint16_t aJoinerUdpPort)
|
Set the Joiner UDP Port.
|
otThreadSetLocalLeaderPartitionId(otInstance *aInstance, uint32_t aPartitionId)
|
Set the Thread Leader Partition Id used when operating in the Leader role.
|
otThreadSetLocalLeaderWeight(otInstance *aInstance, uint8_t aWeight)
|
Set the Thread Leader Weight used when operating in the Leader role.
|
otThreadSetMaxAllowedChildren(otInstance *aInstance, uint8_t aMaxChildren)
|
Set the maximum number of children currently allowed.
|
otThreadSetNetworkIdTimeout(otInstance *aInstance, uint8_t aTimeout)
|
Set the NETWORK_ID_TIMEOUT parameter used in the Leader role.
|
otThreadSetPSKc(otInstance *aInstance, const uint8_t *aPSKc)
|
Set the thrPSKc.
|
otThreadSetParentPriority(otInstance *aInstance, int8_t aParentPriority)
|
Set the parent priority.
|
otThreadSetPreferredRouterId(otInstance *aInstance, uint8_t aRouterId)
|
Set the preferred Router Id.
|
otThreadSetRouterDowngradeThreshold(otInstance *aInstance, uint8_t aThreshold)
|
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.
|
otThreadSetRouterRoleEnabled(otInstance *aInstance, bool aEnabled)
|
This function sets whether or not the Router Role is enabled.
|
otThreadSetRouterSelectionJitter(otInstance *aInstance, uint8_t aRouterJitter)
|
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
|
otThreadSetRouterUpgradeThreshold(otInstance *aInstance, uint8_t aThreshold)
|
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.
|
otThreadSetSteeringData(otInstance *aInstance, const otExtAddress *aExtAddress)
|
Set Steering data out of band.
|
Structs |
|
---|---|
otChildInfo |
This structure holds diagnostic information for a Thread Child. |
otEidCacheEntry |
This structure represents an EID cache entry. |
Enumerations
otThreadChildTableEvent
otThreadChildTableEvent
Typedefs
otChildIp6AddressIterator
uint16_t otChildIp6AddressIterator
Used to iterate through IPv6 addresses of a Thread Child entry.
otEidCacheEntry
struct otEidCacheEntry otEidCacheEntry
This structure represents an EID cache entry.
otThreadChildTableCallback
void(* otThreadChildTableCallback)(otThreadChildTableEvent aEvent, const otChildInfo *aChildInfo)
This function pointer is called to notify that a child is being added to or removed from child table.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadChildTableEvent
enum otThreadChildTableEvent otThreadChildTableEvent
This enumeration defines the constants used in otThreadChildTableCallback
to indicate whether a child is added or removed.
Functions
otThreadBecomeLeader
OTAPI otError OTCALL otThreadBecomeLeader( otInstance *aInstance )
Become a leader and start a new partition.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadBecomeRouter
OTAPI otError OTCALL otThreadBecomeRouter( otInstance *aInstance )
Attempt to become a router.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetChildInfoById
OTAPI otError OTCALL otThreadGetChildInfoById( otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo )
The function retains diagnostic information for an attached Child by its Child ID or RLOC16.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetChildInfoByIndex
OTAPI otError OTCALL otThreadGetChildInfoByIndex( otInstance *aInstance, uint8_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, uint8_t aChildIndex, otChildIp6AddressIterator *aIterator, otIp6Address *aAddress )
This function gets the next IPv6 address (using an iterator) for a given child.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otThreadGetChildInfoByIndex
otThreadGetChildTableCallback
otThreadChildTableCallback otThreadGetChildTableCallback( otInstance *aInstance )
This function gets the child table callback function.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The callback function pointer.
|
otThreadGetContextIdReuseDelay
OTAPI uint32_t OTCALL 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
otThreadGetEidCacheEntry
OTAPI otError OTCALL otThreadGetEidCacheEntry( otInstance *aInstance, uint8_t aIndex, otEidCacheEntry *aEntry )
This function gets an EID cache entry.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetJoinerUdpPort
OTAPI uint16_t OTCALL otThreadGetJoinerUdpPort( otInstance *aInstance )
Get the Joiner UDP Port.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Joiner UDP Port number.
|
otThreadSetJoinerUdpPort
otThreadGetLocalLeaderPartitionId
OTAPI uint32_t OTCALL otThreadGetLocalLeaderPartitionId( otInstance *aInstance )
Get the Thread Leader Partition Id used when operating in the Leader role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Thread Leader Partition Id value.
|
otThreadGetLocalLeaderWeight
OTAPI uint8_t OTCALL otThreadGetLocalLeaderWeight( otInstance *aInstance )
Get the Thread Leader Weight used when operating in the Leader role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Thread Leader Weight value.
|
otThreadSetLeaderWeight
otThreadGetMaxAllowedChildren
OTAPI uint8_t OTCALL otThreadGetMaxAllowedChildren( otInstance *aInstance )
Get the maximum number of children currently allowed.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The maximum number of children currently allowed.
|
otThreadSetMaxAllowedChildren
otThreadGetMaxRouterId
OTAPI uint8_t OTCALL otThreadGetMaxRouterId( otInstance *aInstance )
The function returns the maximum allowed router ID.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The maximum allowed router ID.
|
otThreadGetNetworkIdTimeout
OTAPI uint8_t OTCALL otThreadGetNetworkIdTimeout( otInstance *aInstance )
Get the NETWORK_ID_TIMEOUT parameter used in the Router role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The NETWORK_ID_TIMEOUT value.
|
otThreadSetNetworkIdTimeout
otThreadGetPSKc
OTAPI const uint8_t *OTCALL otThreadGetPSKc( otInstance *aInstance )
Get the thrPSKc.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to a buffer containing the thrPSKc.
|
otThreadSetPSKc
otThreadGetParentPriority
OTAPI int8_t OTCALL otThreadGetParentPriority( otInstance *aInstance )
Get the assigned parent priority.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The assigned parent priority value, -2 means not assigned.
|
otThreadSetParentPriority
otThreadGetRouterDowngradeThreshold
OTAPI uint8_t OTCALL otThreadGetRouterDowngradeThreshold( otInstance *aInstance )
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The ROUTER_DOWNGRADE_THRESHOLD value.
|
otThreadSetRouterDowngradeThreshold
otThreadGetRouterIdSequence
OTAPI uint8_t OTCALL otThreadGetRouterIdSequence( otInstance *aInstance )
Get the current Router ID Sequence.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The Router ID Sequence.
|
otThreadGetRouterInfo
OTAPI otError OTCALL otThreadGetRouterInfo( otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo )
The function retains diagnostic information for a given Thread Router.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetRouterSelectionJitter
OTAPI uint8_t OTCALL 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
OTAPI uint8_t OTCALL otThreadGetRouterUpgradeThreshold( otInstance *aInstance )
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The ROUTER_UPGRADE_THRESHOLD value.
|
otThreadSetRouterUpgradeThreshold
otThreadIsRouterRoleEnabled
OTAPI bool OTCALL otThreadIsRouterRoleEnabled( otInstance *aInstance )
This function indicates whether or not the Router Role is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadReleaseRouterId
OTAPI otError OTCALL 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 |
|
otThreadSetChildTableCallback
void otThreadSetChildTableCallback( otInstance *aInstance, otThreadChildTableCallback aCallback )
This function sets the child table callback function.
The provided callback (if non-NULL) will be invoked when a child entry is being added/removed to/from the child table. Subsequent calls to this method will overwrite the previous callback. Note that this callback in invoked while the child table is being updated and always before the otStateChangedCallback
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetContextIdReuseDelay
OTAPI void OTCALL otThreadSetContextIdReuseDelay( otInstance *aInstance, uint32_t aDelay )
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetContextIdReuseDelay
otThreadSetJoinerUdpPort
OTAPI otError OTCALL otThreadSetJoinerUdpPort( otInstance *aInstance, uint16_t aJoinerUdpPort )
Set the Joiner UDP Port.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetJoinerUdpPort
otThreadSetLocalLeaderPartitionId
OTAPI void OTCALL otThreadSetLocalLeaderPartitionId( otInstance *aInstance, uint32_t aPartitionId )
Set the Thread Leader Partition Id used when operating in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetLocalLeaderWeight
OTAPI void OTCALL otThreadSetLocalLeaderWeight( otInstance *aInstance, uint8_t aWeight )
Set the Thread Leader Weight used when operating in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetLeaderWeight
otThreadSetMaxAllowedChildren
OTAPI otError 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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otThreadGetMaxAllowedChildren, otThreadStop
otThreadSetNetworkIdTimeout
OTAPI void OTCALL otThreadSetNetworkIdTimeout( otInstance *aInstance, uint8_t aTimeout )
Set the NETWORK_ID_TIMEOUT parameter used in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetNetworkIdTimeout
otThreadSetPSKc
OTAPI otError OTCALL otThreadSetPSKc( otInstance *aInstance, const uint8_t *aPSKc )
Set the thrPSKc.
This function 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
otThreadSetParentPriority
OTAPI otError OTCALL otThreadSetParentPriority( otInstance *aInstance, int8_t aParentPriority )
Set the parent priority.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otThreadGetParentPriority
otThreadSetPreferredRouterId
OTAPI otError OTCALL 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 |
|
otThreadSetRouterDowngradeThreshold
OTAPI void OTCALL otThreadSetRouterDowngradeThreshold( otInstance *aInstance, uint8_t aThreshold )
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetRouterDowngradeThreshold
otThreadSetRouterRoleEnabled
OTAPI void OTCALL otThreadSetRouterRoleEnabled( otInstance *aInstance, bool aEnabled )
This function sets whether or not the Router Role is enabled.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadSetRouterSelectionJitter
OTAPI void OTCALL otThreadSetRouterSelectionJitter( otInstance *aInstance, uint8_t aRouterJitter )
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetRouterSelectionJitter
otThreadSetRouterUpgradeThreshold
OTAPI void OTCALL otThreadSetRouterUpgradeThreshold( otInstance *aInstance, uint8_t aThreshold )
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otThreadGetRouterUpgradeThreshold
otThreadSetSteeringData
otError otThreadSetSteeringData( otInstance *aInstance, const otExtAddress *aExtAddress )
Set Steering data out of band.
Configuration option OPENTHREAD_CONFIG_ENABLE_STEERING_DATA_SET_OOB
should be set to enable setting of steering data out of band. Otherwise calling this function does nothing and it returns OT_ERROR_DISABLED_FEATURE
error.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
Macros
OT_CHILD_IP6_ADDRESS_ITERATOR_INIT
OT_CHILD_IP6_ADDRESS_ITERATOR_INIT 0
Initializer for otChildIP6AddressIterator.