Loading...
Searching...
No Matches
csma_sender.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 INRIA
3 * Copyright (C) 2016 Freie Universität Berlin
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
25#ifndef NET_CSMA_SENDER_H
26#define NET_CSMA_SENDER_H
27
28#include <stdint.h>
29
30#include "net/netdev.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
44#ifndef CONFIG_CSMA_SENDER_MIN_BE_DEFAULT
45#define CONFIG_CSMA_SENDER_MIN_BE_DEFAULT (3U)
46#endif
47
51#ifndef CONFIG_CSMA_SENDER_MAX_BE_DEFAULT
52#define CONFIG_CSMA_SENDER_MAX_BE_DEFAULT (5U)
53#endif
54
59#ifndef CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT
60#define CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT (4U)
61#endif
62
66#ifndef CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT
67#define CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT (320U)
68#endif
74typedef struct {
75 uint8_t min_be;
76 uint8_t max_be;
77 uint16_t max_backoffs;
78 uint32_t backoff_period;
80
85
109 const csma_sender_conf_t *conf);
110
140
141#ifdef __cplusplus
142}
143#endif
144
145#endif /* NET_CSMA_SENDER_H */
146
Definitions low-level network driver interface.
int csma_sender_cca_send(netdev_t *dev, iolist_t *iolist)
Sends a 802.15.4 frame when medium is available.
int csma_sender_csma_ca_send(netdev_t *dev, iolist_t *iolist, const csma_sender_conf_t *conf)
Sends a 802.15.4 frame using the CSMA/CA method.
const csma_sender_conf_t CSMA_SENDER_CONF_DEFAULT
Default configuration.
Configuration type for backoff.
Definition csma_sender.h:74
uint16_t max_backoffs
maximum number of retries
Definition csma_sender.h:77
uint8_t min_be
minimum backoff exponent
Definition csma_sender.h:75
uint8_t max_be
maximum backoff exponent
Definition csma_sender.h:76
uint32_t backoff_period
backoff period in microseconds
Definition csma_sender.h:78
iolist structure definition
Definition iolist.h:39
Structure to hold driver state.
Definition netdev.h:363