1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

net/lorawan : Move 'LORAMAC_DEFAULT_RX2_DR' to 'CONFIG_'

Added symbols 'CONFIG_LORAMAC_DEFAULT_RX2_DR_XX' to define
choice in Kconfig
This commit is contained in:
Akshai M 2020-11-23 18:12:31 +01:00
parent d48cee7c2a
commit d5086ecf60
4 changed files with 40 additions and 6 deletions

View File

@ -258,7 +258,7 @@ int rn2xx3_mac_init(rn2xx3_t *dev)
rn2xx3_mac_set_linkchk_interval(dev, CONFIG_LORAMAC_DEFAULT_LINKCHK);
rn2xx3_mac_set_rx1_delay(dev, CONFIG_LORAMAC_DEFAULT_RX1_DELAY);
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_dr(dev, CONFIG_LORAMAC_DEFAULT_RX2_DR);
rn2xx3_mac_set_rx2_freq(dev, LORAMAC_DEFAULT_RX2_FREQ);
return RN2XX3_OK;

View File

@ -35,7 +35,7 @@ CFLAGS += -DCONFIG_LORAMAC_DEV_EUI_DEFAULT=\"CCCCCCCCCCCCCCCC\"
#CFLAGS += -DCONFIG_LORAMAC_DEV_ADDR_DEFAULT=\"00000000\"
#CFLAGS += -DCONFIG_LORAMAC_NWK_SKEY_DEFAULT=\"00000000000000000000000000000000\"
#CFLAGS += -DCONFIG_LORAMAC_APP_SKEY_DEFAULT=\"00000000000000000000000000000000\"
#CFLAGS += -DLORAMAC_DEFAULT_RX2_DR=LORAMAC_DR_3
#CFLAGS += -DCONFIG_LORAMAC_DEFAULT_RX2_DR=LORAMAC_DR_3
# Comment/uncomment as necessary
CFLAGS += -DLORAMAC_DEFAULT_JOIN_PROCEDURE=LORAMAC_JOIN_OTAA

View File

@ -294,11 +294,45 @@ extern "C" {
/**
* @brief Default second RX window datarate index
*/
#ifndef LORAMAC_DEFAULT_RX2_DR
#if IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_0)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_0)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_1)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_1)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_2)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_2)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_3)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_3)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_4)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_4)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_5)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_5)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_6)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_6)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_7)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_7)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_8)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_8)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_9)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_9)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_10)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_10)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_11)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_11)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_12)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_12)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_13)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_13)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_14)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_14)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_RX2_DR_15)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_15)
#endif
#ifndef CONFIG_LORAMAC_DEFAULT_RX2_DR
#if IS_ACTIVE(CONFIG_LORAMAC_REGION_EU_868)
#define LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_0)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_0)
#elif IS_ACTIVE(CONFIG_LORAMAC_REGION_IN_865)
#define LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_2)
#define CONFIG_LORAMAC_DEFAULT_RX2_DR (LORAMAC_DR_2)
#endif
#endif

View File

@ -107,7 +107,7 @@ void gnrc_lorawan_reset(gnrc_lorawan_t *mac)
dev->driver->set(dev, NETOPT_RX_TIMEOUT, &rx_timeout, sizeof(rx_timeout));
gnrc_lorawan_set_rx2_dr(mac, LORAMAC_DEFAULT_RX2_DR);
gnrc_lorawan_set_rx2_dr(mac, CONFIG_LORAMAC_DEFAULT_RX2_DR);
mac->toa = 0;
gnrc_lorawan_mcps_reset(mac);