Skip to content

Commit

Permalink
Merge pull request #11241 from aabadie/pr/pkg/loramac_duty_cycle
Browse files Browse the repository at this point in the history
pkg/semtech-loramac: provide a way to disable dutycycle
  • Loading branch information
jia200x authored Mar 27, 2019
2 parents f2df22e + e5831cf commit 61d7b20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/semtech-loramac/contrib/semtech_loramac.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

#include "semtech_loramac.h"
#include "LoRaMac.h"
#include "LoRaMacTest.h"
#include "region/Region.h"

#ifdef MODULE_PERIPH_EEPROM
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions tests/pkg_semtech-loramac/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 61d7b20

Please sign in to comment.