From 02151deae4bdcc4bb36ba33c3f98d529a6636a52 Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Mon, 8 Feb 2021 15:11:00 +0100 Subject: [PATCH] net/loramac: add redundancy configuration parameter --- sys/include/net/loramac.h | 15 +++++++++++++++ sys/net/link_layer/Kconfig.lorawan | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/sys/include/net/loramac.h b/sys/include/net/loramac.h index 4d872c45cc..1ab6e09cdc 100644 --- a/sys/include/net/loramac.h +++ b/sys/include/net/loramac.h @@ -284,6 +284,21 @@ extern "C" { #define CONFIG_LORAMAC_DEFAULT_TX_MODE (LORAMAC_TX_CNF) #endif +/** + * @brief Default redundancy for unconfirmed uplink + * + * This corresponds to the number of unconfirmed uplink retransmissions when + * using ADR. This configuration does not affect confirmed uplinks. By + * default, uplinks are sent without retransmissions (this means, the device + * sends only one uplink packet) + * + * @note This value MUST NOT be greater than 14, since the LinkADRCommand it's + * already limited by a 4 bit value (therefore, 15 uplink transmissions) + */ +#ifndef CONFIG_LORAMAC_DEFAULT_REDUNDANCY +#define CONFIG_LORAMAC_DEFAULT_REDUNDANCY (0U) +#endif + /** * @brief Enable/disable adaptive datarate state * diff --git a/sys/net/link_layer/Kconfig.lorawan b/sys/net/link_layer/Kconfig.lorawan index bc5aeefdb1..3853b413f4 100644 --- a/sys/net/link_layer/Kconfig.lorawan +++ b/sys/net/link_layer/Kconfig.lorawan @@ -524,4 +524,16 @@ config LORAMAC_DEFAULT_MIN_RX_SYMBOLS system timer. Refer SX1276_settings_for_LoRaWAN_v2p2.pdf (AN1200.24) from Semtech for more information. +config LORAMAC_DEFAULT_REDUNDANCY + int "Default redundancy for unconfirmed uplinks" + depends on USEMODULE_GNRC_LORAWAN + default 0 + range 0 14 + help + This corresponds to the number of unconfirmed + uplink retransmissions when using ADR. This + configuration does not affect confirmed uplinks. + By default, uplinks are sent without retransmissions + (this means, the device sends only one uplink packet) + endif # KCONFIG_USEMODULE_LORAWAN