This module includes functions for all Thread roles. More...
Typedefs | |
typedef void(* | otReceiveDiagnosticGetCallback )(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext) |
This module includes functions for all Thread roles.
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. |
OTAPI otError OTCALL 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. |
OTAPI uint32_t OTCALL otDatasetGetDelayTimerMinimal | ( | otInstance * | aInstance | ) |
Get minimal delay timer.
[in] | aInstance | A pointer to an OpenThread instance. |
the | value of minimal delay timer (in ms). |
OTAPI otError OTCALL 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. |
OTAPI bool OTCALL 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. |
OTAPI otError OTCALL otDatasetSendMgmtActiveGet | ( | otInstance * | aInstance, |
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] | aTlvTypes | A pointer to the TLV Types. |
[in] | aLength | The length of TLV Types. |
[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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL otDatasetSendMgmtPendingGet | ( | otInstance * | aInstance, |
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] | aTlvTypes | A pointer to the TLV Types. |
[in] | aLength | The length of TLV Types. |
[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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL otDatasetSetActive | ( | otInstance * | aInstance, |
const otOperationalDataset * | aDataset | ||
) |
This function sets the Active Operational 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 Datset. |
OT_ERROR_INVALID_ARGS | aDataset was NULL. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL otNetDataGet | ( | otInstance * | aInstance, |
bool | aStable, | ||
uint8_t * | aData, | ||
uint8_t * | aDataLength | ||
) |
This method provides a full or stable copy of the Leader'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. |
OTAPI otError OTCALL 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. |
OTAPI uint8_t OTCALL otNetDataGetStableVersion | ( | otInstance * | aInstance | ) |
Get the Stable Network Data Version.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL otNetDataGetVersion | ( | otInstance * | aInstance | ) |
Get the Network Data Version.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI bool OTCALL otThreadGetAutoStart | ( | otInstance * | aInstance | ) |
This function queries if the Thread stack is configured to automatically start on reinitialization.
[in] | aInstance | A pointer to an OpenThread instance. |
TRUE | It is configured to automatically start. |
FALSE | It is not configured to automatically start. |
OTAPI uint32_t OTCALL otThreadGetChildTimeout | ( | otInstance * | aInstance | ) |
Get the Thread Child Timeout used when operating in the Child role.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otDeviceRole OTCALL 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. |
OTAPI const uint8_t* OTCALL otThreadGetExtendedPanId | ( | otInstance * | aInstance | ) |
Get the IEEE 802.15.4 Extended PAN ID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const otIpCounters* OTCALL otThreadGetIp6Counters | ( | otInstance * | aInstance | ) |
Get the IPv6 counters.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint32_t OTCALL otThreadGetKeySequenceCounter | ( | otInstance * | aInstance | ) |
Get the thrKeySequenceCounter.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint32_t OTCALL otThreadGetKeySwitchGuardTime | ( | otInstance * | aInstance | ) |
Get the thrKeySwitchGuardTime
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otError OTCALL 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. |
OT_ERROR_INVALID_ARGS | aLeaderData is NULL. |
OTAPI otError OTCALL 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. |
OTAPI uint8_t OTCALL otThreadGetLeaderRouterId | ( | otInstance * | aInstance | ) |
Get the Leader's Router ID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint8_t OTCALL 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. |
OTAPI otLinkModeConfig OTCALL otThreadGetLinkMode | ( | otInstance * | aInstance | ) |
Get the MLE Link Mode configuration.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const otMasterKey* OTCALL otThreadGetMasterKey | ( | otInstance * | aInstance | ) |
Get the thrMasterKey.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const otIp6Address* OTCALL otThreadGetMeshLocalEid | ( | otInstance * | aInstance | ) |
This function returns a pointer to the Mesh Local EID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const uint8_t* OTCALL otThreadGetMeshLocalPrefix | ( | otInstance * | aInstance | ) |
This function returns a pointer to the Mesh Local Prefix.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI const char* OTCALL otThreadGetNetworkName | ( | otInstance * | aInstance | ) |
Get the Thread Network Name.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI uint32_t OTCALL otThreadGetPartitionId | ( | otInstance * | aInstance | ) |
Get the Partition ID.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI uint16_t OTCALL otThreadGetRloc16 | ( | otInstance * | aInstance | ) |
Get the RLOC16.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL otThreadIsDiscoverInProgress | ( | otInstance * | aInstance | ) |
This function determines if an MLE Thread Discovery is currently in progress.
[in] | aInstance | A pointer to an OpenThread instance. |
OTAPI bool OTCALL 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. |
OTAPI otError OTCALL 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 |
OTAPI otError OTCALL 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 |
OTAPI otError OTCALL otThreadSetAutoStart | ( | otInstance * | aInstance, |
bool | aStartAutomatically | ||
) |
This function configures the Thread stack to automatically start on reinitialization. It has no effect on the current Thread state.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aStartAutomatically | TRUE to automatically start; FALSE to not automatically start. |
OTAPI void OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL otThreadSetExtendedPanId | ( | otInstance * | aInstance, |
const uint8_t * | 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. |
OTAPI void OTCALL otThreadSetKeySequenceCounter | ( | otInstance * | aInstance, |
uint32_t | aKeySequenceCounter | ||
) |
Set the thrKeySequenceCounter.
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aKeySequenceCounter | The thrKeySequenceCounter value. |
OTAPI void OTCALL otThreadSetKeySwitchGuardTime | ( | otInstance * | aInstance, |
uint32_t | aKeySwitchGuardTime | ||
) |
Set the thrKeySwitchGuardTime
[in] | aInstance | A pointer to an OpenThread instance. |
[in] | aKeySwitchGuardTime | The thrKeySwitchGuardTime value (in hours). |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL 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. |
OTAPI otError OTCALL otThreadSetMeshLocalPrefix | ( | otInstance * | aInstance, |
const uint8_t * | 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. |
OTAPI otError OTCALL 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. |