Loading...
Searching...
No Matches
csma_sender.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 INRIA
3 * SPDX-FileCopyrightText: 2016 Freie Universität Berlin
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
23
24#include <stdint.h>
25
26#include "net/netdev.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
40#ifndef CONFIG_CSMA_SENDER_MIN_BE_DEFAULT
41#define CONFIG_CSMA_SENDER_MIN_BE_DEFAULT (3U)
42#endif
43
47#ifndef CONFIG_CSMA_SENDER_MAX_BE_DEFAULT
48#define CONFIG_CSMA_SENDER_MAX_BE_DEFAULT (5U)
49#endif
50
55#ifndef CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT
56#define CONFIG_CSMA_SENDER_MAX_BACKOFFS_DEFAULT (4U)
57#endif
58
62#ifndef CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT
63#define CONFIG_CSMA_SENDER_BACKOFF_PERIOD_UNIT (320U)
64#endif
66
70typedef struct {
71 uint8_t min_be;
72 uint8_t max_be;
73 uint16_t max_backoffs;
74 uint32_t backoff_period;
76
81
105 const csma_sender_conf_t *conf);
106
136
137#ifdef __cplusplus
138}
139#endif
140
Definitions low-level network driver interface.
struct netdev netdev_t
Forward declaration for netdev struct.
Definition netdev.h:285
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.
struct iolist iolist_t
iolist forward declaration
Definition iolist.h:30
Configuration type for backoff.
Definition csma_sender.h:70
uint16_t max_backoffs
maximum number of retries
Definition csma_sender.h:73
uint8_t min_be
minimum backoff exponent
Definition csma_sender.h:71
uint8_t max_be
maximum backoff exponent
Definition csma_sender.h:72
uint32_t backoff_period
backoff period in microseconds
Definition csma_sender.h:74
iolist structure definition
Definition iolist.h:35