diff --git a/tests/pkg_semtech-loramac/Makefile b/tests/pkg_semtech-loramac/Makefile index 47081377ea22c98fd7d2c8b11d43dcd41423d737..0f8d63794e49d1eaddfdeb9a7eb7e81299c08514 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 e0e7ba42e458a58ca298bf3c06117c050e07b6ab..56d97d6a76d47dfe36b8442f3498a98580c641a2 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 <get|set|join|tx|link_check>"); + puts("Usage: loramac <get|set|join|tx|link_check" +#ifdef MODULE_PERIPH_EEPROM + "|save|erase" +#endif + ">"); } 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;