# /space/home/slher/rel/Beken/v6_4_5/macsw/ip/lmac/src/td/td.h File Reference

Traffic Detection (TD) Module. More...

`#include "rwnx_config.h"`
`#include "mm_timer.h"`

Go to the source code of this file.

## Data Structures
struct | td_env_tag
| Structure containing all information about traffic detection for a given interface. More...
struct | td_sta_env_tag
| Structure containing all information about traffic detection for a given link. More...
## Defines
#define | TD_DEFAULT_INTV_US (100000)
| Traffic Detection Interval default value (in microseconds).
#define | TD_DEFAULT_PCK_NB_THRES (3)
| Traffic Detection default threshold (number of RX or TX packets needed to consider that traffi is occurring).
## Enumerations
enum | td_status_bit { TD_STATUS_TX = 0, TD_STATUS_RX, TD_STATUS_TX_PS, TD_STATUS_RX_PS }
| Bit index for Traffic Status. More...
## Functions
void | td_init (void)
| Initialize the traffic detection module.
void | td_reset (uint8_t vif_index)
| Reset Traffic Detection status for a given VIF.
void | td_start (uint8_t vif_index)
| Start Traffic Detection on a given VIF.
void | td_pck_ind (uint8_t vif_index, uint8_t sta_index, bool rx)
| Handle reception or transmission of a packet on a given interface.
void | td_pck_ps_ind (uint8_t vif_index, bool rx)
| Handle reception or transmission of a packet on a given interface in a PS context.
__INLINE uint8_t | td_get_status (uint8_t vif_index)
__INLINE uint8_t | td_get_ps_status (uint8_t vif_index)
void | td_sta_reset (uint8_t sta_index)
| Reset Traffic Detection status for a given STA.
__INLINE bool | td_sta_has_tx_traffic (uint8_t sta_idx)
| Check if there is TX traffic for a given STA.
__INLINE bool | td_sta_has_traffic (uint8_t sta_idx)
| Check if there is TX or RX traffic for a given STA.
## Variables
struct td_env_tag | td_env_tab [NX_VIRT_DEV_MAX]
| List of TD Environment Entries, one for each VIF that can be created.
struct td_sta_env_tag | td_sta_env [NX_REMOTE_STA_MAX]
| List of TD Environment Entries used for per-STA traffic detection.

## Detailed Description

Traffic Detection (TD) Module.

Copyright (C) RivieraWaves 2015-2019

Definition in file td.h.