diff --git a/tests/pkg_semtech-loramac/Makefile b/tests/pkg_semtech-loramac/Makefile index 47081377ea..0f8d63794e 100644 --- a/tests/pkg_semtech-loramac/Makefile +++ b/tests/pkg_semtech-loramac/Makefile @@ -18,6 +18,8 @@ USEMODULE += shell USEMODULE += shell_commands USEMODULE += fmt +FEATURES_OPTIONAL += periph_eeprom + CFLAGS += -DREGION_$(LORA_REGION) CFLAGS += -DLORAMAC_ACTIVE_REGION=LORAMAC_REGION_$(LORA_REGION) diff --git a/tests/pkg_semtech-loramac/main.c b/tests/pkg_semtech-loramac/main.c index e0e7ba42e4..56d97d6a76 100644 --- a/tests/pkg_semtech-loramac/main.c +++ b/tests/pkg_semtech-loramac/main.c @@ -35,7 +35,11 @@ static char print_buf[LORAMAC_APPKEY_LEN * 2 + 1]; static void _loramac_usage(void) { - puts("Usage: loramac "); + puts("Usage: loramac "); } static void _loramac_join_usage(void) @@ -462,6 +466,24 @@ static int _cmd_loramac(int argc, char **argv) semtech_loramac_request_link_check(&loramac); puts("Link check request scheduled"); } +#ifdef MODULE_PERIPH_EEPROM + else if (strcmp(argv[1], "save") == 0) { + if (argc > 2) { + _loramac_usage(); + return 1; + } + + semtech_loramac_save_config(&loramac); + } + else if (strcmp(argv[1], "erase") == 0) { + if (argc > 2) { + _loramac_usage(); + return 1; + } + + semtech_loramac_erase_config(); + } +#endif else { _loramac_usage(); return 1;