From 4e827085f798c2b15a8631cc0410460a29df64b2 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Sat, 23 Mar 2019 07:32:51 +0100 Subject: [PATCH 1/2] pkg/semtech-loramac: provide a way to disable dutycycle Duty cycle can be disabled by building the application using CFLAGS=-DDISABLE_LORAMAC_DUTYCYCLE --- pkg/semtech-loramac/contrib/semtech_loramac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/semtech-loramac/contrib/semtech_loramac.c b/pkg/semtech-loramac/contrib/semtech_loramac.c index 3593d8e930..eafb861a2d 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac.c @@ -40,6 +40,7 @@ #include "semtech_loramac.h" #include "LoRaMac.h" +#include "LoRaMacTest.h" #include "region/Region.h" #ifdef MODULE_PERIPH_EEPROM @@ -427,6 +428,9 @@ void _init_loramac(semtech_loramac_t *mac, primitives->MacMlmeIndication = mlme_indication; LoRaMacInitialization(&semtech_loramac_radio_events, primitives, callbacks, LORAMAC_ACTIVE_REGION); +#ifdef DISABLE_LORAMAC_DUTYCYCLE + LoRaMacTestSetDutyCycleOn(false); +#endif mutex_unlock(&mac->lock); semtech_loramac_set_dr(mac, LORAMAC_DEFAULT_DR); From e5831cf321433df34cc39bf8270059f04bb992c0 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Sat, 23 Mar 2019 13:14:26 +0100 Subject: [PATCH 2/2] tests/pkg_semtech-loramac: add note about duty-cycle disabling --- tests/pkg_semtech-loramac/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pkg_semtech-loramac/README.md b/tests/pkg_semtech-loramac/README.md index d32316e2ab..298f88be31 100644 --- a/tests/pkg_semtech-loramac/README.md +++ b/tests/pkg_semtech-loramac/README.md @@ -66,6 +66,11 @@ for US915 region. The default region is `EU868`. +**For testing purpose**, it is possible to disable the duty-cycle restriction +implemented in the MAC layer with the `DISABLE_LORAMAC_DUTYCYCLE` macro: + + CFLAGS=-DDISABLE_LORAMAC_DUTYCYCLE LORA_REGION=US915 LORA_DRIVER=sx1272 make ... + ## Using the shell This application provides the `loramac` command for configuring the MAC,