diff --git a/drivers/include/rn2xx3.h b/drivers/include/rn2xx3.h index ade7386d92..f3023bb3f5 100644 --- a/drivers/include/rn2xx3.h +++ b/drivers/include/rn2xx3.h @@ -67,6 +67,23 @@ extern "C" { #ifndef CONFIG_RN2XX3_DEFAULT_SLEEP #define CONFIG_RN2XX3_DEFAULT_SLEEP (5000U) #endif + +/** + * @brief Default automatic reply status + * + * Set to 1 to enable the automatic reply. The module will transmit a packet without a + * payload immediately after a confirmed downlink is received, or when the Frame + * Pending bit has been set by the server. + * + * @note If all enabled channels are busy due to duty cycle limitations, the + * module will wait for the first channel that will become free to transmit. The + * user will not be able to initiate uplink transmissions until the automatic + * transmissions are done. Refer RN2483 LoRa™ Technology Module Command + * Reference User’s Guide for more information. + */ +#ifdef DOXYGEN +#define CONFIG_RN2XX3_DEFAULT_AR +#endif /** @} */ #if defined(MODULE_RN2903) diff --git a/drivers/rn2xx3/Kconfig b/drivers/rn2xx3/Kconfig index aeb4c6c3ca..8808e592df 100644 --- a/drivers/rn2xx3/Kconfig +++ b/drivers/rn2xx3/Kconfig @@ -20,4 +20,13 @@ config RN2XX3_DEFAULT_SLEEP Set the sleep duration (in ms). The value should be greater than RN2XX3_SLEEP_MIN (100 ms) +config RN2XX3_DEFAULT_AR + bool "Enable automatic reply" + help + Enable/disable Automatic Reply (AR) for rn2xx3 module. By enabling the + automatic reply, the module will transmit a packet without a payload + immediately after a confirmed downlink is received, or when the + Frame Pending bit has been set by the server. Refer RN2483 LoRa™ + Technology Module Command Reference User’s Guide for more information. + endif # KCONFIG_USEMODULE_RN2XX3 diff --git a/drivers/rn2xx3/rn2xx3.c b/drivers/rn2xx3/rn2xx3.c index efd9722c6c..7c7aea9b1e 100644 --- a/drivers/rn2xx3/rn2xx3.c +++ b/drivers/rn2xx3/rn2xx3.c @@ -24,6 +24,8 @@ #include "assert.h" #include "xtimer.h" #include "fmt.h" +#include "kernel_defines.h" + #include "rn2xx3_params.h" #include "rn2xx3.h" #include "rn2xx3_internal.h" @@ -255,7 +257,7 @@ int rn2xx3_mac_init(rn2xx3_t *dev) rn2xx3_mac_set_retx(dev, LORAMAC_DEFAULT_RETX); rn2xx3_mac_set_linkchk_interval(dev, LORAMAC_DEFAULT_LINKCHK); rn2xx3_mac_set_rx1_delay(dev, LORAMAC_DEFAULT_RX1_DELAY); - rn2xx3_mac_set_ar(dev, LORAMAC_DEFAULT_AR); + rn2xx3_mac_set_ar(dev, IS_ACTIVE(CONFIG_RN2XX3_DEFAULT_AR)); rn2xx3_mac_set_rx2_dr(dev, LORAMAC_DEFAULT_RX2_DR); rn2xx3_mac_set_rx2_freq(dev, LORAMAC_DEFAULT_RX2_FREQ); diff --git a/sys/include/net/loramac.h b/sys/include/net/loramac.h index 9b94aa482d..1915ae4c18 100644 --- a/sys/include/net/loramac.h +++ b/sys/include/net/loramac.h @@ -202,13 +202,6 @@ extern "C" { */ #define LORAMAC_DEFAULT_RX2_DELAY (1000U + LORAMAC_DEFAULT_RX1_DELAY) -/** - * @brief Default automatic reply status - */ -#ifndef LORAMAC_DEFAULT_AR -#define LORAMAC_DEFAULT_AR (false) -#endif - /** * @brief Default second RX window datarate index */