nRF5 SDK for Thread v0.11.0
Typedefs | Functions
General

This module includes functions for all Thread roles. More...

Typedefs

typedef void(* otReceiveDiagnosticGetCallback )(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext)
 

Functions

OTAPI bool OTCALL otDatasetIsCommissioned (otInstance *aInstance)
 
OTAPI otError OTCALL otDatasetGetActive (otInstance *aInstance, otOperationalDataset *aDataset)
 
OTAPI otError OTCALL otDatasetGetPending (otInstance *aInstance, otOperationalDataset *aDataset)
 
OTAPI otError OTCALL otDatasetSetActive (otInstance *aInstance, const otOperationalDataset *aDataset)
 
OTAPI otError OTCALL otDatasetSetPending (otInstance *aInstance, const otOperationalDataset *aDataset)
 
OTAPI otError OTCALL otDatasetSendMgmtActiveGet (otInstance *aInstance, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress)
 
OTAPI otError OTCALL otDatasetSendMgmtActiveSet (otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength)
 
OTAPI otError OTCALL otDatasetSendMgmtPendingGet (otInstance *aInstance, const uint8_t *aTlvTypes, uint8_t aLength, const otIp6Address *aAddress)
 
OTAPI otError OTCALL otDatasetSendMgmtPendingSet (otInstance *aInstance, const otOperationalDataset *aDataset, const uint8_t *aTlvs, uint8_t aLength)
 
OTAPI uint32_t OTCALL otDatasetGetDelayTimerMinimal (otInstance *aInstance)
 
OTAPI otError OTCALL otDatasetSetDelayTimerMinimal (otInstance *aInstance, uint32_t aDelayTimerMinimal)
 
OTAPI otError OTCALL otNetDataGet (otInstance *aInstance, bool aStable, uint8_t *aData, uint8_t *aDataLength)
 
OTAPI otError OTCALL otNetDataGetNextOnMeshPrefix (otInstance *aInstance, otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig)
 
otError otNetDataGetNextRoute (otInstance *aInstance, otNetworkDataIterator *aIterator, otExternalRouteConfig *aConfig)
 
OTAPI uint8_t OTCALL otNetDataGetVersion (otInstance *aInstance)
 
OTAPI uint8_t OTCALL otNetDataGetStableVersion (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadSetEnabled (otInstance *aInstance, bool aEnabled)
 
OTAPI bool OTCALL otThreadGetAutoStart (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadSetAutoStart (otInstance *aInstance, bool aStartAutomatically)
 
OTAPI bool OTCALL otThreadIsSingleton (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadDiscover (otInstance *aInstance, uint32_t aScanChannels, uint16_t aPanId, bool aJoiner, bool aEnableEui64Filtering, otHandleActiveScanResult aCallback, void *aCallbackContext)
 
OTAPI bool OTCALL otThreadIsDiscoverInProgress (otInstance *aInstance)
 
OTAPI uint32_t OTCALL otThreadGetChildTimeout (otInstance *aInstance)
 
OTAPI void OTCALL otThreadSetChildTimeout (otInstance *aInstance, uint32_t aTimeout)
 
OTAPI const uint8_t *OTCALL otThreadGetExtendedPanId (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadSetExtendedPanId (otInstance *aInstance, const uint8_t *aExtendedPanId)
 
OTAPI otError OTCALL otThreadGetLeaderRloc (otInstance *aInstance, otIp6Address *aLeaderRloc)
 
OTAPI otLinkModeConfig OTCALL otThreadGetLinkMode (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadSetLinkMode (otInstance *aInstance, otLinkModeConfig aConfig)
 
OTAPI const otMasterKey *OTCALL otThreadGetMasterKey (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadSetMasterKey (otInstance *aInstance, const otMasterKey *aKey)
 
OTAPI const otIp6Address *OTCALL otThreadGetMeshLocalEid (otInstance *aInstance)
 
OTAPI const uint8_t *OTCALL otThreadGetMeshLocalPrefix (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadSetMeshLocalPrefix (otInstance *aInstance, const uint8_t *aMeshLocalPrefix)
 
const otIp6AddressotThreadGetLinkLocalIp6Address (otInstance *aInstance)
 
OTAPI const char *OTCALL otThreadGetNetworkName (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadSetNetworkName (otInstance *aInstance, const char *aNetworkName)
 
OTAPI uint32_t OTCALL otThreadGetKeySequenceCounter (otInstance *aInstance)
 
OTAPI void OTCALL otThreadSetKeySequenceCounter (otInstance *aInstance, uint32_t aKeySequenceCounter)
 
OTAPI uint32_t OTCALL otThreadGetKeySwitchGuardTime (otInstance *aInstance)
 
OTAPI void OTCALL otThreadSetKeySwitchGuardTime (otInstance *aInstance, uint32_t aKeySwitchGuardTime)
 
OTAPI otError OTCALL otThreadBecomeDetached (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadBecomeChild (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadGetNextNeighborInfo (otInstance *aInstance, otNeighborInfoIterator *aIterator, otNeighborInfo *aInfo)
 
OTAPI otDeviceRole OTCALL otThreadGetDeviceRole (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadGetLeaderData (otInstance *aInstance, otLeaderData *aLeaderData)
 
OTAPI uint8_t OTCALL otThreadGetLeaderRouterId (otInstance *aInstance)
 
OTAPI uint8_t OTCALL otThreadGetLeaderWeight (otInstance *aInstance)
 
OTAPI uint32_t OTCALL otThreadGetPartitionId (otInstance *aInstance)
 
OTAPI uint16_t OTCALL otThreadGetRloc16 (otInstance *aInstance)
 
OTAPI otError OTCALL otThreadGetParentInfo (otInstance *aInstance, otRouterInfo *aParentInfo)
 
OTAPI otError OTCALL otThreadGetParentAverageRssi (otInstance *aInstance, int8_t *aParentRssi)
 
OTAPI otError OTCALL otThreadGetParentLastRssi (otInstance *aInstance, int8_t *aLastRssi)
 
void otThreadSetReceiveDiagnosticGetCallback (otInstance *aInstance, otReceiveDiagnosticGetCallback aCallback, void *aCallbackContext)
 
OTAPI otError OTCALL otThreadSendDiagnosticGet (otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)
 
OTAPI otError OTCALL otThreadSendDiagnosticReset (otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)
 
OTAPI const otIpCounters *OTCALL otThreadGetIp6Counters (otInstance *aInstance)
 

Detailed Description

This module includes functions for all Thread roles.

Typedef Documentation

typedef void(* otReceiveDiagnosticGetCallback)(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext)

This function pointer is called when Network Diagnostic Get response is received.

Parameters
[in]aMessageA pointer to the message buffer containing the received Network Diagnostic Get response payload.
[in]aMessageInfoA pointer to the message info for aMessage.
[in]aContextA pointer to application-specific context.

Function Documentation

OTAPI otError OTCALL otDatasetGetActive ( otInstance aInstance,
otOperationalDataset aDataset 
)

This function gets the Active Operational Dataset.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aDatasetA pointer to where the Active Operational Dataset will be placed.
Return values
OT_ERROR_NONESuccessfully retrieved the Active Operational Dataset.
OT_ERROR_INVALID_ARGSaDataset was NULL.
OTAPI uint32_t OTCALL otDatasetGetDelayTimerMinimal ( otInstance aInstance)

Get minimal delay timer.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
thevalue of minimal delay timer (in ms).
OTAPI otError OTCALL otDatasetGetPending ( otInstance aInstance,
otOperationalDataset aDataset 
)

This function gets the Pending Operational Dataset.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aDatasetA pointer to where the Pending Operational Dataset will be placed.
Return values
OT_ERROR_NONESuccessfully retrieved the Pending Operational Dataset.
OT_ERROR_INVALID_ARGSaDataset was NULL.
OTAPI bool OTCALL otDatasetIsCommissioned ( otInstance aInstance)

This function indicates whether a valid network is present in the Active Operational Dataset or not.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
TRUE if a valid network is present in the Active Operational Dataset, FALSE otherwise.
OTAPI otError OTCALL otDatasetSendMgmtActiveGet ( otInstance aInstance,
const uint8_t *  aTlvTypes,
uint8_t  aLength,
const otIp6Address aAddress 
)

This function sends MGMT_ACTIVE_GET.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aTlvTypesA pointer to the TLV Types.
[in]aLengthThe length of TLV Types.
[in]aAddressA pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default.
Return values
OT_ERROR_NONESuccessfully send the meshcop dataset command.
OT_ERROR_NO_BUFSInsufficient 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDatasetA pointer to operational dataset.
[in]aTlvsA pointer to TLVs.
[in]aLengthThe length of TLVs.
Return values
OT_ERROR_NONESuccessfully send the meshcop dataset command.
OT_ERROR_NO_BUFSInsufficient 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aTlvTypesA pointer to the TLV Types.
[in]aLengthThe length of TLV Types.
[in]aAddressA pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default.
Return values
OT_ERROR_NONESuccessfully send the meshcop dataset command.
OT_ERROR_NO_BUFSInsufficient 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDatasetA pointer to operational dataset.
[in]aTlvsA pointer to TLVs.
[in]aLengthThe length of TLVs.
Return values
OT_ERROR_NONESuccessfully send the meshcop dataset command.
OT_ERROR_NO_BUFSInsufficient buffer space to send.
OTAPI otError OTCALL otDatasetSetActive ( otInstance aInstance,
const otOperationalDataset aDataset 
)

This function sets the Active Operational Dataset.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDatasetA pointer to the Active Operational Dataset.
Return values
OT_ERROR_NONESuccessfully set the Active Operational Dataset.
OT_ERROR_NO_BUFSInsufficient buffer space to set the Active Operational Datset.
OT_ERROR_INVALID_ARGSaDataset was NULL.
OTAPI otError OTCALL otDatasetSetDelayTimerMinimal ( otInstance aInstance,
uint32_t  aDelayTimerMinimal 
)

Set minimal delay timer.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDelayTimerMinimalThe value of minimal delay timer (in ms).
Return values
OT_ERROR_NONESuccessfully set minimal delay timer.
OT_ERROR_INVALID_ARGSIf aDelayTimerMinimal is not valid.
OTAPI otError OTCALL otDatasetSetPending ( otInstance aInstance,
const otOperationalDataset aDataset 
)

This function sets the Pending Operational Dataset.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDatasetA pointer to the Pending Operational Dataset.
Return values
OT_ERROR_NONESuccessfully set the Pending Operational Dataset.
OT_ERROR_NO_BUFSInsufficient buffer space to set the Pending Operational Dataset.
OT_ERROR_INVALID_ARGSaDataset 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aStableTRUE when copying the stable version, FALSE when copying the full version.
[out]aDataA pointer to the data buffer.
[in,out]aDataLengthOn 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in,out]aIteratorA 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]aConfigA pointer to where the On Mesh Prefix information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next On Mesh prefix.
OT_ERROR_NOT_FOUNDNo 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in,out]aIteratorA 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]aConfigA pointer to where the External Route information will be placed.
Return values
OT_ERROR_NONESuccessfully found the next External Route.
OT_ERROR_NOT_FOUNDNo subsequent external route entry exists in the Thread Network Data.
OTAPI uint8_t OTCALL otNetDataGetStableVersion ( otInstance aInstance)

Get the Stable Network Data Version.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Stable Network Data Version.
OTAPI uint8_t OTCALL otNetDataGetVersion ( otInstance aInstance)

Get the Network Data Version.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Network Data Version.
OTAPI otError OTCALL otThreadBecomeChild ( otInstance aInstance)

Attempt to reattach as a child.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
OT_ERROR_NONESuccessfully begin attempt to become a child.
OT_ERROR_INVALID_STATEThread is disabled.
OTAPI otError OTCALL otThreadBecomeDetached ( otInstance aInstance)

Detach from the Thread network.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
OT_ERROR_NONESuccessfully detached from the Thread network.
OT_ERROR_INVALID_STATEThread 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aScanChannelsA bit vector indicating which channels to scan (e.g. OT_CHANNEL_11_MASK).
[in]aPanIdThe PAN ID filter (set to Broadcast PAN to disable filter).
[in]aJoinerValue of the Joiner Flag in the Discovery Request TLV.
[in]aEnableEui64FilteringTRUE to filter responses on EUI-64, FALSE otherwise.
[in]aCallbackA pointer to a function called on receiving an MLE Discovery Response or scan completes.
[in]aCallbackContextA pointer to application-specific context.
Return values
OT_ERROR_NONEAccepted the Thread Discovery request.
OT_ERROR_BUSYAlready performing an Thread Discovery.
OTAPI bool OTCALL otThreadGetAutoStart ( otInstance aInstance)

This function queries if the Thread stack is configured to automatically start on reinitialization.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
TRUEIt is configured to automatically start.
FALSEIt 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Thread Child Timeout value.
See Also
otThreadSetChildTimeout
OTAPI otDeviceRole OTCALL otThreadGetDeviceRole ( otInstance aInstance)

Get the device role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
OT_DEVICE_ROLE_DISABLEDThe Thread stack is disabled.
OT_DEVICE_ROLE_DETACHEDThe device is not currently participating in a Thread network/partition.
OT_DEVICE_ROLE_CHILDThe device is currently operating as a Thread Child.
OT_DEVICE_ROLE_ROUTERThe device is currently operating as a Thread Router.
OT_DEVICE_ROLE_LEADERThe 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the IEEE 802.15.4 Extended PAN ID.
See Also
otThreadSetExtendedPanId
OTAPI const otIpCounters* OTCALL otThreadGetIp6Counters ( otInstance aInstance)

Get the IPv6 counters.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the IPv6 counters.
OTAPI uint32_t OTCALL otThreadGetKeySequenceCounter ( otInstance aInstance)

Get the thrKeySequenceCounter.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The thrKeySequenceCounter value.
See Also
otThreadSetKeySequenceCounter
OTAPI uint32_t OTCALL otThreadGetKeySwitchGuardTime ( otInstance aInstance)

Get the thrKeySwitchGuardTime

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The thrKeySwitchGuardTime value (in hours).
See Also
otThreadSetKeySwitchGuardTime
OTAPI otError OTCALL otThreadGetLeaderData ( otInstance aInstance,
otLeaderData aLeaderData 
)

This function get the Thread Leader Data.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aLeaderDataA pointer to where the leader data is placed.
Return values
OT_ERROR_NONESuccessfully retrieved the leader data.
OT_ERROR_DETACHEDNot currently attached.
OT_ERROR_INVALID_ARGSaLeaderData is NULL.
OTAPI otError OTCALL otThreadGetLeaderRloc ( otInstance aInstance,
otIp6Address aLeaderRloc 
)

This function returns a pointer to the Leader's RLOC.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aLeaderRlocA pointer to the Leader's RLOC.
Return values
OT_ERROR_NONEThe Leader's RLOC was successfully written to aLeaderRloc.
OT_ERROR_INVALID_ARGSaLeaderRloc was NULL.
OT_ERROR_DETACHEDNot currently attached to a Thread Partition.
OTAPI uint8_t OTCALL otThreadGetLeaderRouterId ( otInstance aInstance)

Get the Leader's Router ID.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Leader's Router ID.
OTAPI uint8_t OTCALL otThreadGetLeaderWeight ( otInstance aInstance)

Get the Leader's Weight.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Leader's Weight.
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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to Thread link-local IPv6 address.
OTAPI otLinkModeConfig OTCALL otThreadGetLinkMode ( otInstance aInstance)

Get the MLE Link Mode configuration.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The MLE Link Mode configuration.
See Also
otThreadSetLinkMode
OTAPI const otMasterKey* OTCALL otThreadGetMasterKey ( otInstance aInstance)

Get the thrMasterKey.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to a buffer containing the thrMasterKey.
See Also
otThreadSetMasterKey
OTAPI const otIp6Address* OTCALL otThreadGetMeshLocalEid ( otInstance aInstance)

This function returns a pointer to the Mesh Local EID.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the Mesh Local EID.
OTAPI const uint8_t* OTCALL otThreadGetMeshLocalPrefix ( otInstance aInstance)

This function returns a pointer to the Mesh Local Prefix.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the Mesh Local Prefix.
OTAPI const char* OTCALL otThreadGetNetworkName ( otInstance aInstance)

Get the Thread Network Name.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
A pointer to the Thread Network Name.
See Also
otThreadSetNetworkName
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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in,out]aIteratorA pointer to the iterator context. To get the first neighbor entry it should be set to OT_NEIGHBOR_INFO_ITERATOR_INIT.
[out]aInfoA pointer to the neighbor information.
Return values
OT_ERROR_NONESuccessfully found the next neighbor entry in table.
OT_ERROR_NOT_FOUNDNo subsequent neighbor entry exists in the table.
OT_ERROR_INVALID_ARGSaIterator or aInfo was NULL.
OTAPI otError OTCALL otThreadGetParentAverageRssi ( otInstance aInstance,
int8_t *  aParentRssi 
)

The function retrieves the average RSSI for the Thread Parent.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aParentRssiA 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aParentInfoA 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[out]aLastRssiA pointer to where the last rssi should be placed.
Return values
OT_ERROR_NONESuccessfully retrieved the RSSI data.
OT_ERROR_FAILEDUnable to get RSSI data.
OT_ERROR_INVALID_ARGSaLastRssi is NULL.
OTAPI uint32_t OTCALL otThreadGetPartitionId ( otInstance aInstance)

Get the Partition ID.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Partition ID.
OTAPI uint16_t OTCALL otThreadGetRloc16 ( otInstance aInstance)

Get the RLOC16.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The RLOC16.
OTAPI bool OTCALL otThreadIsDiscoverInProgress ( otInstance aInstance)

This function determines if an MLE Thread Discovery is currently in progress.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
OTAPI bool OTCALL otThreadIsSingleton ( otInstance aInstance)

This function indicates whether a node is the only router on the network.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
TRUEIt is the only router in the network.
FALSEIt 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDestinationA pointer to destination address.
[in]aTlvTypesAn array of Network Diagnostic TLV types.
[in]aCountNumber 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aDestinationA pointer to destination address.
[in]aTlvTypesAn array of Network Diagnostic TLV types. Currently only Type 9 is allowed.
[in]aCountNumber 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aStartAutomaticallyTRUE 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aTimeoutThe timeout value.
See Also
otThreadSetChildTimeout
OTAPI otError OTCALL otThreadSetEnabled ( otInstance aInstance,
bool  aEnabled 
)

This function starts Thread protocol operation.

The interface must be up when calling this function.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aEnabledTRUE if Thread is enabled, FALSE otherwise.
Return values
OT_ERROR_NONESuccessfully started Thread protocol operation.
OT_ERROR_INVALID_STATEThe 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aExtendedPanIdA pointer to the IEEE 802.15.4 Extended PAN ID.
Return values
OT_ERROR_NONESuccessfully set the Extended PAN ID.
OT_ERROR_INVALID_STATEThread protocols are enabled.
See Also
otThreadGetExtendedPanId
OTAPI void OTCALL otThreadSetKeySequenceCounter ( otInstance aInstance,
uint32_t  aKeySequenceCounter 
)

Set the thrKeySequenceCounter.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aKeySequenceCounterThe thrKeySequenceCounter value.
See Also
otThreadGetKeySequenceCounter
OTAPI void OTCALL otThreadSetKeySwitchGuardTime ( otInstance aInstance,
uint32_t  aKeySwitchGuardTime 
)

Set the thrKeySwitchGuardTime

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aKeySwitchGuardTimeThe thrKeySwitchGuardTime value (in hours).
See Also
otThreadGetKeySwitchGuardTime
OTAPI otError OTCALL otThreadSetLinkMode ( otInstance aInstance,
otLinkModeConfig  aConfig 
)

Set the MLE Link Mode configuration.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aConfigA pointer to the Link Mode configuration.
Return values
OT_ERROR_NONESuccessfully set the MLE Link Mode configuration.
See Also
otThreadGetLinkMode
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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aKeyA pointer to a buffer containing the thrMasterKey.
Return values
OT_ERROR_NONESuccessfully set the thrMasterKey.
OT_ERROR_INVALID_ARGSIf aKeyLength is larger than 16.
OT_ERROR_INVALID_STATEThread protocols are enabled.
See Also
otThreadGetMasterKey
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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aMeshLocalPrefixA pointer to the Mesh Local Prefix.
Return values
OT_ERROR_NONESuccessfully set the Mesh Local Prefix.
OT_ERROR_INVALID_STATEThread 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.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aNetworkNameA pointer to the Thread Network Name.
Return values
OT_ERROR_NONESuccessfully set the Thread Network Name.
OT_ERROR_INVALID_STATEThread protocols are enabled.
See Also
otThreadGetNetworkName
void otThreadSetReceiveDiagnosticGetCallback ( otInstance aInstance,
otReceiveDiagnosticGetCallback  aCallback,
void *  aCallbackContext 
)

This function registers a callback to provide received raw Network Diagnostic Get response payload.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aCallbackA pointer to a function that is called when Network Diagnostic Get response is received or NULL to disable the callback.
[in]aCallbackContextA pointer to application-specific context.

Documentation feedback | Developer Zone | Subscribe | Updated