From 82e0d5a9b05c9e79eab01317070042e8dbb009e4 Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Mon, 31 Aug 2020 14:29:10 +0200 Subject: [PATCH] net/ieee802154: add default CSMA-CA params --- sys/include/net/ieee802154.h | 21 +++++++++++++++++++++ sys/net/link_layer/ieee802154/Kconfig | 12 ++++++++++++ 2 files changed, 33 insertions(+) diff --git a/sys/include/net/ieee802154.h b/sys/include/net/ieee802154.h index 42c5cf776a6e1..11bc3b1257f35 100644 --- a/sys/include/net/ieee802154.h +++ b/sys/include/net/ieee802154.h @@ -203,6 +203,27 @@ extern const uint8_t ieee802154_addr_bcast[IEEE802154_ADDR_BCAST_LEN]; #endif /** @} */ +/** + * @brief IEEE802.15.4 default value for minimum backoff exponent + */ +#ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_MIN_BE +#define CONFIG_IEEE802154_DEFAULT_CSMA_CA_MIN_BE (3U) +#endif + +/** + * @brief IEEE802.15.4 default value for maximum number of CSMA-CA retries. + */ +#ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_RETRIES +#define CONFIG_IEEE802154_DEFAULT_CSMA_CA_RETRIES (4U) +#endif + +/** + * @brief IEEE802.15.4 default value for maximum backoff exponent + */ +#ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_MAX_BE +#define CONFIG_IEEE802154_DEFAULT_CSMA_CA_MAX_BE (5U) +#endif + /** * @brief Initializes an IEEE 802.15.4 MAC frame header in @p buf. * diff --git a/sys/net/link_layer/ieee802154/Kconfig b/sys/net/link_layer/ieee802154/Kconfig index 340df72be7c75..c063a97bbc0a5 100644 --- a/sys/net/link_layer/ieee802154/Kconfig +++ b/sys/net/link_layer/ieee802154/Kconfig @@ -33,4 +33,16 @@ if KCONFIG_MODULE_IEEE802154 int "IEEE802.15.4 default TX power (in dBm)" default 0 + config IEEE802154_DEFAULT_CSMA_CA_MIN + int "IEEE802.15.4 default CSMA-CA minimum backoff exponent" + default 3 + + config IEEE802154_DEFAULT_CSMA_CA_RETRIES + int "IEEE802.15.4 default CSMA-CA maximum number of retries" + default 4 + + config IEEE802154_DEFAULT_CSMA_CA_MAX + int "IEEE802.15.4 default CSMA-CA maximum backoff exponent" + default 5 + endif # KCONFIG_MODULE_IEEE802154