diff --git a/tests/pkg_semtech-loramac/main.c b/tests/pkg_semtech-loramac/main.c index 1a8b98fa4aaf41a07584ddf8f1fd20e4d10538a1..0d19cf4e5f1ba90aadf7f58af4567cfe6d06f041 100644 --- a/tests/pkg_semtech-loramac/main.c +++ b/tests/pkg_semtech-loramac/main.c @@ -34,7 +34,7 @@ static char print_buf[LORAMAC_APPKEY_LEN * 2 + 1]; static void _loramac_usage(void) { - puts("Usage: loramac <get|set|join|tx>"); + puts("Usage: loramac <get|set|join|tx|link_check>"); } static void _loramac_join_usage(void) @@ -416,8 +416,25 @@ static int _cmd_loramac(int argc, char **argv) break; } + if (loramac.link_chk.available) { + printf("Link check information:\n" + " - Demodulation margin: %d\n" + " - Number of gateways: %d\n", + loramac.link_chk.demod_margin, + loramac.link_chk.nb_gateways); + } + return 0; } + else if (strcmp(argv[1], "link_check") == 0) { + if (argc > 2) { + _loramac_usage(); + return 1; + } + + semtech_loramac_request_link_check(&loramac); + puts("Link check request scheduled"); + } else { _loramac_usage(); return 1;