# Child Supervision

# Child Supervision

This module includes functions for Child Supervision feature.

## Summary

| ### Functions ||
|---|---|
| `https://openthread.io/reference/group/api-child-supervision#group__api-child-supervision_1ga31411fdad42a4a22bfd90cac4c5af92f(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint16_t` Get the value of supervision check timeout failure counter. |
| `https://openthread.io/reference/group/api-child-supervision#group__api-child-supervision_1ga45e1b9662b0586c190c86581fd990009(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint16_t` Gets the supervision check timeout interval (in seconds) on the child. |
| `https://openthread.io/reference/group/api-child-supervision#group__api-child-supervision_1ga3faa336529ff0d5528bfbbbfcfd1cfc8(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `uint16_t` Gets the Child Supervision interval (in seconds) on a child. |
| `https://openthread.io/reference/group/api-child-supervision#group__api-child-supervision_1ga5881b89658c0af5b4247acf408f37214(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance)` | `void` Reset the supervision check timeout failure counter to zero. |
| `https://openthread.io/reference/group/api-child-supervision#group__api-child-supervision_1ga56528456df5809364681d25cf263ceb0(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t aTimeout)` | `void` Sets the supervision check timeout interval (in seconds) on the child. |
| `https://openthread.io/reference/group/api-child-supervision#group__api-child-supervision_1ga6b5a90ee55c37a1c66020539ec9b187b(https://openthread.io/reference/group/api-instance#group__api-instance_1ga25440551213fb5b40869725378584960 *aInstance, uint16_t aInterval)` | `void` Sets the child supervision interval (in seconds) on the child. |

## Functions

### otChildSupervisionGetCheckFailureCounter

```
uint16_t otChildSupervisionGetCheckFailureCounter(
  otInstance *aInstance
)
```
Get the value of supervision check timeout failure counter.

The counter tracks the number of supervision check failures on the child. It is incremented when the child does not hear from its parent within the specified check timeout interval.

### otChildSupervisionGetCheckTimeout

```
uint16_t otChildSupervisionGetCheckTimeout(
  otInstance *aInstance
)
```
Gets the supervision check timeout interval (in seconds) on the child.

If the device is a sleepy child and it does not hear from its parent within the specified check timeout, it initiates the re-attach process (MLE Child Update Request/Response exchange with its parent).

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| **Returns** | The supervision check timeout. Zero indicates that supervision check on the child is disabled. |

### otChildSupervisionGetInterval

```
uint16_t otChildSupervisionGetInterval(
  otInstance *aInstance
)
```
Gets the Child Supervision interval (in seconds) on a child.

Child Supervision feature provides a mechanism for parent to ensure that a message is sent to each sleepy child within the supervision interval. If there is no transmission to the child within the supervision interval, OpenThread enqueues and sends a Child Supervision Message to the child.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | |
| **Returns** | The child supervision interval. Zero indicates that supervision is disabled. |

### otChildSupervisionResetCheckFailureCounter

```
void otChildSupervisionResetCheckFailureCounter(
  otInstance *aInstance
)
```
Reset the supervision check timeout failure counter to zero.

### otChildSupervisionSetCheckTimeout

```
void otChildSupervisionSetCheckTimeout(
  otInstance *aInstance,
  uint16_t aTimeout
)
```
Sets the supervision check timeout interval (in seconds) on the child.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aTimeout` | The check timeout (in seconds). Zero to disable supervision check on the child. | |

### otChildSupervisionSetInterval

```
void otChildSupervisionSetInterval(
  otInstance *aInstance,
  uint16_t aInterval
)
```
Sets the child supervision interval (in seconds) on the child.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `[in] aInstance` | A pointer to an OpenThread instance. | | `[in] aInterval` | The supervision interval (in seconds). Zero to disable supervision. | |

## 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).