# otNetworkDiagMleCounters Struct Reference

# otNetworkDiagMleCounters


`#include <openthread/netdiag.h>`

Represents a Network Diagnostics MLE Counters value.

## Summary

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1aec1617d41db9de31a85fc2726a8f07dc` | `uint16_t` Number of attach attempts while device was detached. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1abd07750a8a1a1f940b45bcde98fbdaca` | `uint16_t` Number of attempts to attach to a better partition. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1a33a2daf397cc144009b36dacdaa3c5de` | `uint16_t` Number of times device entered child role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1a01062bd8384fe1e360015373a45c68f1` | `uint64_t` Milliseconds device has been in child role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1a6d1b17ab4d3469693ff19fb596de7661` | `uint16_t` Number of times device entered detached role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1a75fde6d44ca4db581050d6a71a31bbee` | `uint64_t` Milliseconds device has been in detached role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1abcbed041c86180e01b13d60720031513` | `uint16_t` Number of times device entered disabled role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1ab073806eec113d49a1f0fdce6f4c2d03` | `uint64_t` Milliseconds device has been in disabled role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1ad1660613081936e6873ae5ba05232d59` | `uint16_t` Number of times device entered leader role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1add74b5fb77de64224783e0d54267bc0b` | `uint64_t` Milliseconds device has been in leader role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1a50dc78567782e42cced22bd532c18ff6` | `uint16_t` Number of time device changed its parent. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1ad133a4f4c5e7ee68325e555f7cac01e9` | `uint16_t` Number of changes to partition ID. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1a630c582301e37864206b6b1324f8088d` | `uint16_t` Number of times device entered router role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1ae4e07a042095958efb0912a92de56f09` | `uint64_t` Milliseconds device has been in router role. |
| `https://openthread.io/reference/struct/ot-network-diag-mle-counters#structot_network_diag_mle_counters_1a98dfa954ef3b8e189cd2ea8162825905` | `uint64_t` Milliseconds tracked by next counters (zero if not supported). |

## Public attributes

### mAttachAttempts

```
uint16_t otNetworkDiagMleCounters::mAttachAttempts
```
Number of attach attempts while device was detached.

### mBetterPartitionAttachAttempts

```
uint16_t otNetworkDiagMleCounters::mBetterPartitionAttachAttempts
```
Number of attempts to attach to a better partition.

### mChildRole

```
uint16_t otNetworkDiagMleCounters::mChildRole
```
Number of times device entered child role.

### mChildTime

```
uint64_t otNetworkDiagMleCounters::mChildTime
```
Milliseconds device has been in child role.

### mDetachedRole

```
uint16_t otNetworkDiagMleCounters::mDetachedRole
```
Number of times device entered detached role.

### mDetachedTime

```
uint64_t otNetworkDiagMleCounters::mDetachedTime
```
Milliseconds device has been in detached role.

### mDisabledRole

```
uint16_t otNetworkDiagMleCounters::mDisabledRole
```
Number of times device entered disabled role.

### mDisabledTime

```
uint64_t otNetworkDiagMleCounters::mDisabledTime
```
Milliseconds device has been in disabled role.

### mLeaderRole

```
uint16_t otNetworkDiagMleCounters::mLeaderRole
```
Number of times device entered leader role.

### mLeaderTime

```
uint64_t otNetworkDiagMleCounters::mLeaderTime
```
Milliseconds device has been in leader role.

### mParentChanges

```
uint16_t otNetworkDiagMleCounters::mParentChanges
```
Number of time device changed its parent.

### mPartitionIdChanges

```
uint16_t otNetworkDiagMleCounters::mPartitionIdChanges
```
Number of changes to partition ID.

### mRouterRole

```
uint16_t otNetworkDiagMleCounters::mRouterRole
```
Number of times device entered router role.

### mRouterTime

```
uint64_t otNetworkDiagMleCounters::mRouterTime
```
Milliseconds device has been in router role.

### mTrackedTime

```
uint64_t otNetworkDiagMleCounters::mTrackedTime
```
Milliseconds tracked by next counters (zero if not supported).

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).