diff --git a/pkg/semtech-loramac/contrib/semtech_loramac.c b/pkg/semtech-loramac/contrib/semtech_loramac.c index 8ca300089d..f2c4c06f63 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac.c @@ -378,7 +378,7 @@ void _init_loramac(semtech_loramac_t *mac, semtech_loramac_set_dr(mac, LORAMAC_DEFAULT_DR); semtech_loramac_set_adr(mac, LORAMAC_DEFAULT_ADR); semtech_loramac_set_public_network(mac, LORAMAC_DEFAULT_PUBLIC_NETWORK); - semtech_loramac_set_class(mac, LORAMAC_DEFAULT_DEVICE_CLASS); + semtech_loramac_set_class(mac, CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS); semtech_loramac_set_tx_port(mac, LORAMAC_DEFAULT_TX_PORT); semtech_loramac_set_tx_mode(mac, LORAMAC_DEFAULT_TX_MODE); semtech_loramac_set_system_max_rx_error(mac, diff --git a/sys/include/net/loramac.h b/sys/include/net/loramac.h index e020252eb1..fafd8a6bf6 100644 --- a/sys/include/net/loramac.h +++ b/sys/include/net/loramac.h @@ -103,9 +103,19 @@ extern "C" { /** * @brief Default device class (A, B or C) + * + * @note GNRC LoRaWAN only supports Class A */ -#ifndef LORAMAC_DEFAULT_DEVICE_CLASS -#define LORAMAC_DEFAULT_DEVICE_CLASS (LORAMAC_CLASS_A) +#if IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS_A) +#define CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS (LORAMAC_CLASS_A) +#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS_B) +#define CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS (LORAMAC_CLASS_B) +#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS_C) +#define CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS (LORAMAC_CLASS_C) +#endif + +#ifndef CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS +#define CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS (LORAMAC_CLASS_A) #endif /**