This module includes functions for all Thread roles. More...
Data Structures | |
struct | otMasterKey |
struct | otNetworkName |
struct | otExtendedPanId |
struct | otMeshLocalPrefix |
struct | otPskc |
struct | otSecurityPolicy |
struct | otOperationalDatasetComponents |
struct | otOperationalDataset |
struct | otBorderRouterConfig |
struct | otExternalRouteConfig |
struct | otServerConfig |
struct | otServiceConfig |
struct | otNetworkDiagConnectivity |
struct | otNetworkDiagRouteData |
struct | otNetworkDiagRoute |
struct | otNetworkDiagMacCounters |
struct | otNetworkDiagChildEntry |
struct | otNetworkDiagTlv |
struct | otLinkModeConfig |
struct | otNeighborInfo |
struct | otLeaderData |
struct | otRouterInfo |
struct | otIpCounters |
struct | otMleCounters |
struct | otThreadParentResponseInfo |
Macros | |
#define | OT_MASTER_KEY_SIZE 16 |
Size of the Thread Master Key (bytes) | |
#define | OT_NETWORK_NAME_MAX_SIZE 16 |
Maximum size of the Thread Network Name field (bytes) | |
#define | OT_EXT_PAN_ID_SIZE 8 |
Size of a Thread PAN ID (bytes) | |
#define | OT_MESH_LOCAL_PREFIX_SIZE 8 |
Size of the Mesh Local Prefix (bytes) | |
#define | OT_PSKC_MAX_SIZE 16 |
Maximum size of the PSKc (bytes) | |
#define | OT_CHANNEL_1_MASK (1 << 1) |
Channel 1. | |
#define | OT_CHANNEL_2_MASK (1 << 2) |
Channel 2. | |
#define | OT_CHANNEL_3_MASK (1 << 3) |
Channel 3. | |
#define | OT_CHANNEL_4_MASK (1 << 4) |
Channel 4. | |
#define | OT_CHANNEL_5_MASK (1 << 5) |
Channel 5. | |
#define | OT_CHANNEL_6_MASK (1 << 6) |
Channel 6. | |
#define | OT_CHANNEL_7_MASK (1 << 7) |
Channel 7. | |
#define | OT_CHANNEL_8_MASK (1 << 8) |
Channel 8. | |
#define | OT_CHANNEL_9_MASK (1 << 9) |
Channel 9. | |
#define | OT_CHANNEL_10_MASK (1 << 10) |
Channel 10. | |
#define | OT_CHANNEL_11_MASK (1 << 11) |
Channel 11. | |
#define | OT_CHANNEL_12_MASK (1 << 12) |
Channel 12. | |
#define | OT_CHANNEL_13_MASK (1 << 13) |
Channel 13. | |
#define | OT_CHANNEL_14_MASK (1 << 14) |
Channel 14. | |
#define | OT_CHANNEL_15_MASK (1 << 15) |
Channel 15. | |
#define | OT_CHANNEL_16_MASK (1 << 16) |
Channel 16. | |
#define | OT_CHANNEL_17_MASK (1 << 17) |
Channel 17. | |
#define | OT_CHANNEL_18_MASK (1 << 18) |
Channel 18. | |
#define | OT_CHANNEL_19_MASK (1 << 19) |
Channel 19. | |
#define | OT_CHANNEL_20_MASK (1 << 20) |
Channel 20. | |
#define | OT_CHANNEL_21_MASK (1 << 21) |
Channel 21. | |
#define | OT_CHANNEL_22_MASK (1 << 22) |
Channel 22. | |
#define | OT_CHANNEL_23_MASK (1 << 23) |
Channel 23. | |
#define | OT_CHANNEL_24_MASK (1 << 24) |
Channel 24. | |
#define | OT_CHANNEL_25_MASK (1 << 25) |
Channel 25. | |
#define | OT_CHANNEL_26_MASK (1 << 26) |
Channel 26. | |
#define | OT_NETWORK_DATA_ITERATOR_INIT 0 |
Initializer for otNetworkDataIterator. | |
#define | OT_SERVICE_DATA_MAX_SIZE 252 |
Maximum size of Service Data in bytes. | |
#define | OT_SERVER_DATA_MAX_SIZE 248 |
Maximum size of Server Data in bytes. This is theoretical limit, practical one is much lower. | |
#define | OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES 19 |
#define | OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_ENTRY_SIZE 3 |
#define | OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT 0 |
#define | OT_NETWORK_BASE_TLV_MAX_LENGTH 254 |
#define | OT_NETWORK_MAX_ROUTER_ID 62 |
Maximum Router ID. | |
#define | OT_NEIGHBOR_INFO_ITERATOR_INIT 0 |
Initializer for otNeighborInfoIterator. | |
Variables | |
OT_TOOL_PACKED_BEGIN struct otMasterKey | OT_TOOL_PACKED_END |
This module includes functions for all Thread roles.
OPENTHREAD_FTD=1
or OPENTHREAD_MTD=1
. #define OT_NETWORK_BASE_TLV_MAX_LENGTH 254 |
Maximum value length of Thread Base TLV.
#define OT_NETWORK_DIAGNOSTIC_CHILD_TABLE_ENTRY_SIZE 3 |
Size of Network Diagnostic Child Table entry.
#define OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT 0 |
Initializer for otNetworkDiagIterator.
#define OT_NETWORK_DIAGNOSTIC_TYPELIST_MAX_ENTRIES 19 |
Maximum Number of Network Diagnostic TLV Types to Request or Reset.
typedef struct otBorderRouterConfig otBorderRouterConfig |
This structure represents a Border Router configuration.
typedef uint32_t otChannelMask |
This type represents Channel Mask.
typedef struct otExtendedPanId otExtendedPanId |
This structure represents an Extended PAN ID.
typedef struct otExternalRouteConfig otExternalRouteConfig |
This structure represents an External Route configuration.
typedef struct otIpCounters otIpCounters |
This structure represents the IP level counters.
typedef struct otLeaderData otLeaderData |
This structure represents the Thread Leader Data.
typedef struct otLinkModeConfig otLinkModeConfig |
This structure represents an MLE Link Mode configuration.
typedef struct otMasterKey otMasterKey |
This structure represents a Thread Master Key.
typedef enum otMeshcopTlvType otMeshcopTlvType |
This enumeration represents meshcop TLV types.
typedef struct otMeshLocalPrefix otMeshLocalPrefix |
This structure represents a Mesh Local Prefix.
typedef struct otMleCounters otMleCounters |
This structure represents the Thread MLE counters.
typedef struct otNetworkDiagChildEntry otNetworkDiagChildEntry |
This structure represents a Network Diagnostic Child Table Entry.
typedef struct otNetworkDiagConnectivity otNetworkDiagConnectivity |
This structure represents a Network Diagnostic Connectivity value.
typedef struct otNetworkDiagMacCounters otNetworkDiagMacCounters |
This structure represents a Network Diagnostic Mac Counters value.
See RFC 2863 for definitions of member fields.
typedef struct otNetworkDiagRoute otNetworkDiagRoute |
This structure represents a Network Diagnostic Route TLV value.
typedef struct otNetworkDiagRouteData otNetworkDiagRouteData |
This structure represents a Network Diagnostic Route data.
typedef struct otNetworkDiagTlv otNetworkDiagTlv |
This structure represents a Network Diagnostic TLV.
typedef struct otNetworkName otNetworkName |
This structure represents a Network Name.
typedef struct otOperationalDataset otOperationalDataset |
This structure represents an Active or Pending Operational Dataset.
Components in Dataset are optional. mComponets
structure specifies which components are present in the Dataset.
typedef struct otOperationalDatasetComponents otOperationalDatasetComponents |
This structure represents presence of different components in Active or Pending Operational Dataset.
typedef void(* otReceiveDiagnosticGetCallback)(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext) |
This function pointer is called when Network Diagnostic Get response is received.
[in] | aMessage | A pointer to the message buffer containing the received Network Diagnostic Get response payload. |
[in] | aMessageInfo | A pointer to the message info for aMessage . |
[in] | aContext | A pointer to application-specific context. |
typedef enum otRoutePreference otRoutePreference |
Defines valid values for member mPreference in otExternalRouteConfig and otBorderRouterConfig.
typedef struct otSecurityPolicy otSecurityPolicy |
This structure represent Security Policy.
typedef struct otServerConfig otServerConfig |
This structure represents a Server configuration.
typedef struct otServiceConfig otServiceConfig |
This structure represents a Service configuration.
typedef void(* otThreadParentResponseCallback)(otThreadParentResponseInfo *aInfo, void *aContext) |
This function pointer is called every time an MLE Parent Response message is received.
[in] | aStats | pointer to a location on stack holding the stats data. |
[in] | aContext | A pointer to callback client-specific context. |
typedef struct otThreadParentResponseInfo otThreadParentResponseInfo |
This structure represents the MLE Parent Response data.
anonymous enum |
This enumeration defines the Security Policy TLV flags.
anonymous enum |
enum otDeviceRole |
Represents a Thread device role.
enum otMeshcopTlvType |
This enumeration represents meshcop TLV types.
enum otRoutePreference |
Defines valid values for member mPreference in otExternalRouteConfig and otBorderRouterConfig.
Enumerator | |
---|---|
OT_ROUTE_PREFERENCE_LOW |
Low route preference. |
OT_ROUTE_PREFERENCE_MED |
Medium route preference. |
OT_ROUTE_PREFERENCE_HIGH |
High route preference. |
otError otDatasetCreateNewNetwork | ( | otInstance * | aInstance, |
otOperationalDataset * | aDataset | ||
) |
This method creates a new Operational Dataset to use when forming a new network.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aDataset | The Operational Dataset. |
OT_ERROR_NONE | Successfully created a new Operational Dataset. |
OT_ERROR_FAILED | Failed to generate random values for new parameters. |
otError otDatasetGeneratePskc | ( | const char * | aPassPhrase, |
const otNetworkName * | aNetworkName, | ||
const otExtendedPanId * | aExtPanId, | ||
otPskc * | aPskc | ||
) |
This function generates PSKc from a given pass-phrase, network name, and extended PAN ID.
PSKc is used to establish the Commissioner Session.
[in] | aPassPhrase | The commissioning pass-phrase. |
[in] | aNetworkName | The network name for PSKc computation. |
[in] | aExtPanId | The extended PAN ID for PSKc computation. |
[out] | aPskc | A pointer to variable to output the generated PSKc. |
OT_ERROR_NONE | Successfully generate PSKc. |
OT_ERROR_INVALID_ARGS | If any of the input arguments is invalid. |
otError otDatasetGetActive | ( | otInstance * | aInstance, |
otOperationalDataset * | aDataset | ||
) |
This function gets the Active Operational Dataset.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aDataset | A pointer to where the Active Operational Dataset will be placed. |
OT_ERROR_NONE | Successfully retrieved the Active Operational Dataset. |
OT_ERROR_INVALID_ARGS | aDataset was NULL. |
uint32_t otDatasetGetDelayTimerMinimal | ( | otInstance * | aInstance | ) |
Get minimal delay timer.
[in] | aInstance | A pointer to an OpenThread instance. |
the | value of minimal delay timer (in ms). |
otError otDatasetGetPending | ( | otInstance * | aInstance, |
otOperationalDataset * | aDataset | ||
) |
This function gets the Pending Operational Dataset.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aDataset | A pointer to where the Pending Operational Dataset will be placed. |
OT_ERROR_NONE | Successfully retrieved the Pending Operational Dataset. |
OT_ERROR_INVALID_ARGS | aDataset was NULL. |
bool otDatasetIsCommissioned | ( | otInstance * | aInstance | ) |
This function indicates whether a valid network is present in the Active Operational Dataset or not.
[in] | aInstance | A pointer to an OpenThread instance. |
otError otDatasetSendMgmtActiveGet | ( | otInstance * | aInstance, |
const otOperationalDatasetComponents * | aDatasetComponents, | ||
const uint8_t * | aTlvTypes, | ||
uint8_t | aLength, | ||
const otIp6Address * | aAddress | ||
) |
This function sends MGMT_ACTIVE_GET.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDatasetComponents | A pointer to a Dataset Components structure specifying which components to request. |
[in] | aTlvTypes | A pointer to array containing additional raw TLV types to be requested. |
[in] | aLength | The length of aTlvTypes . |
[in] | aAddress | A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default. |
OT_ERROR_NONE | Successfully send the meshcop dataset command. |
OT_ERROR_NO_BUFS | Insufficient buffer space to send. |
otError otDatasetSendMgmtActiveSet | ( | otInstance * | aInstance, |
const otOperationalDataset * | aDataset, | ||
const uint8_t * | aTlvs, | ||
uint8_t | aLength | ||
) |
This function sends MGMT_ACTIVE_SET.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDataset | A pointer to operational dataset. |
[in] | aTlvs | A pointer to TLVs. |
[in] | aLength | The length of TLVs. |
OT_ERROR_NONE | Successfully send the meshcop dataset command. |
OT_ERROR_NO_BUFS | Insufficient buffer space to send. |
otError otDatasetSendMgmtPendingGet | ( | otInstance * | aInstance, |
const otOperationalDatasetComponents * | aDatasetComponents, | ||
const uint8_t * | aTlvTypes, | ||
uint8_t | aLength, | ||
const otIp6Address * | aAddress | ||
) |
This function sends MGMT_PENDING_GET.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDatasetComponents | A pointer to a Dataset Components structure specifying which components to request. |
[in] | aTlvTypes | A pointer to array containing additional raw TLV types to be requested. |
[in] | aLength | The length of aTlvTypes . |
[in] | aAddress | A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default. |
OT_ERROR_NONE | Successfully send the meshcop dataset command. |
OT_ERROR_NO_BUFS | Insufficient buffer space to send. |
otError otDatasetSendMgmtPendingSet | ( | otInstance * | aInstance, |
const otOperationalDataset * | aDataset, | ||
const uint8_t * | aTlvs, | ||
uint8_t | aLength | ||
) |
This function sends MGMT_PENDING_SET.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDataset | A pointer to operational dataset. |
[in] | aTlvs | A pointer to TLVs. |
[in] | aLength | The length of TLVs. |
OT_ERROR_NONE | Successfully send the meshcop dataset command. |
OT_ERROR_NO_BUFS | Insufficient buffer space to send. |
otError otDatasetSetActive | ( | otInstance * | aInstance, |
const otOperationalDataset * | aDataset | ||
) |
This function sets the Active Operational Dataset.
If the dataset does not include an Active Timestamp, the dataset is only partially complete.
If Thread is enabled on a device that has a partially complete Active Dataset, the device will attempt to attach to an existing Thread network using any existing information in the dataset. Only the Thread Master Key is needed to attach to a network.
If channel is not included in the dataset, the device will send MLE Announce messages across different channels to find neighbors on other channels.
If the device successfully attaches to a Thread network, the device will then retrieve the full Active Dataset from its Parent. Note that a router-capable device will not transition to the Router or Leader roles until it has a complete Active Dataset.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDataset | A pointer to the Active Operational Dataset. |
OT_ERROR_NONE | Successfully set the Active Operational Dataset. |
OT_ERROR_NO_BUFS | Insufficient buffer space to set the Active Operational Dataset. |
OT_ERROR_INVALID_ARGS | aDataset was NULL. |
otError otDatasetSetDelayTimerMinimal | ( | otInstance * | aInstance, |
uint32_t | aDelayTimerMinimal | ||
) |
Set minimal delay timer.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDelayTimerMinimal | The value of minimal delay timer (in ms). |
OT_ERROR_NONE | Successfully set minimal delay timer. |
OT_ERROR_INVALID_ARGS | If aDelayTimerMinimal is not valid. |
otError otDatasetSetPending | ( | otInstance * | aInstance, |
const otOperationalDataset * | aDataset | ||
) |
This function sets the Pending Operational Dataset.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDataset | A pointer to the Pending Operational Dataset. |
OT_ERROR_NONE | Successfully set the Pending Operational Dataset. |
OT_ERROR_NO_BUFS | Insufficient buffer space to set the Pending Operational Dataset. |
OT_ERROR_INVALID_ARGS | aDataset was NULL. |
otError otNetDataGet | ( | otInstance * | aInstance, |
bool | aStable, | ||
uint8_t * | aData, | ||
uint8_t * | aDataLength | ||
) |
This method provides a full or stable copy of the Partition's Thread Network Data.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aStable | TRUE when copying the stable version, FALSE when copying the full version. |
[out] | aData | A pointer to the data buffer. |
[in,out] | aDataLength | On entry, size of the data buffer pointed to by aData . On exit, number of copied bytes. |
otError otNetDataGetNextOnMeshPrefix | ( | otInstance * | aInstance, |
otNetworkDataIterator * | aIterator, | ||
otBorderRouterConfig * | aConfig | ||
) |
This function gets the next On Mesh Prefix in the partition's Network Data.
[in] | aInstance | A pointer to an OpenThread instance. |
[in,out] | aIterator | A pointer to the Network Data iterator context. To get the first on-mesh entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT. |
[out] | aConfig | A pointer to where the On Mesh Prefix information will be placed. |
OT_ERROR_NONE | Successfully found the next On Mesh prefix. |
OT_ERROR_NOT_FOUND | No subsequent On Mesh prefix exists in the Thread Network Data. |
otError otNetDataGetNextRoute | ( | otInstance * | aInstance, |
otNetworkDataIterator * | aIterator, | ||
otExternalRouteConfig * | aConfig | ||
) |
This function gets the next external route in the partition's Network Data.
[in] | aInstance | A pointer to an OpenThread instance. |
[in,out] | aIterator | A pointer to the Network Data iterator context. To get the first external route entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT. |
[out] | aConfig | A pointer to where the External Route information will be placed. |
OT_ERROR_NONE | Successfully found the next External Route. |
OT_ERROR_NOT_FOUND | No subsequent external route entry exists in the Thread Network Data. |
otError otNetDataGetNextService | ( | otInstance * | aInstance, |
otNetworkDataIterator * | aIterator, | ||
otServiceConfig * | aConfig | ||
) |
This function gets the next service in the partition's Network Data.
[in] | aInstance | A pointer to an OpenThread instance. |
[in,out] | aIterator | A pointer to the Network Data iterator context. To get the first service entry it should be set to OT_NETWORK_DATA_ITERATOR_INIT. |
[out] | aConfig | A pointer to where the service information will be placed. |
OT_ERROR_NONE | Successfully found the next service. |
OT_ERROR_NOT_FOUND | No subsequent service exists in the partition's Network Data. |
uint8_t otNetDataGetStableVersion | ( | otInstance * | aInstance | ) |
Get the Stable Network Data Version.
[in] | aInstance | A pointer to an OpenThread instance. |
uint8_t otNetDataGetVersion | ( | otInstance * | aInstance | ) |
Get the Network Data Version.
[in] | aInstance | A pointer to an OpenThread instance. |
otError otThreadBecomeChild | ( | otInstance * | aInstance | ) |
Attempt to reattach as a child.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_ERROR_NONE | Successfully begin attempt to become a child. |
OT_ERROR_INVALID_STATE | Thread is disabled. |
otError otThreadBecomeDetached | ( | otInstance * | aInstance | ) |
Detach from the Thread network.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_ERROR_NONE | Successfully detached from the Thread network. |
OT_ERROR_INVALID_STATE | Thread is disabled. |
otError otThreadDiscover | ( | otInstance * | aInstance, |
uint32_t | aScanChannels, | ||
uint16_t | aPanId, | ||
bool | aJoiner, | ||
bool | aEnableEui64Filtering, | ||
otHandleActiveScanResult | aCallback, | ||
void * | aCallbackContext | ||
) |
This function starts a Thread Discovery scan.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aScanChannels | A bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK). |
[in] | aPanId | The PAN ID filter (set to Broadcast PAN to disable filter). |
[in] | aJoiner | Value of the Joiner Flag in the Discovery Request TLV. |
[in] | aEnableEui64Filtering | TRUE to filter responses on EUI-64, FALSE otherwise. |
[in] | aCallback | A pointer to a function called on receiving an MLE Discovery Response or scan completes. |
[in] | aCallbackContext | A pointer to application-specific context. |
OT_ERROR_NONE | Accepted the Thread Discovery request. |
OT_ERROR_BUSY | Already performing an Thread Discovery. |
uint32_t otThreadGetChildTimeout | ( | otInstance * | aInstance | ) |
Get the Thread Child Timeout used when operating in the Child role.
[in] | aInstance | A pointer to an OpenThread instance. |
otDeviceRole otThreadGetDeviceRole | ( | otInstance * | aInstance | ) |
Get the device role.
[in] | aInstance | A pointer to an OpenThread instance. |
OT_DEVICE_ROLE_DISABLED | The Thread stack is disabled. |
OT_DEVICE_ROLE_DETACHED | The device is not currently participating in a Thread network/partition. |
OT_DEVICE_ROLE_CHILD | The device is currently operating as a Thread Child. |
OT_DEVICE_ROLE_ROUTER | The device is currently operating as a Thread Router. |
OT_DEVICE_ROLE_LEADER | The device is currently operating as a Thread Leader. |
const char* otThreadGetDomainName | ( | otInstance * | aInstance | ) |
Get the Thread Domain Name.
This function is only availble since Thread 1.2.
[in] | aInstance | A pointer to an OpenThread instance. |
const otExtendedPanId* otThreadGetExtendedPanId | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 Extended PAN ID.
[in] | aInstance | A pointer to an OpenThread instance. |
const otIpCounters* otThreadGetIp6Counters | ( | otInstance * | aInstance | ) |
Get the IPv6 counters.
[in] | aInstance | A pointer to an OpenThread instance. |
uint32_t otThreadGetKeySequenceCounter | ( | otInstance * | aInstance | ) |
Get the thrKeySequenceCounter.
[in] | aInstance | A pointer to an OpenThread instance. |
uint32_t otThreadGetKeySwitchGuardTime | ( | otInstance * | aInstance | ) |
Get the thrKeySwitchGuardTime
[in] | aInstance | A pointer to an OpenThread instance. |
otError otThreadGetLeaderData | ( | otInstance * | aInstance, |
otLeaderData * | aLeaderData | ||
) |
This function get the Thread Leader Data.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aLeaderData | A pointer to where the leader data is placed. |
OT_ERROR_NONE | Successfully retrieved the leader data. |
OT_ERROR_DETACHED | Not currently attached. |
otError otThreadGetLeaderRloc | ( | otInstance * | aInstance, |
otIp6Address * | aLeaderRloc | ||
) |
This function returns a pointer to the Leader's RLOC.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aLeaderRloc | A pointer to the Leader's RLOC. |
OT_ERROR_NONE | The Leader's RLOC was successfully written to aLeaderRloc . |
OT_ERROR_INVALID_ARGS | aLeaderRloc was NULL. |
OT_ERROR_DETACHED | Not currently attached to a Thread Partition. |
uint8_t otThreadGetLeaderRouterId | ( | otInstance * | aInstance | ) |
Get the Leader's Router ID.
[in] | aInstance | A pointer to an OpenThread instance. |
uint8_t otThreadGetLeaderWeight | ( | otInstance * | aInstance | ) |
Get the Leader's Weight.
[in] | aInstance | A pointer to an OpenThread instance. |
const otIp6Address* otThreadGetLinkLocalIp6Address | ( | otInstance * | aInstance | ) |
This function returns the Thread link-local IPv6 address.
The Thread link local address is derived using IEEE802.15.4 Extended Address as Interface Identifier.
[in] | aInstance | A pointer to an OpenThread instance. |
otLinkModeConfig otThreadGetLinkMode | ( | otInstance * | aInstance | ) |
Get the MLE Link Mode configuration.
[in] | aInstance | A pointer to an OpenThread instance. |
const otMasterKey* otThreadGetMasterKey | ( | otInstance * | aInstance | ) |
Get the thrMasterKey.
[in] | aInstance | A pointer to an OpenThread instance. |
const otIp6Address* otThreadGetMeshLocalEid | ( | otInstance * | aInstance | ) |
This function returns a pointer to the Mesh Local EID address.
[in] | aInstance | A pointer to an OpenThread instance. |
const otMeshLocalPrefix* otThreadGetMeshLocalPrefix | ( | otInstance * | aInstance | ) |
This function returns a pointer to the Mesh Local Prefix.
[in] | aInstance | A pointer to an OpenThread instance. |
const otMleCounters* otThreadGetMleCounters | ( | otInstance * | aInstance | ) |
Get the Thread MLE counters.
[in] | aInstance | A pointer to an OpenThread instance. |
const char* otThreadGetNetworkName | ( | otInstance * | aInstance | ) |
Get the Thread Network Name.
[in] | aInstance | A pointer to an OpenThread instance. |
otError otThreadGetNextDiagnosticTlv | ( | const otMessage * | aMessage, |
otNetworkDiagIterator * | aIterator, | ||
otNetworkDiagTlv * | aNetworkDiagTlv | ||
) |
This function gets the next Network Diagnostic TLV in the message.
[in] | aMessage | A pointer to a message. |
[in,out] | aIterator | A pointer to the Network Diagnostic iterator context. To get the first Network Diagnostic TLV it should be set to OT_NETWORK_DIAGNOSTIC_ITERATOR_INIT. |
[out] | aNetworkDiagTlv | A pointer to where the Network Diagnostic TLV information will be placed. |
OT_ERROR_NONE | Successfully found the next Network Diagnostic TLV. |
OT_ERROR_NOT_FOUND | No subsequent Network Diagnostic TLV exists in the message. |
OT_ERROR_PARSE | Parsing the next Network Diagnostic failed. |
A subsequent call to this function is allowed only when current return value is OT_ERROR_NONE.
otError otThreadGetNextNeighborInfo | ( | otInstance * | aInstance, |
otNeighborInfoIterator * | aIterator, | ||
otNeighborInfo * | aInfo | ||
) |
This function gets the next neighbor information. It is used to go through the entries of the neighbor table.
[in] | aInstance | A pointer to an OpenThread instance. |
[in,out] | aIterator | A pointer to the iterator context. To get the first neighbor entry it should be set to OT_NEIGHBOR_INFO_ITERATOR_INIT. |
[out] | aInfo | A pointer to the neighbor information. |
OT_ERROR_NONE | Successfully found the next neighbor entry in table. |
OT_ERROR_NOT_FOUND | No subsequent neighbor entry exists in the table. |
OT_ERROR_INVALID_ARGS | aIterator or aInfo was NULL. |
otError otThreadGetParentAverageRssi | ( | otInstance * | aInstance, |
int8_t * | aParentRssi | ||
) |
The function retrieves the average RSSI for the Thread Parent.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aParentRssi | A pointer to where the parent RSSI should be placed. |
otError otThreadGetParentInfo | ( | otInstance * | aInstance, |
otRouterInfo * | aParentInfo | ||
) |
The function retrieves diagnostic information for a Thread Router as parent.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aParentInfo | A pointer to where the parent router information is placed. |
otError otThreadGetParentLastRssi | ( | otInstance * | aInstance, |
int8_t * | aLastRssi | ||
) |
The function retrieves the RSSI of the last packet from the Thread Parent.
[in] | aInstance | A pointer to an OpenThread instance. |
[out] | aLastRssi | A pointer to where the last RSSI should be placed. |
OT_ERROR_NONE | Successfully retrieved the RSSI data. |
OT_ERROR_FAILED | Unable to get RSSI data. |
OT_ERROR_INVALID_ARGS | aLastRssi is NULL. |
uint32_t otThreadGetPartitionId | ( | otInstance * | aInstance | ) |
Get the Partition ID.
[in] | aInstance | A pointer to an OpenThread instance. |
const otIp6Address* otThreadGetRloc | ( | otInstance * | aInstance | ) |
This function returns a pointer to the Thread Routing Locator (RLOC) address.
[in] | aInstance | A pointer to an OpenThread instance. |
uint16_t otThreadGetRloc16 | ( | otInstance * | aInstance | ) |
Get the RLOC16.
[in] | aInstance | A pointer to an OpenThread instance. |
uint16_t otThreadGetVersion | ( | void | ) |
This function gets the Thread protocol version.
bool otThreadIsDiscoverInProgress | ( | otInstance * | aInstance | ) |
This function determines if an MLE Thread Discovery is currently in progress.
[in] | aInstance | A pointer to an OpenThread instance. |
bool otThreadIsSingleton | ( | otInstance * | aInstance | ) |
This function indicates whether a node is the only router on the network.
[in] | aInstance | A pointer to an OpenThread instance. |
TRUE | It is the only router in the network. |
FALSE | It is a child or is not a single router in the network. |
void otThreadRegisterParentResponseCallback | ( | otInstance * | aInstance, |
otThreadParentResponseCallback | aCallback, | ||
void * | aContext | ||
) |
This function registers a callback to receive MLE Parent Response data.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aCallback | A pointer to a function that is called upon receiving an MLE Parent Response message. |
[in] | aContext | A pointer to callback client-specific context. |
void otThreadResetIp6Counters | ( | otInstance * | aInstance | ) |
Reset the IPv6 counters.
[in] | aInstance | A pointer to an OpenThread instance. |
void otThreadResetMleCounters | ( | otInstance * | aInstance | ) |
Reset the Thread MLE counters.
[in] | aInstance | A pointer to an OpenThread instance. |
otError otThreadSendDiagnosticGet | ( | otInstance * | aInstance, |
const otIp6Address * | aDestination, | ||
const uint8_t | aTlvTypes[], | ||
uint8_t | aCount | ||
) |
Send a Network Diagnostic Get request.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDestination | A pointer to destination address. |
[in] | aTlvTypes | An array of Network Diagnostic TLV types. |
[in] | aCount | Number of types in aTlvTypes. |
OT_ERROR_NONE | Successfully queued the DIAG_GET.req. |
OT_ERROR_NO_BUFS | Insufficient message buffers available to send DIAG_GET.req. |
otError otThreadSendDiagnosticReset | ( | otInstance * | aInstance, |
const otIp6Address * | aDestination, | ||
const uint8_t | aTlvTypes[], | ||
uint8_t | aCount | ||
) |
Send a Network Diagnostic Reset request.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDestination | A pointer to destination address. |
[in] | aTlvTypes | An array of Network Diagnostic TLV types. Currently only Type 9 is allowed. |
[in] | aCount | Number of types in aTlvTypes |
OT_ERROR_NONE | Successfully queued the DIAG_RST.ntf. |
OT_ERROR_NO_BUFS | Insufficient message buffers available to send DIAG_RST.ntf. |
void otThreadSetChildTimeout | ( | otInstance * | aInstance, |
uint32_t | aTimeout | ||
) |
Set the Thread Child Timeout used when operating in the Child role.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aTimeout | The timeout value in seconds. |
otError otThreadSetDomainName | ( | otInstance * | aInstance, |
const char * | aDomainName | ||
) |
Set the Thread Domain Name.
This function is only availble since Thread 1.2. This function succeeds only when Thread protocols are disabled.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aDomainName | A pointer to the Thread Domain Name. |
OT_ERROR_NONE | Successfully set the Thread Domain Name. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
otError otThreadSetEnabled | ( | otInstance * | aInstance, |
bool | aEnabled | ||
) |
This function starts Thread protocol operation.
The interface must be up when calling this function.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aEnabled | TRUE if Thread is enabled, FALSE otherwise. |
OT_ERROR_NONE | Successfully started Thread protocol operation. |
OT_ERROR_INVALID_STATE | The network interface was not not up. |
otError otThreadSetExtendedPanId | ( | otInstance * | aInstance, |
const otExtendedPanId * | aExtendedPanId | ||
) |
Set the IEEE 802.15.4 Extended PAN ID.
This function can only be called while Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aExtendedPanId | A pointer to the IEEE 802.15.4 Extended PAN ID. |
OT_ERROR_NONE | Successfully set the Extended PAN ID. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
void otThreadSetKeySequenceCounter | ( | otInstance * | aInstance, |
uint32_t | aKeySequenceCounter | ||
) |
Set the thrKeySequenceCounter.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aKeySequenceCounter | The thrKeySequenceCounter value. |
void otThreadSetKeySwitchGuardTime | ( | otInstance * | aInstance, |
uint32_t | aKeySwitchGuardTime | ||
) |
Set the thrKeySwitchGuardTime
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aKeySwitchGuardTime | The thrKeySwitchGuardTime value (in hours). |
otError otThreadSetLinkMode | ( | otInstance * | aInstance, |
otLinkModeConfig | aConfig | ||
) |
Set the MLE Link Mode configuration.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aConfig | A pointer to the Link Mode configuration. |
OT_ERROR_NONE | Successfully set the MLE Link Mode configuration. |
otError otThreadSetMasterKey | ( | otInstance * | aInstance, |
const otMasterKey * | aKey | ||
) |
Set the thrMasterKey.
This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aKey | A pointer to a buffer containing the thrMasterKey. |
OT_ERROR_NONE | Successfully set the thrMasterKey. |
OT_ERROR_INVALID_ARGS | If aKeyLength is larger than 16. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
otError otThreadSetMeshLocalPrefix | ( | otInstance * | aInstance, |
const otMeshLocalPrefix * | aMeshLocalPrefix | ||
) |
This function sets the Mesh Local Prefix.
This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aMeshLocalPrefix | A pointer to the Mesh Local Prefix. |
OT_ERROR_NONE | Successfully set the Mesh Local Prefix. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
otError otThreadSetNetworkName | ( | otInstance * | aInstance, |
const char * | aNetworkName | ||
) |
Set the Thread Network Name.
This function succeeds only when Thread protocols are disabled. A successful call to this function invalidates the Active and Pending Operational Datasets in non-volatile memory.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aNetworkName | A pointer to the Thread Network Name. |
OT_ERROR_NONE | Successfully set the Thread Network Name. |
OT_ERROR_INVALID_STATE | Thread protocols are enabled. |
void otThreadSetReceiveDiagnosticGetCallback | ( | otInstance * | aInstance, |
otReceiveDiagnosticGetCallback | aCallback, | ||
void * | aCallbackContext | ||
) |
This function registers a callback to provide received raw Network Diagnostic Get response payload.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aCallback | A pointer to a function that is called when Network Diagnostic Get response is received or NULL to disable the callback. |
[in] | aCallbackContext | A pointer to application-specific context. |