Modules#

otMeshDiagDiscoverConfig

otMeshDiagRouterInfo

otMeshDiagChildInfo

Mesh Diagnostics#

This module includes definitions and functions for Mesh Diagnostics.

The Mesh Diagnostics APIs require OPENTHREAD_CONFIG_MESH_DIAG_ENABLE and OPENTHREAD_FTD.

Typedefs#

This structure represents the set of configurations used when discovering mesh topology indicating which items to discover.

This type is an opaque iterator to iterate over list of IPv6 addresses of a router.

This type is an opaque iterator to iterate over list of children of a router.

typedef struct otMeshDiagRouterInfo

This type represents information about a router in Thread mesh.

typedef struct otMeshDiagChildInfo

This type represents information about a discovered child in Thread mesh.

typedef void(*
otMeshDiagDiscoverCallback)(otError aError, otMeshDiagRouterInfo *aRouterInfo, void *aContext)

This function pointer type represents the callback used by otMeshDiagDiscoverTopology() to provide information about a discovered router.

Functions#

otMeshDiagDiscoverTopology(otInstance *aInstance, const otMeshDiagDiscoverConfig *aConfig, otMeshDiagDiscoverCallback aCallback, void *aContext)

This function starts network topology discovery.

void
otMeshDiagCancel(otInstance *aInstance)

This function cancels an ongoing topology discovery if there is one, otherwise no action.

otMeshDiagGetNextIp6Address(otMeshDiagIp6AddrIterator *aIterator, otIp6Address *aIp6Address)

This function iterates through the discovered IPv6 address of a router.

otMeshDiagGetNextChildInfo(otMeshDiagChildIterator *aIterator, otMeshDiagChildInfo *aChildInfo)

This function iterates through the discovered children of a router.

Macros#

#define
OT_MESH_DIAG_VERSION_UNKNOWN 0xffff

This constant indicates that Thread Version is unknown.

Typedef Documentation#

otMeshDiagDiscoverConfig#

typedef struct otMeshDiagDiscoverConfig otMeshDiagDiscoverConfig

This structure represents the set of configurations used when discovering mesh topology indicating which items to discover.


otMeshDiagIp6AddrIterator#

typedef struct otMeshDiagIp6AddrIterator otMeshDiagIp6AddrIterator

This type is an opaque iterator to iterate over list of IPv6 addresses of a router.

Pointers to instance of this type are provided in otMeshDiagRouterInfo.


otMeshDiagChildIterator#

typedef struct otMeshDiagChildIterator otMeshDiagChildIterator

This type is an opaque iterator to iterate over list of children of a router.

Pointers to instance of this type are provided in otMeshDiagRouterInfo.


otMeshDiagRouterInfo#

typedef struct otMeshDiagRouterInfo otMeshDiagRouterInfo

This type represents information about a router in Thread mesh.


otMeshDiagChildInfo#

typedef struct otMeshDiagChildInfo otMeshDiagChildInfo

This type represents information about a discovered child in Thread mesh.


otMeshDiagDiscoverCallback#

typedef void(* otMeshDiagDiscoverCallback) (otError aError, otMeshDiagRouterInfo *aRouterInfo, void *aContext) )(otError aError, otMeshDiagRouterInfo *aRouterInfo, void *aContext)

This function pointer type represents the callback used by otMeshDiagDiscoverTopology() to provide information about a discovered router.

Parameters
TypeDirectionArgument NameDescription
[in]aError

OT_ERROR_PENDING Indicates there are more routers to be discovered. OT_ERROR_NONE Indicates this is the last router and mesh discovery is done. OT_ERROR_RESPONSE_TIMEOUT Timed out waiting for response from one or more routers.

[in]aRouterInfo

The discovered router info (can be null if aError is OT_ERROR_RESPONSE_TIMEOUT).

[in]aContext

Application-specific context.

When aError is OT_ERROR_PENDING, it indicates that the discovery is not yet finished and there will be more routers to discover and the callback will be invoked again.


Function Documentation#

otMeshDiagDiscoverTopology#

otError otMeshDiagDiscoverTopology (otInstance * aInstance, const otMeshDiagDiscoverConfig * aConfig, otMeshDiagDiscoverCallback aCallback, void * aContext)

This function starts network topology discovery.

Parameters
TypeDirectionArgument NameDescription
otInstance *[in]aInstance

The OpenThread instance.

const otMeshDiagDiscoverConfig *[in]aConfig

The configuration to use for discovery (e.g., which items to discover).

otMeshDiagDiscoverCallback[in]aCallback

The callback to report the discovered routers.

void *[in]aContext

A context to pass in aCallback.


otMeshDiagCancel#

void otMeshDiagCancel (otInstance * aInstance)

This function cancels an ongoing topology discovery if there is one, otherwise no action.

Parameters
TypeDirectionArgument NameDescription
otInstance *N/AaInstance

When ongoing discovery is cancelled, the callback from otMeshDiagDiscoverTopology() will not be called anymore.


otMeshDiagGetNextIp6Address#

otError otMeshDiagGetNextIp6Address (otMeshDiagIp6AddrIterator * aIterator, otIp6Address * aIp6Address)

This function iterates through the discovered IPv6 address of a router.

Parameters
TypeDirectionArgument NameDescription
otMeshDiagIp6AddrIterator *[inout]aIterator

The address iterator to use.

otIp6Address *[out]aIp6Address

A pointer to return the next IPv6 address (if any).


otMeshDiagGetNextChildInfo#

otError otMeshDiagGetNextChildInfo (otMeshDiagChildIterator * aIterator, otMeshDiagChildInfo * aChildInfo)

This function iterates through the discovered children of a router.

Parameters
TypeDirectionArgument NameDescription
otMeshDiagChildIterator *[inout]aIterator

The address iterator to use.

otMeshDiagChildInfo *[out]aChildInfo

A pointer to return the child info (if any).