Router/Leader#
This module includes functions for Thread Routers and Leaders.
Modules#
Enumerations#
Defines the EID cache entry state.
Represents the power supply property on a device.
Defines the constants used in otNeighborTableCallback
to indicate changes in neighbor table.
Typedefs#
Used to iterate through IPv6 addresses of a Thread Child entry.
Defines the EID cache entry state.
Represents an EID cache entry.
Represents an iterator used for iterating through the EID cache table entries.
Represents the device properties which are used for calculating the local leader weight on a device.
Pointer is called to notify that there is a change in the neighbor table.
Functions#
Gets the maximum number of children currently allowed.
Sets the maximum number of children currently allowed.
Indicates whether or not the device is router-eligible.
Sets whether or not the device is router-eligible.
Set the preferred Router Id.
Get the current device properties.
Set the device properties which are then used to determine and set the Leader Weight.
Gets the Thread Leader Weight used when operating in the Leader role.
Sets the Thread Leader Weight used when operating in the Leader role.
Get the preferred Thread Leader Partition Id used when operating in the Leader role.
Set the preferred Thread Leader Partition Id used when operating in the Leader role.
Gets the Joiner UDP Port.
Sets the Joiner UDP Port.
Set Steering data out of band.
Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
Get the NETWORK_ID_TIMEOUT
parameter.
Set the NETWORK_ID_TIMEOUT
parameter.
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.
Get the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
Set the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
Release a Router ID that has been allocated by the device in the Leader role.
Attempt to become a router.
Become a leader and start a new partition.
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.
Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
Gets diagnostic information for an attached Child by its Child ID or RLOC16.
The function retains diagnostic information for an attached Child by the internal table index.
Gets the next IPv6 address (using an iterator) for a given child.
Get the current Router ID Sequence.
The function returns the maximum allowed router ID.
The function retains diagnostic information for a given Thread Router.
Gets the next EID cache entry (using an iterator).
Get the Thread PSKc.
Get Key Reference to Thread PSKc stored.
Set the Thread PSKc.
Set the Key Reference to the Thread PSKc.
Get the assigned parent priority.
Set the parent priority.
Gets the maximum number of IP addresses that each MTD child may register with this device as parent.
Sets or restores the maximum number of IP addresses that each MTD child may register with this device as parent.
Registers a neighbor table callback function.
Sets whether the device was commissioned using CCM.
Sets whether the Security Policy TLV version-threshold for routing (VR field) is enabled.
Gets the range of router IDs that are allowed to assign to nodes within the thread network.
Sets the range of router IDs that are allowed to assign to nodes within the thread network.
Gets the current Interval Max value used by Advertisement trickle timer.
Indicates whether or not a Router ID is currently allocated.
Gets the next hop and path cost towards a given RLOC16 destination.
Macros#
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 |
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). |
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. |
Typedef Documentation#
otChildIp6AddressIterator#
typedef uint16_t otChildIp6AddressIterator
Used to iterate through IPv6 addresses of a Thread Child entry.
otCacheEntryState#
typedef enum otCacheEntryState otCacheEntryState
Defines the EID cache entry state.
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).
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.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
[in] | aEvent | A event flag. | |
[in] | aEntryInfo | A pointer to table entry info. |
Function Documentation#
otThreadGetMaxAllowedChildren#
uint16_t otThreadGetMaxAllowedChildren (otInstance * aInstance)
Gets the maximum number of children currently allowed.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The maximum number of children currently allowed.
See Also
otThreadSetMaxAllowedChildren#
otError otThreadSetMaxAllowedChildren (otInstance * aInstance, uint16_t aMaxChildren)
Sets the maximum number of children currently allowed.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aMaxChildren | The maximum allowed children. |
This parameter can only be set when Thread protocol operation has been stopped.
See Also
otThreadIsRouterEligible#
bool otThreadIsRouterEligible (otInstance * aInstance)
Indicates whether or not the device is router-eligible.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otThreadSetRouterEligible#
otError otThreadSetRouterEligible (otInstance * aInstance, bool aEligible)
Sets whether or not the device is router-eligible.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [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.
otThreadSetPreferredRouterId#
otError otThreadSetPreferredRouterId (otInstance * aInstance, uint8_t aRouterId)
Set the preferred Router Id.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [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.
otThreadGetDeviceProperties#
const otDeviceProperties * otThreadGetDeviceProperties (otInstance * aInstance)
Get the current device properties.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | N/A | aInstance |
Requires OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE
.
Returns
The device properties
otDeviceProperties
.
otThreadSetDeviceProperties#
void otThreadSetDeviceProperties (otInstance * aInstance, const otDeviceProperties * aDeviceProperties)
Set the device properties which are then used to determine and set the Leader Weight.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otDeviceProperties * | [in] | aDeviceProperties | The device properties. |
Requires OPENTHREAD_CONFIG_MLE_DEVICE_PROPERTY_LEADER_WEIGHT_ENABLE
.
otThreadGetLocalLeaderWeight#
uint8_t otThreadGetLocalLeaderWeight (otInstance * aInstance)
Gets the Thread Leader Weight used when operating in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The Thread Leader Weight value.
See Also
otThreadSetLeaderWeight
otThreadSetLocalLeaderWeight#
void otThreadSetLocalLeaderWeight (otInstance * aInstance, uint8_t aWeight)
Sets the Thread Leader Weight used when operating in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [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
otThreadGetPreferredLeaderPartitionId#
uint32_t otThreadGetPreferredLeaderPartitionId (otInstance * aInstance)
Get the preferred Thread Leader Partition Id used when operating in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The Thread Leader Partition Id value.
otThreadSetPreferredLeaderPartitionId#
void otThreadSetPreferredLeaderPartitionId (otInstance * aInstance, uint32_t aPartitionId)
Set the preferred Thread Leader Partition Id used when operating in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint32_t | [in] | aPartitionId | The Thread Leader Partition Id value. |
otThreadGetJoinerUdpPort#
uint16_t otThreadGetJoinerUdpPort (otInstance * aInstance)
Gets the Joiner UDP Port.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The Joiner UDP Port number.
See Also
otThreadSetJoinerUdpPort#
otError otThreadSetJoinerUdpPort (otInstance * aInstance, uint16_t aJoinerUdpPort)
Sets the Joiner UDP Port.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aJoinerUdpPort | The Joiner UDP Port number. |
See Also
otThreadSetSteeringData#
void otThreadSetSteeringData (otInstance * aInstance, const otExtAddress * aExtAddress)
Set Steering data out of band.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otExtAddress * | [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.
otThreadGetContextIdReuseDelay#
uint32_t otThreadGetContextIdReuseDelay (otInstance * aInstance)
Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The CONTEXT_ID_REUSE_DELAY value.
See Also
otThreadSetContextIdReuseDelay#
void otThreadSetContextIdReuseDelay (otInstance * aInstance, uint32_t aDelay)
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint32_t | [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
otThreadGetNetworkIdTimeout#
uint8_t otThreadGetNetworkIdTimeout (otInstance * aInstance)
Get the NETWORK_ID_TIMEOUT
parameter.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [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
otThreadSetNetworkIdTimeout#
void otThreadSetNetworkIdTimeout (otInstance * aInstance, uint8_t aTimeout)
Set the NETWORK_ID_TIMEOUT
parameter.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [in] | aTimeout | The |
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
otThreadGetRouterUpgradeThreshold#
uint8_t otThreadGetRouterUpgradeThreshold (otInstance * aInstance)
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The ROUTER_UPGRADE_THRESHOLD value.
See Also
otThreadSetRouterUpgradeThreshold#
void otThreadSetRouterUpgradeThreshold (otInstance * aInstance, uint8_t aThreshold)
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [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
otThreadGetChildRouterLinks#
uint8_t otThreadGetChildRouterLinks (otInstance * aInstance)
Get the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [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
otThreadSetChildRouterLinks#
otError otThreadSetChildRouterLinks (otInstance * aInstance, uint8_t aChildRouterLinks)
Set the MLE_CHILD_ROUTER_LINKS parameter used in the REED role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [in] | aChildRouterLinks | The MLE_CHILD_ROUTER_LINKS value. |
See Also
otThreadReleaseRouterId#
otError otThreadReleaseRouterId (otInstance * aInstance, uint8_t aRouterId)
Release a Router ID that has been allocated by the device in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [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.
otThreadBecomeRouter#
otError otThreadBecomeRouter (otInstance * aInstance)
Attempt to become a router.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [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.
otThreadBecomeLeader#
otError otThreadBecomeLeader (otInstance * aInstance)
Become a leader and start a new partition.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [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.
otThreadGetRouterDowngradeThreshold#
uint8_t otThreadGetRouterDowngradeThreshold (otInstance * aInstance)
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The ROUTER_DOWNGRADE_THRESHOLD value.
See Also
otThreadSetRouterDowngradeThreshold#
void otThreadSetRouterDowngradeThreshold (otInstance * aInstance, uint8_t aThreshold)
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [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
otThreadGetRouterSelectionJitter#
uint8_t otThreadGetRouterSelectionJitter (otInstance * aInstance)
Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The ROUTER_SELECTION_JITTER value.
See Also
otThreadSetRouterSelectionJitter#
void otThreadSetRouterSelectionJitter (otInstance * aInstance, uint8_t aRouterJitter)
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [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
otThreadGetChildInfoById#
otError otThreadGetChildInfoById (otInstance * aInstance, uint16_t aChildId, otChildInfo * aChildInfo)
Gets diagnostic information for an attached Child by its Child ID or RLOC16.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aChildId | The Child ID or RLOC16 for the attached child. |
otChildInfo * | [out] | aChildInfo | A pointer to where the child information is placed. |
otThreadGetChildInfoByIndex#
otError otThreadGetChildInfoByIndex (otInstance * aInstance, uint16_t aChildIndex, otChildInfo * aChildInfo)
The function retains diagnostic information for an attached Child by the internal table index.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aChildIndex | The table index. |
otChildInfo * | [out] | aChildInfo | A pointer to where the child information is placed. |
See Also
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aChildIndex | The child index. |
otChildIp6AddressIterator * | [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. |
otIp6Address * | [out] | aAddress | A pointer to an IPv6 address where the child's next address is placed (on success). |
See Also
otThreadGetRouterIdSequence#
uint8_t otThreadGetRouterIdSequence (otInstance * aInstance)
Get the current Router ID Sequence.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The Router ID Sequence.
otThreadGetMaxRouterId#
uint8_t otThreadGetMaxRouterId (otInstance * aInstance)
The function returns the maximum allowed router ID.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The maximum allowed router ID.
otThreadGetRouterInfo#
otError otThreadGetRouterInfo (otInstance * aInstance, uint16_t aRouterId, otRouterInfo * aRouterInfo)
The function retains diagnostic information for a given Thread Router.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aRouterId | The router ID or RLOC16 for a given router. |
otRouterInfo * | [out] | aRouterInfo | A pointer to where the router information is placed. |
otThreadGetNextCacheEntry#
otError otThreadGetNextCacheEntry (otInstance * aInstance, otCacheEntryInfo * aEntryInfo, otCacheEntryIterator * aIterator)
Gets the next EID cache entry (using an iterator).
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otCacheEntryInfo * | [out] | aEntryInfo | A pointer to where the EID cache entry information is placed. |
otCacheEntryIterator * | [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., |
otThreadGetPskc#
void otThreadGetPskc (otInstance * aInstance, otPskc * aPskc)
Get the Thread PSKc.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otPskc * | [out] | aPskc | A pointer to an |
See Also
otThreadGetPskcRef#
otPskcRef otThreadGetPskcRef (otInstance * aInstance)
Get Key Reference to Thread PSKc stored.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [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
otThreadSetPskc#
otError otThreadSetPskc (otInstance * aInstance, const otPskc * aPskc)
Set the Thread PSKc.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
const otPskc * | [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
otThreadSetPskcRef#
otError otThreadSetPskcRef (otInstance * aInstance, otPskcRef aKeyRef)
Set the Key Reference to the Thread PSKc.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otPskcRef | [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
otThreadGetParentPriority#
int8_t otThreadGetParentPriority (otInstance * aInstance)
Get the assigned parent priority.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
Returns
The assigned parent priority value, -2 means not assigned.
See Also
otThreadSetParentPriority#
otError otThreadSetParentPriority (otInstance * aInstance, int8_t aParentPriority)
Set the parent priority.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
int8_t | [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
otThreadGetMaxChildIpAddresses#
uint8_t otThreadGetMaxChildIpAddresses (otInstance * aInstance)
Gets the maximum number of IP addresses that each MTD child may register with this device as parent.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [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
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [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
otThreadRegisterNeighborTableCallback#
void otThreadRegisterNeighborTableCallback (otInstance * aInstance, otNeighborTableCallback aCallback)
Registers a neighbor table callback function.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
otNeighborTableCallback | [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
.
otThreadSetCcmEnabled#
void otThreadSetCcmEnabled (otInstance * aInstance, bool aEnabled)
Sets whether the device was commissioned using CCM.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [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.
otThreadSetThreadVersionCheckEnabled#
void otThreadSetThreadVersionCheckEnabled (otInstance * aInstance, bool aEnabled)
Sets whether the Security Policy TLV version-threshold for routing (VR field) is enabled.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
bool | [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.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t * | [out] | aMinRouterId | The minimum router ID. |
uint8_t * | [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
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [in] | aMinRouterId | The minimum router ID. |
uint8_t | [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
otThreadGetAdvertisementTrickleIntervalMax#
uint32_t otThreadGetAdvertisementTrickleIntervalMax (otInstance * aInstance)
Gets the current Interval Max value used by Advertisement trickle timer.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | N/A | aInstance |
This API requires OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
, and is intended for testing only.
Returns
The Interval Max of Advertisement trickle timer in milliseconds.
otThreadIsRouterIdAllocated#
bool otThreadIsRouterIdAllocated (otInstance * aInstance, uint8_t aRouterId)
Indicates whether or not a Router ID is currently allocated.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint8_t | [in] | aRouterId | The router ID to check. |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to an OpenThread instance. |
uint16_t | [in] | aDestRloc16 | The RLOC16 of destination. |
uint16_t * | [out] | aNextHopRloc16 | A pointer to return RLOC16 of next hop, 0xfffe if no next hop. |
uint8_t * | [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.