From 7bfef117fc68d9767f8f5013a5ab0f1e0fa46cf4 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 25 Sep 2018 09:44:14 +0200 Subject: [PATCH] tests/pkg_semtech-loramac: use new return codes in application --- tests/pkg_semtech-loramac/main.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/pkg_semtech-loramac/main.c b/tests/pkg_semtech-loramac/main.c index 77fae587cf..e0e7ba42e4 100644 --- a/tests/pkg_semtech-loramac/main.c +++ b/tests/pkg_semtech-loramac/main.c @@ -353,12 +353,18 @@ static int _cmd_loramac(int argc, char **argv) } switch (semtech_loramac_join(&loramac, join_type)) { - case SEMTECH_LORAMAC_RESTRICTED: - puts("Cannot join: all channels are blocked (duty cycle)!"); + case SEMTECH_LORAMAC_DUTYCYCLE_RESTRICTED: + puts("Cannot join: dutycycle restriction"); + return 1; + case SEMTECH_LORAMAC_BUSY: + puts("Cannot join: mac is busy"); return 1; case SEMTECH_LORAMAC_JOIN_FAILED: puts("Join procedure failed!"); return 1; + case SEMTECH_LORAMAC_ALREADY_JOINED: + puts("Warning: already joined!"); + return 1; case SEMTECH_LORAMAC_JOIN_SUCCEEDED: puts("Join procedure succeeded!"); break; @@ -420,9 +426,17 @@ static int _cmd_loramac(int argc, char **argv) (char *)loramac.rx_data.payload, loramac.rx_data.port); break; - case SEMTECH_LORAMAC_TX_CNF_FAILED: - puts("Confirmable TX failed"); - break; + case SEMTECH_LORAMAC_DUTYCYCLE_RESTRICTED: + puts("Cannot send: dutycycle restriction"); + return 1; + + case SEMTECH_LORAMAC_BUSY: + puts("Cannot send: MAC is busy"); + return 1; + + case SEMTECH_LORAMAC_TX_ERROR: + puts("Cannot send: error"); + return 1; case SEMTECH_LORAMAC_TX_DONE: puts("TX complete, no data received");