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 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
45 #ifndef CONFIG_CSMA_SENDER_MIN_BE_DEFAULT
46 #define CONFIG_CSMA_SENDER_MIN_BE_DEFAULT (3U)
47 #endif
48 
52 #ifndef CONFIG_CSMA_SENDER_MAX_BE_DEFAULT
53 #define CONFIG_CSMA_SENDER_MAX_BE_DEFAULT (5U)
54 #endif
55 
60 #ifndef CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT
61 #define CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT (4U)
62 #endif
63 
67 #ifndef CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT
68 #define CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT (320U)
69 #endif
70 
75 typedef struct {
76  uint8_t min_be;
77  uint8_t max_be;
78  uint16_t max_backoffs;
79  uint32_t backoff_period;
81 
86 
110  const csma_sender_conf_t *conf);
111 
141 
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* NET_CSMA_SENDER_H */
148 
csma_sender_conf_t::max_be
uint8_t max_be
maximum backoff exponent
Definition: csma_sender.h:77
csma_sender_conf_t::backoff_period
uint32_t backoff_period
backoff period in microseconds
Definition: csma_sender.h:79
netdev.h
Definitions low-level network driver interface.
csma_sender_conf_t
Configuration type for backoff.
Definition: csma_sender.h:75
iolist
iolist structure definition
Definition: iolist.h:39
csma_sender_csma_ca_send
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.
csma_sender_cca_send
int csma_sender_cca_send(netdev_t *dev, iolist_t *iolist)
Sends a 802.15.4 frame when medium is available.
netdev
Structure to hold driver state.
Definition: netdev.h:302
csma_sender_conf_t::min_be
uint8_t min_be
minimum backoff exponent
Definition: csma_sender.h:76
CSMA_SENDER_CONF_DEFAULT
const csma_sender_conf_t CSMA_SENDER_CONF_DEFAULT
Default configuration.
csma_sender_conf_t::max_backoffs
uint16_t max_backoffs
maximum number of retries
Definition: csma_sender.h:78