nRF5 SDK for Thread v0.9.0
Data Structures | Macros | Typedefs | Enumerations | Functions
Diagnostics

This module includes functions that expose internal state. More...

Data Structures

struct  otNeighborInfo
 
struct  otChildInfo
 
struct  otRouterInfo
 
struct  otEidCacheEntry
 
struct  otLeaderData
 
struct  otMacCounters
 
struct  otBufferInfo
 

Macros

#define OT_NEIGHBOR_INFO_ITERATOR_INIT   0
 Initializer for otNeighborInfoIterator.
 

Typedefs

typedef void(* otReceiveDiagnosticGetCallback )(otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext)
 
typedef int16_t otNeighborInfoIterator
 Used to iterate through neighbor table.
 
typedef struct otEidCacheEntry otEidCacheEntry
 
typedef struct otLeaderData otLeaderData
 
typedef struct otMacCounters otMacCounters
 
typedef struct otBufferInfo otBufferInfo
 

Enumerations

enum  otDeviceRole {
  kDeviceRoleOffline, kDeviceRoleDisabled, kDeviceRoleDetached, kDeviceRoleChild,
  kDeviceRoleRouter, kDeviceRoleLeader
}
 

Functions

OTAPI ThreadError OTCALL otThreadGetChildInfoById (otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo)
 
OTAPI ThreadError OTCALL otThreadGetChildInfoByIndex (otInstance *aInstance, uint8_t aChildIndex, otChildInfo *aChildInfo)
 
OTAPI ThreadError OTCALL otThreadGetNextNeighborInfo (otInstance *aInstance, otNeighborInfoIterator *aIterator, otNeighborInfo *aInfo)
 
OTAPI otDeviceRole OTCALL otThreadGetDeviceRole (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otThreadGetEidCacheEntry (otInstance *aInstance, uint8_t aIndex, otEidCacheEntry *aEntry)
 
OTAPI ThreadError 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 uint8_t OTCALL otThreadGetRouterIdSequence (otInstance *aInstance)
 
OTAPI ThreadError OTCALL otThreadGetRouterInfo (otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo)
 
OTAPI ThreadError OTCALL otThreadGetParentInfo (otInstance *aInstance, otRouterInfo *aParentInfo)
 
OTAPI ThreadError OTCALL otThreadGetParentAverageRssi (otInstance *aInstance, int8_t *aParentRssi)
 
OTAPI ThreadError OTCALL otThreadGetParentLastRssi (otInstance *aInstance, int8_t *aLastRssi)
 
void otThreadSetReceiveDiagnosticGetCallback (otInstance *aInstance, otReceiveDiagnosticGetCallback aCallback, void *aCallbackContext)
 
OTAPI ThreadError OTCALL otThreadSendDiagnosticGet (otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)
 
OTAPI ThreadError OTCALL otThreadSendDiagnosticReset (otInstance *aInstance, const otIp6Address *aDestination, const uint8_t aTlvTypes[], uint8_t aCount)
 

Detailed Description

This module includes functions that expose internal state.

Typedef Documentation

typedef struct otBufferInfo otBufferInfo

This structure represents the message buffer information.

This structure represents an EID cache entry.

typedef struct otLeaderData otLeaderData

This structure represents the Thread Leader Data.

typedef struct otMacCounters otMacCounters

This structure represents the MAC layer counters.

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.

Enumeration Type Documentation

Represents a Thread device role.

Enumerator
kDeviceRoleOffline 

The Thread device is offline and unavailable.

kDeviceRoleDisabled 

The Thread stack is disabled.

kDeviceRoleDetached 

Not currently participating in a Thread network/partition.

kDeviceRoleChild 

The Thread Child role.

kDeviceRoleRouter 

The Thread Router role.

kDeviceRoleLeader 

The Thread Leader role.

Function Documentation

OTAPI ThreadError OTCALL otThreadGetChildInfoById ( otInstance *  aInstance,
uint16_t  aChildId,
otChildInfo aChildInfo 
)

The function retains diagnostic information for an attached Child by its Child ID or RLOC16.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aChildIdThe Child ID or RLOC16 for the attached child.
[out]aChildInfoA pointer to where the child information is placed.

kThreadError_None aChildInfo was successfully updated with the info for the given ID.

Return values
kThreadError_NotFoundNo valid child with this Child ID. kThreadError_InvalidArgs If aChildInfo is NULL.
OTAPI ThreadError OTCALL otThreadGetChildInfoByIndex ( otInstance *  aInstance,
uint8_t  aChildIndex,
otChildInfo aChildInfo 
)

The function retains diagnostic information for an attached Child by the internal table index.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aChildIndexThe table index.
[out]aChildInfoA pointer to where the child information is placed.

kThreadError_None aChildInfo was successfully updated with the info for the given index.

Return values
kThreadError_NotFoundNo valid child at this index. kThreadError_InvalidArgs Either aChildInfo is NULL, or aChildIndex is out of range (higher than max table index).
See Also
otGetMaxAllowedChildren
OTAPI otDeviceRole OTCALL otThreadGetDeviceRole ( otInstance *  aInstance)

Get the device role.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Return values
kDeviceRoleDisabledThe Thread stack is disabled.
kDeviceRoleDetachedThe device is not currently participating in a Thread network/partition.
kDeviceRoleChildThe device is currently operating as a Thread Child.
kDeviceRoleRouterThe device is currently operating as a Thread Router.
kDeviceRoleLeaderThe device is currently operating as a Thread Leader.
OTAPI ThreadError OTCALL otThreadGetEidCacheEntry ( otInstance *  aInstance,
uint8_t  aIndex,
otEidCacheEntry aEntry 
)

This function gets an EID cache entry.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aIndexAn index into the EID cache table.
[out]aEntryA pointer to where the EID information is placed.
Return values
kThreadError_NoneSuccessfully retrieved the EID cache entry.
kThreadError_InvalidArgsaIndex was out of bounds or aEntry was NULL.
OTAPI ThreadError 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
kThreadError_NoneSuccessfully retrieved the leader data.
kThreadError_DetachedNot currently attached.
kThreadError_InvalidArgsaLeaderData is NULL.
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.
OTAPI ThreadError 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 where the neighbor information will be placed.
Return values
kThreadError_NoneSuccessfully found the next neighbor entry in table.
kThreadError_NotFoundNo subsequent neighbor entry exists in the table.
kThreadError_InvalidArgsaIterator or aInfo was NULL.
OTAPI ThreadError 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 ThreadError 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 ThreadError 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
kThreadError_NoneSuccessfully retrieved the RSSI data.
kThreadError_FailedUnable to get RSSI data.
kThreadError_InvalidArgsaLastRssi 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 uint8_t OTCALL otThreadGetRouterIdSequence ( otInstance *  aInstance)

Get the current Router ID Sequence.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
Returns
The Router ID Sequence.
OTAPI ThreadError OTCALL otThreadGetRouterInfo ( otInstance *  aInstance,
uint16_t  aRouterId,
otRouterInfo aRouterInfo 
)

The function retains diagnostic information for a given Thread Router.

Parameters
[in]aInstanceA pointer to an OpenThread instance.
[in]aRouterIdThe router ID or RLOC16 for a given router.
[out]aRouterInfoA pointer to where the router information is placed.
OTAPI ThreadError OTCALL otThreadSendDiagnosticGet ( otInstance *  aInstance,
const otIp6Address aDestination,
const uint8_t  aTlvTypes[],
uint8_t  aCount 
)

Send a Network Diagnostic Get request.

Parameters
[in]aDestinationA pointer to destination address.
[in]aTlvTypesAn array of Network Diagnostic TLV types.
[in]aCountNumber of types in aTlvTypes
OTAPI ThreadError 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
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