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 
10 #pragma once
11 
27 #include <stdint.h>
28 
29 #include "net/netdev.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
43 #ifndef CONFIG_CSMA_SENDER_MIN_BE_DEFAULT
44 #define CONFIG_CSMA_SENDER_MIN_BE_DEFAULT (3U)
45 #endif
46 
50 #ifndef CONFIG_CSMA_SENDER_MAX_BE_DEFAULT
51 #define CONFIG_CSMA_SENDER_MAX_BE_DEFAULT (5U)
52 #endif
53 
58 #ifndef CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT
59 #define CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT (4U)
60 #endif
61 
65 #ifndef CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT
66 #define CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT (320U)
67 #endif
73 typedef struct {
74  uint8_t min_be;
75  uint8_t max_be;
76  uint16_t max_backoffs;
77  uint32_t backoff_period;
79 
84 
108  const csma_sender_conf_t *conf);
109 
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
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:73
uint16_t max_backoffs
maximum number of retries
Definition: csma_sender.h:76
uint8_t min_be
minimum backoff exponent
Definition: csma_sender.h:74
uint8_t max_be
maximum backoff exponent
Definition: csma_sender.h:75
uint32_t backoff_period
backoff period in microseconds
Definition: csma_sender.h:77
iolist structure definition
Definition: iolist.h:38
Structure to hold driver state.
Definition: netdev.h:364