![]() |
0.01.00
|
This module includes functions for Thread Routers and Leaders. More...
Typedefs | |
typedef enum otThreadChildTableEvent | otThreadChildTableEvent |
This enumeration defines the constants used in otThreadChildTableCallback to indicate whether a child is added or removed. | |
typedef 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. More... | |
Enumerations | |
enum | otThreadChildTableEvent { OT_THREAD_CHILD_TABLE_EVENT_CHILD_ADDED, OT_THREAD_CHILD_TABLE_EVENT_CHILD_REMOVED } |
This enumeration defines the constants used in otThreadChildTableCallback to indicate whether a child is added or removed. More... | |
Functions | |
OTAPI uint8_t OTCALL | otThreadGetMaxAllowedChildren (otInstance *aInstance) |
Get the maximum number of children currently allowed. More... | |
OTAPI otError OTCALL | otThreadSetMaxAllowedChildren (otInstance *aInstance, uint8_t aMaxChildren) |
Set the maximum number of children currently allowed. More... | |
OTAPI bool OTCALL | otThreadIsRouterRoleEnabled (otInstance *aInstance) |
This function indicates whether or not the Router Role is enabled. More... | |
OTAPI void OTCALL | otThreadSetRouterRoleEnabled (otInstance *aInstance, bool aEnabled) |
This function sets whether or not the Router Role is enabled. More... | |
OTAPI otError OTCALL | otThreadSetPreferredRouterId (otInstance *aInstance, uint8_t aRouterId) |
Set the preferred Router Id. More... | |
OTAPI uint8_t OTCALL | otThreadGetLocalLeaderWeight (otInstance *aInstance) |
Get the Thread Leader Weight used when operating in the Leader role. More... | |
OTAPI void OTCALL | otThreadSetLocalLeaderWeight (otInstance *aInstance, uint8_t aWeight) |
Set the Thread Leader Weight used when operating in the Leader role. More... | |
OTAPI uint32_t OTCALL | otThreadGetLocalLeaderPartitionId (otInstance *aInstance) |
Get the Thread Leader Partition Id used when operating in the Leader role. More... | |
OTAPI void OTCALL | otThreadSetLocalLeaderPartitionId (otInstance *aInstance, uint32_t aPartitionId) |
Set the Thread Leader Partition Id used when operating in the Leader role. More... | |
OTAPI uint16_t OTCALL | otThreadGetJoinerUdpPort (otInstance *aInstance) |
Get the Joiner UDP Port. More... | |
OTAPI otError OTCALL | otThreadSetJoinerUdpPort (otInstance *aInstance, uint16_t aJoinerUdpPort) |
Set the Joiner UDP Port. More... | |
otError | otThreadSetSteeringData (otInstance *aInstance, const otExtAddress *aExtAddress) |
Set Steering data out of band. More... | |
OTAPI uint32_t OTCALL | otThreadGetContextIdReuseDelay (otInstance *aInstance) |
Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role. More... | |
OTAPI void OTCALL | otThreadSetContextIdReuseDelay (otInstance *aInstance, uint32_t aDelay) |
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role. More... | |
OTAPI uint8_t OTCALL | otThreadGetNetworkIdTimeout (otInstance *aInstance) |
Get the NETWORK_ID_TIMEOUT parameter used in the Router role. More... | |
OTAPI void OTCALL | otThreadSetNetworkIdTimeout (otInstance *aInstance, uint8_t aTimeout) |
Set the NETWORK_ID_TIMEOUT parameter used in the Leader role. More... | |
OTAPI uint8_t OTCALL | otThreadGetRouterUpgradeThreshold (otInstance *aInstance) |
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role. More... | |
OTAPI void OTCALL | otThreadSetRouterUpgradeThreshold (otInstance *aInstance, uint8_t aThreshold) |
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role. More... | |
OTAPI otError OTCALL | otThreadReleaseRouterId (otInstance *aInstance, uint8_t aRouterId) |
Release a Router ID that has been allocated by the device in the Leader role. More... | |
OTAPI otError OTCALL | otThreadBecomeRouter (otInstance *aInstance) |
Attempt to become a router. More... | |
OTAPI otError OTCALL | otThreadBecomeLeader (otInstance *aInstance) |
Become a leader and start a new partition. More... | |
OTAPI uint8_t OTCALL | otThreadGetRouterDowngradeThreshold (otInstance *aInstance) |
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role. More... | |
OTAPI void OTCALL | otThreadSetRouterDowngradeThreshold (otInstance *aInstance, uint8_t aThreshold) |
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role. More... | |
OTAPI uint8_t OTCALL | otThreadGetRouterSelectionJitter (otInstance *aInstance) |
Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role. More... | |
OTAPI void OTCALL | otThreadSetRouterSelectionJitter (otInstance *aInstance, uint8_t aRouterJitter) |
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role. More... | |
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. More... | |
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. More... | |
OTAPI uint8_t OTCALL | otThreadGetRouterIdSequence (otInstance *aInstance) |
Get the current Router ID Sequence. More... | |
uint8_t | otThreadGetMaxRouterId (otInstance *aInstance) |
The function returns the maximum allowed router ID. More... | |
OTAPI otError OTCALL | otThreadGetRouterInfo (otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo) |
The function retains diagnostic information for a given Thread Router. More... | |
OTAPI otError OTCALL | otThreadGetEidCacheEntry (otInstance *aInstance, uint8_t aIndex, otEidCacheEntry *aEntry) |
This function gets an EID cache entry. More... | |
OTAPI const uint8_t *OTCALL | otThreadGetPSKc (otInstance *aInstance) |
Get the thrPSKc. More... | |
OTAPI otError OTCALL | otThreadSetPSKc (otInstance *aInstance, const uint8_t *aPSKc) |
Set the thrPSKc. More... | |
OTAPI int8_t OTCALL | otThreadGetParentPriority (otInstance *aInstance) |
Get the assigned parent priority. More... | |
OTAPI otError OTCALL | otThreadSetParentPriority (otInstance *aInstance, int8_t aParentPriority) |
Set the parent priority. More... | |
otThreadChildTableCallback | otThreadGetChildTableCallback (otInstance *aInstance) |
This function gets the child table callback function. More... | |
void | otThreadSetChildTableCallback (otInstance *aInstance, otThreadChildTableCallback aCallback) |
This function sets the child table callback function. More... | |
This module includes functions for Thread Routers and Leaders.
typedef 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.
[in] | aEvent | A event flag indicating whether a child is being added or removed. |
[in] | aChildInfo | A pointer to child information structure. |
OTAPI otError OTCALL otThreadBecomeLeader | ( | otInstance * | aInstance | ) |
Become a leader and start a new partition.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_ERROR_NONE | Successfully became a leader and started a new partition. |
OT_ERROR_INVALID_STATE | Thread is disabled. |
OTAPI otError OTCALL otThreadBecomeRouter | ( | otInstance * | aInstance | ) |
Attempt to become a router.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_ERROR_NONE | Successfully begin attempt to become a router. |
OT_ERROR_INVALID_STATE | Thread is disabled. |
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.
[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. |
OT_ERROR_NONE | aChildInfo was successfully updated with the info for the given ID. |
OT_ERROR_NOT_FOUND | No valid child with this Child ID. |
OT_ERROR_INVALID_ARGS | If aChildInfo is NULL. |
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.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aChildIndex | The table index. |
[out] | aChildInfo | A pointer to where the child information is placed. |
OT_ERROR_NONE | aChildInfo was successfully updated with the info for the given index. |
OT_ERROR_NOT_FOUND | No valid child at this index. |
OT_ERROR_INVALID_ARGS | Either aChildInfo is NULL, or aChildIndex is out of range (higher than max table index). |
otThreadChildTableCallback otThreadGetChildTableCallback | ( | otInstance * | aInstance | ) |
This function gets the child table callback function.
OTAPI uint32_t OTCALL otThreadGetContextIdReuseDelay | ( | otInstance * | aInstance | ) |
Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otError OTCALL otThreadGetEidCacheEntry | ( | otInstance * | aInstance, |
uint8_t | aIndex, | ||
otEidCacheEntry * | aEntry | ||
) |
This function gets an EID cache entry.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aIndex | An index into the EID cache table. |
[out] | aEntry | A pointer to where the EID information is placed. |
OT_ERROR_NONE | Successfully retrieved the EID cache entry. |
OT_ERROR_INVALID_ARGS | aIndex was out of bounds or aEntry was NULL. |
OTAPI uint16_t OTCALL otThreadGetJoinerUdpPort | ( | otInstance * | aInstance | ) |
Get the Joiner UDP Port.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint32_t OTCALL otThreadGetLocalLeaderPartitionId | ( | otInstance * | aInstance | ) |
Get the Thread Leader Partition Id used when operating in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL otThreadGetLocalLeaderWeight | ( | otInstance * | aInstance | ) |
Get the Thread Leader Weight used when operating in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL otThreadGetMaxAllowedChildren | ( | otInstance * | aInstance | ) |
Get the maximum number of children currently allowed.
[in] | aInstance | A pointer to an OpenThread instance. |
uint8_t otThreadGetMaxRouterId | ( | otInstance * | aInstance | ) |
The function returns the maximum allowed router ID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL otThreadGetNetworkIdTimeout | ( | otInstance * | aInstance | ) |
Get the NETWORK_ID_TIMEOUT parameter used in the Router role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI int8_t OTCALL otThreadGetParentPriority | ( | otInstance * | aInstance | ) |
Get the assigned parent priority.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const uint8_t* OTCALL otThreadGetPSKc | ( | otInstance * | aInstance | ) |
Get the thrPSKc.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL otThreadGetRouterDowngradeThreshold | ( | otInstance * | aInstance | ) |
Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL otThreadGetRouterIdSequence | ( | otInstance * | aInstance | ) |
Get the current Router ID Sequence.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otError OTCALL otThreadGetRouterInfo | ( | otInstance * | aInstance, |
uint16_t | aRouterId, | ||
otRouterInfo * | aRouterInfo | ||
) |
The function retains diagnostic information for a given Thread Router.
[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. |
OT_ERROR_NONE | Successfully retrieved the router info for given id. |
OT_ERROR_NOT_FOUND | No router entry with the given id. |
OT_ERROR_INVALID_ARGS | aRouterInfo is NULL. |
OTAPI uint8_t OTCALL otThreadGetRouterSelectionJitter | ( | otInstance * | aInstance | ) |
Get the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL otThreadGetRouterUpgradeThreshold | ( | otInstance * | aInstance | ) |
Get the ROUTER_UPGRADE_THRESHOLD parameter used in the REED role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otThreadIsRouterRoleEnabled | ( | otInstance * | aInstance | ) |
This function indicates whether or not the Router Role is enabled.
[in] | aInstance | A pointer to an OpenThread instance. |
TRUE | If the Router Role is enabled. |
FALSE | If the Router Role is not enabled. |
OTAPI otError OTCALL otThreadReleaseRouterId | ( | otInstance * | aInstance, |
uint8_t | aRouterId | ||
) |
Release a Router ID that has been allocated by the device in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aRouterId | The Router ID to release. Valid range is [0, 62]. |
OT_ERROR_NONE | Successfully released the Router ID specified by aRouterId. |
OT_ERROR_INVALID_STATE | The Router ID was not allocated. |
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
.
[in] | aCallback | A pointer to callback handler function. |
OTAPI void OTCALL otThreadSetContextIdReuseDelay | ( | otInstance * | aInstance, |
uint32_t | aDelay | ||
) |
Set the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDelay | The CONTEXT_ID_REUSE_DELAY value. |
OTAPI otError OTCALL otThreadSetJoinerUdpPort | ( | otInstance * | aInstance, |
uint16_t | aJoinerUdpPort | ||
) |
Set the Joiner UDP Port.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aJoinerUdpPort | The Joiner UDP Port number. |
OT_ERROR_NONE | Successfully set the Joiner UDP Port. |
OTAPI void OTCALL otThreadSetLocalLeaderPartitionId | ( | otInstance * | aInstance, |
uint32_t | aPartitionId | ||
) |
Set the Thread Leader Partition Id used when operating in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPartitionId | The Thread Leader Partition Id value. |
OTAPI void OTCALL otThreadSetLocalLeaderWeight | ( | otInstance * | aInstance, |
uint8_t | aWeight | ||
) |
Set the Thread Leader Weight used when operating in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aWeight | The Thread Leader Weight value. |
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.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aMaxChildren | The maximum allowed children. |
OT_ERROR_NONE | Successfully set the max. |
OT_ERROR_INVALID_ARGS | If aMaxChildren is not in the range [1, OPENTHREAD_CONFIG_MAX_CHILDREN]. |
OT_ERROR_INVALID_STATE | If Thread isn't stopped. |
OTAPI void OTCALL otThreadSetNetworkIdTimeout | ( | otInstance * | aInstance, |
uint8_t | aTimeout | ||
) |
Set the NETWORK_ID_TIMEOUT parameter used in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aTimeout | The NETWORK_ID_TIMEOUT value. |
OTAPI otError OTCALL otThreadSetParentPriority | ( | otInstance * | aInstance, |
int8_t | aParentPriority | ||
) |
Set the parent priority.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aParentPriority | The parent priority value. |
OT_ERROR_NONE | Successfully set the parent priority. |
OT_ERROR_INVALID_ARGS | If the parent priority value is not among 1, 0, -1 and -2. |
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.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aRouterId | The preferred Router Id. |
OT_ERROR_NONE | Successfully set the preferred Router Id. |
OT_ERROR_INVALID_STATE | Could not set (role is not detached or disabled) |
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.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aPSKc | A pointer to a buffer containing the thrPSKc. |
OT_ERROR_NONE | Successfully set the thrPSKc. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
OTAPI void OTCALL otThreadSetRouterDowngradeThreshold | ( | otInstance * | aInstance, |
uint8_t | aThreshold | ||
) |
Set the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aThreshold | The ROUTER_DOWNGRADE_THRESHOLD value. |
OTAPI void OTCALL otThreadSetRouterRoleEnabled | ( | otInstance * | aInstance, |
bool | aEnabled | ||
) |
This function sets whether or not the Router Role is enabled.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnabled | TRUE if the Router Role is enabled, FALSE otherwise. |
OTAPI void OTCALL otThreadSetRouterSelectionJitter | ( | otInstance * | aInstance, |
uint8_t | aRouterJitter | ||
) |
Set the ROUTER_SELECTION_JITTER parameter used in the REED/Router role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aRouterJitter | The ROUTER_SELECTION_JITTER value. |
OTAPI void OTCALL otThreadSetRouterUpgradeThreshold | ( | otInstance * | aInstance, |
uint8_t | aThreshold | ||
) |
Set the ROUTER_UPGRADE_THRESHOLD parameter used in the Leader role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aThreshold | The ROUTER_UPGRADE_THRESHOLD value. |
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.
[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. |
OT_ERROR_NONE | Successfully set/updated the steering data. |
OT_ERROR_DISABLED_FEATURE | Feature is disabled, not capable of setting steering data out of band. |