# Thread Direct

This module includes configuration variables for Thread Direct (TD).

## Summary

| ### Macros ||
|---|---|
| `https://openthread.io/reference/config/group/config-thread-direct#group__config-thread-direct_1gaf921d622552b788ec0d2177818477c84 1000` | The value ahead of the current MAC security frame counter for persistent storage of Thread Direct keys. |
| `https://openthread.io/reference/config/group/config-thread-direct#group__config-thread-direct_1ga9e0528969c31ae9acdd4b618f29ab77d 0` | Define to 1 to allow Thread Direct `KeyManager` to allocate registered key entries from the heap. |
| `https://openthread.io/reference/config/group/config-thread-direct#group__config-thread-direct_1gaf6582d07791105f431aaf9394ee9397c 8` | Specifies the maximum number of registered Thread Direct keys. |
| `https://openthread.io/reference/config/group/config-thread-direct#group__config-thread-direct_1ga7271d984f86827957425d83ef22c377b 0` | Define to 1 to enable Thread Direct Wake Initiator functionality. |
| `https://openthread.io/reference/config/group/config-thread-direct#group__config-thread-direct_1ga99dd665790af2389c1d138736120b90d 0` | Define to 1 to enable Thread Direct Wake Listener functionality. |
| `https://openthread.io/reference/config/group/config-thread-direct#group__config-thread-direct_1ga09fd50533f4a5feba396b3ed3c755508 (OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE)` |   |

## Macros

### OPENTHREAD_CONFIG_TD_FRAME_COUNTER_AHEAD

```
 OPENTHREAD_CONFIG_TD_FRAME_COUNTER_AHEAD 1000
```
The value ahead of the current MAC security frame counter for persistent storage of Thread Direct keys.

### OPENTHREAD_CONFIG_TD_KEY_LIST_USE_HEAP_ENABLE

```
 OPENTHREAD_CONFIG_TD_KEY_LIST_USE_HEAP_ENABLE 0
```
Define to 1 to allow Thread Direct `KeyManager` to allocate registered key entries from the heap.

When disabled (set to 0), a fixed-size `Pool` with `OPENTHREAD_CONFIG_TD_MAX_REGISTERED_KEYS` entries is used.

By default, this is enabled (set to 1) when both `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` and `OPENTHREAD_CONFIG_BORDER_ROUTING_USE_HEAP_ENABLE` are enabled, and disabled (set to 0) otherwise.

### OPENTHREAD_CONFIG_TD_MAX_REGISTERED_KEYS

```
 OPENTHREAD_CONFIG_TD_MAX_REGISTERED_KEYS 8
```
Specifies the maximum number of registered Thread Direct keys.

When `OPENTHREAD_CONFIG_TD_KEY_LIST_USE_HEAP_ENABLE` is enabled, this limits the maximum number of heap-allocated key entries, and can be set to 0 to allow an unlimited number of keys. When heap allocation is disabled, this specifies the size of the internal `Pool` used for allocating key entries.

By default, this is set to 0 (unlimited) when `OPENTHREAD_CONFIG_TD_KEY_LIST_USE_HEAP_ENABLE` is enabled, and 8 otherwise.

### OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE

```
 OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE 0
```
Define to 1 to enable Thread Direct Wake Initiator functionality.

### OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE

```
 OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE 0
```
Define to 1 to enable Thread Direct Wake Listener functionality.

### OT_CONFIG_THREAD_DIRECT_ENABLE

```
 OT_CONFIG_THREAD_DIRECT_ENABLE (OPENTHREAD_CONFIG_TD_WAKE_INITIATOR_ENABLE || OPENTHREAD_CONFIG_TD_WAKE_LISTENER_ENABLE)
```

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