Mesh Diagnostics
This module includes definitions and functions for Mesh Diagnostics.
Summary
The Mesh Diagnostics APIs require OPENTHREAD_CONFIG_MESH_DIAG_ENABLE
and OPENTHREAD_FTD
.
Typedefs |
|
---|---|
otMeshDiagChildEntry
|
typedefstruct otMeshDiagChildEntry
Represents information about a child entry from otMeshDiagQueryChildTable() . |
otMeshDiagChildInfo
|
typedefstruct otMeshDiagChildInfo
Represents information about a discovered child in Thread mesh using otMeshDiagDiscoverTopology() . |
otMeshDiagChildIp6AddrsCallback)(otError aError, uint16_t aChildRloc16, otMeshDiagIp6AddrIterator *aIp6AddrIterator, void *aContext)
|
typedefvoid(*
Represents the callback used by otMeshDiagQueryChildrenIp6Addrs() to provide information about an MTD child and its list of IPv6 addresses. |
otMeshDiagChildIterator
|
typedefstruct otMeshDiagChildIterator
An opaque iterator to iterate over list of children of a router. |
otMeshDiagDiscoverCallback)(otError aError, otMeshDiagRouterInfo *aRouterInfo, void *aContext)
|
typedefvoid(*
Pointer type represents the callback used by otMeshDiagDiscoverTopology() to provide information about a discovered router. |
otMeshDiagDiscoverConfig
|
typedefstruct otMeshDiagDiscoverConfig
Represents the set of configurations used when discovering mesh topology indicating which items to discover. |
otMeshDiagIp6AddrIterator
|
typedefstruct otMeshDiagIp6AddrIterator
An opaque iterator to iterate over list of IPv6 addresses of a router. |
otMeshDiagQueryChildTableCallback)(otError aError, const otMeshDiagChildEntry *aChildEntry, void *aContext)
|
typedefvoid(*
Represents the callback used by otMeshDiagQueryChildTable() to provide information about child table entries. |
otMeshDiagQueryRouterNeighborTableCallback)(otError aError, const otMeshDiagRouterNeighborEntry *aNeighborEntry, void *aContext)
|
typedefvoid(*
Represents the callback used by otMeshDiagQueryRouterNeighborTable() to provide information about neighbor router table entries. |
otMeshDiagRouterInfo
|
typedefstruct otMeshDiagRouterInfo
Represents information about a router in Thread mesh discovered using otMeshDiagDiscoverTopology() . |
otMeshDiagRouterNeighborEntry
|
typedef Represents information about a router neighbor entry from otMeshDiagQueryRouterNeighborTable() . |
Functions |
|
---|---|
otMeshDiagCancel(otInstance *aInstance)
|
void
Cancels an ongoing topology discovery if there is one, otherwise no action.
|
otMeshDiagDiscoverTopology(otInstance *aInstance, const otMeshDiagDiscoverConfig *aConfig, otMeshDiagDiscoverCallback aCallback, void *aContext)
|
Starts network topology discovery.
|
otMeshDiagGetNextChildInfo(otMeshDiagChildIterator *aIterator, otMeshDiagChildInfo *aChildInfo)
|
Iterates through the discovered children of a router.
|
otMeshDiagGetNextIp6Address(otMeshDiagIp6AddrIterator *aIterator, otIp6Address *aIp6Address)
|
Iterates through the discovered IPv6 addresses of a router or an MTD child.
|
otMeshDiagQueryChildTable(otInstance *aInstance, uint16_t aRloc16, otMeshDiagQueryChildTableCallback aCallback, void *aContext)
|
Starts query for child table for a given router.
|
otMeshDiagQueryChildrenIp6Addrs(otInstance *aInstance, uint16_t aRloc16, otMeshDiagChildIp6AddrsCallback aCallback, void *aContext)
|
Sends a query to a parent to retrieve the IPv6 addresses of all its MTD children.
|
otMeshDiagQueryRouterNeighborTable(otInstance *aInstance, uint16_t aRloc16, otMeshDiagQueryRouterNeighborTableCallback aCallback, void *aContext)
|
Starts query for router neighbor table for a given router.
|
Macros |
|
---|---|
OT_MESH_DIAG_VERSION_UNKNOWN 0xffff
|
Specifies that Thread Version is unknown.
|
Structs |
|
---|---|
otMeshDiagChildEntry |
Represents information about a child entry from |
otMeshDiagChildInfo |
Represents information about a discovered child in Thread mesh using |
otMeshDiagDiscoverConfig |
Represents the set of configurations used when discovering mesh topology indicating which items to discover. |
otMeshDiagRouterInfo |
Represents information about a router in Thread mesh discovered using |
otMeshDiagRouterNeighborEntry |
Represents information about a router neighbor entry from |
Typedefs
otMeshDiagChildEntry
struct otMeshDiagChildEntry otMeshDiagChildEntry
Represents information about a child entry from otMeshDiagQueryChildTable()
.
mSupportsErrRate
indicates whether or not the error tracking feature is supported and mFrameErrorRate
and mMessageErrorRate
values are valid. The frame error rate tracks frame tx errors (towards the child) at MAC layer, while mMessageErrorRate
tracks the IPv6 message error rate (above MAC layer and after MAC retries) when an IPv6 message is dropped. For example, if the message is large and requires 6LoWPAN fragmentation, message tx is considered as failed if one of its fragment frame tx fails (for example, never acked).
otMeshDiagChildInfo
struct otMeshDiagChildInfo otMeshDiagChildInfo
Represents information about a discovered child in Thread mesh using otMeshDiagDiscoverTopology()
.
otMeshDiagChildIp6AddrsCallback
void(* otMeshDiagChildIp6AddrsCallback)(otError aError, uint16_t aChildRloc16, otMeshDiagIp6AddrIterator *aIp6AddrIterator, void *aContext)
Represents the callback used by otMeshDiagQueryChildrenIp6Addrs()
to provide information about an MTD child and its list of IPv6 addresses.
When aError
is OT_ERROR_PENDING
, it indicates that there are more children and the callback will be invoked again.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
otMeshDiagChildIterator
struct otMeshDiagChildIterator otMeshDiagChildIterator
An opaque iterator to iterate over list of children of a router.
Pointers to instance of this type are provided in otMeshDiagRouterInfo
.
otMeshDiagDiscoverCallback
void(* otMeshDiagDiscoverCallback)(otError aError, otMeshDiagRouterInfo *aRouterInfo, void *aContext)
Pointer type represents the callback used by otMeshDiagDiscoverTopology()
to provide information about a discovered router.
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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otMeshDiagDiscoverConfig
struct otMeshDiagDiscoverConfig otMeshDiagDiscoverConfig
Represents the set of configurations used when discovering mesh topology indicating which items to discover.
otMeshDiagIp6AddrIterator
struct otMeshDiagIp6AddrIterator otMeshDiagIp6AddrIterator
An opaque iterator to iterate over list of IPv6 addresses of a router.
Pointers to instance of this type are provided in otMeshDiagRouterInfo
.
otMeshDiagQueryChildTableCallback
void(* otMeshDiagQueryChildTableCallback)(otError aError, const otMeshDiagChildEntry *aChildEntry, void *aContext)
Represents the callback used by otMeshDiagQueryChildTable()
to provide information about child table entries.
When aError
is OT_ERROR_PENDING
, it indicates that the table still has more entries and the callback will be invoked again.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otMeshDiagQueryRouterNeighborTableCallback
void(* otMeshDiagQueryRouterNeighborTableCallback)(otError aError, const otMeshDiagRouterNeighborEntry *aNeighborEntry, void *aContext)
Represents the callback used by otMeshDiagQueryRouterNeighborTable()
to provide information about neighbor router table entries.
When aError
is OT_ERROR_PENDING
, it indicates that the table still has more entries and the callback will be invoked again.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otMeshDiagRouterInfo
struct otMeshDiagRouterInfo otMeshDiagRouterInfo
Represents information about a router in Thread mesh discovered using otMeshDiagDiscoverTopology()
.
otMeshDiagRouterNeighborEntry
struct otMeshDiagRouterNeighborEntry otMeshDiagRouterNeighborEntry
Represents information about a router neighbor entry from otMeshDiagQueryRouterNeighborTable()
.
mSupportsErrRate
indicates whether or not the error tracking feature is supported and mFrameErrorRate
and mMessageErrorRate
values are valid. The frame error rate tracks frame tx errors (towards the child) at MAC layer, while mMessageErrorRate
tracks the IPv6 message error rate (above MAC layer and after MAC retries) when an IPv6 message is dropped. For example, if the message is large and requires 6LoWPAN fragmentation, message tx is considered as failed if one of its fragment frame tx fails (for example, never acked).
Functions
otMeshDiagCancel
void otMeshDiagCancel( otInstance *aInstance )
Cancels an ongoing topology discovery if there is one, otherwise no action.
When ongoing discovery is cancelled, the callback from otMeshDiagDiscoverTopology()
will not be called anymore.
otMeshDiagDiscoverTopology
otError otMeshDiagDiscoverTopology( otInstance *aInstance, const otMeshDiagDiscoverConfig *aConfig, otMeshDiagDiscoverCallback aCallback, void *aContext )
Starts network topology discovery.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
otMeshDiagGetNextChildInfo
otError otMeshDiagGetNextChildInfo( otMeshDiagChildIterator *aIterator, otMeshDiagChildInfo *aChildInfo )
Iterates through the discovered children of a router.
This function MUST be used from the callback otMeshDiagDiscoverCallback()
and use the mChildIterator
from the aRouterInfo
struct that is provided as input to the callback.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otMeshDiagGetNextIp6Address
otError otMeshDiagGetNextIp6Address( otMeshDiagIp6AddrIterator *aIterator, otIp6Address *aIp6Address )
Iterates through the discovered IPv6 addresses of a router or an MTD child.
MUST be used
- from the callback
otMeshDiagDiscoverCallback()
and use themIp6AddrIterator
from theaRouterInfo
struct that is provided as input to the callback, or - from the callback
otMeshDiagChildIp6AddrsCallback()
along with providedaIp6AddrIterator
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otMeshDiagQueryChildTable
otError otMeshDiagQueryChildTable( otInstance *aInstance, uint16_t aRloc16, otMeshDiagQueryChildTableCallback aCallback, void *aContext )
Starts query for child table for a given router.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otMeshDiagQueryChildrenIp6Addrs
otError otMeshDiagQueryChildrenIp6Addrs( otInstance *aInstance, uint16_t aRloc16, otMeshDiagChildIp6AddrsCallback aCallback, void *aContext )
Sends a query to a parent to retrieve the IPv6 addresses of all its MTD children.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
otMeshDiagQueryRouterNeighborTable
otError otMeshDiagQueryRouterNeighborTable( otInstance *aInstance, uint16_t aRloc16, otMeshDiagQueryRouterNeighborTableCallback aCallback, void *aContext )
Starts query for router neighbor table for a given router.
Details | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||
Return Values |
|
Macros
OT_MESH_DIAG_VERSION_UNKNOWN
OT_MESH_DIAG_VERSION_UNKNOWN 0xffff
Specifies that Thread Version is unknown.
This is used in otMeshDiagRouterInfo
for mVersion
property when device does not provide its version. This indicates that device is likely running 1.3.0 (version value 4) or earlier.
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.