19#ifndef NET_NETSTATS_NEIGHBOR_H
20#define NET_NETSTATS_NEIGHBOR_H
48#define NETSTATS_NB_EWMA_SCALE 100
53#define NETSTATS_NB_EWMA_ALPHA 15
58#define NETSTATS_NB_EWMA_ALPHA_RAMP 30
68#define NETSTATS_NB_ETX_NOACK_PENALTY 6
72#define NETSTATS_NB_ETX_DIVISOR 128
76#define NETSTATS_NB_ETX_INIT 2
86#define NETSTATS_NB_FRESHNESS_HALF 600
90#define NETSTATS_NB_FRESHNESS_TARGET 4
94#define NETSTATS_NB_FRESHNESS_MAX 16
98#define NETSTATS_NB_FRESHNESS_EXPIRATION 1200
108#define NETSTATS_NB_TX_TIMEOUT_MS 100
160 uint8_t transmissions);
174 uint8_t l2_addr_len, uint8_t rssi, uint8_t lqi);
bool netstats_nb_isfresh(netif_t *netif, netstats_nb_t *stats)
Check if a record is fresh.
netstats_nb_t * netstats_nb_update_rx(netif_t *netif, const uint8_t *l2_addr, uint8_t l2_addr_len, uint8_t rssi, uint8_t lqi)
Record rx stats for the l2_addr.
void netstats_nb_init(netif_t *netif)
Initialize the neighbor stats.
void netstats_nb_record(netif_t *netif, const uint8_t *l2_addr, uint8_t len)
Store this neighbor as next in the transmission queue.
netstats_nb_result_t
Result of the transmission.
@ NETSTATS_NB_NOACK
Failed due to no ack received.
@ NETSTATS_NB_BUSY
Failed due to medium busy.
@ NETSTATS_NB_SUCCESS
Successful transmission.
bool netstats_nb_get(netif_t *netif, const uint8_t *l2_addr, uint8_t len, netstats_nb_t *out)
Find a neighbor stat by the mac address.
netstats_nb_t * netstats_nb_update_tx(netif_t *netif, netstats_nb_result_t result, uint8_t transmissions)
Update the next recorded neighbor with the provided numbers.
Common network interface API definitions.
Network interface descriptor.
Utility library for comparing and computing timestamps.