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_JOIN_PROCEDURE' to 'CONFIG_'

Added symbols 'CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE_XXX'
for Kconfig exposure
This commit is contained in:
Akshai M 2020-11-23 18:52:41 +01:00
parent 81dac00d5c
commit ed1b86492f
3 changed files with 11 additions and 5 deletions

View File

@ -38,8 +38,8 @@ CFLAGS += -DCONFIG_LORAMAC_DEV_EUI_DEFAULT=\"CCCCCCCCCCCCCCCC\"
#CFLAGS += -DCONFIG_LORAMAC_DEFAULT_RX2_DR=LORAMAC_DR_3
# Comment/uncomment as necessary
CFLAGS += -DLORAMAC_DEFAULT_JOIN_PROCEDURE=LORAMAC_JOIN_OTAA
#CFLAGS += -DLORAMAC_DEFAULT_JOIN_PROCEDURE=LORAMAC_JOIN_ABP
CFLAGS += -DCONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE=LORAMAC_JOIN_OTAA
#CFLAGS += -DCONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE=LORAMAC_JOIN_ABP
# Uncomment to set the highest DR for the EU868 in order to maximize throughput.
# If uncommented, the default value (DR0) is used.

View File

@ -350,8 +350,14 @@ extern "C" {
/**
* @brief Default LoRaMAC join procedure
*/
#ifndef LORAMAC_DEFAULT_JOIN_PROCEDURE
#define LORAMAC_DEFAULT_JOIN_PROCEDURE (LORAMAC_JOIN_OTAA)
#if IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE_OTAA)
#define CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE (LORAMAC_JOIN_OTAA)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE_ABP)
#define CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE (LORAMAC_JOIN_ABP)
#endif
#ifndef CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE
#define CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE (LORAMAC_JOIN_OTAA)
#endif
/**

View File

@ -177,7 +177,7 @@ static void _driver_cb(netdev_t *dev, netdev_event_t event)
static void _reset(gnrc_netif_t *netif)
{
netif->lorawan.otaa = LORAMAC_DEFAULT_JOIN_PROCEDURE ==
netif->lorawan.otaa = CONFIG_LORAMAC_DEFAULT_JOIN_PROCEDURE ==
LORAMAC_JOIN_OTAA ? NETOPT_ENABLE : NETOPT_DISABLE;
netif->lorawan.datarate = CONFIG_LORAMAC_DEFAULT_DR;
netif->lorawan.demod_margin = 0;