From 1f57c0bd2eb580f0db6c038c4c91997bc233fa93 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 10 Apr 2019 08:20:40 +0200 Subject: [PATCH] pkg/semtech-loramac: update send function snippet If the send fails, just return. This avoid recv to be stuck afterward and shows a good practice --- pkg/semtech-loramac/doc.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/semtech-loramac/doc.txt b/pkg/semtech-loramac/doc.txt index 074cc74496..0c4075cf03 100644 --- a/pkg/semtech-loramac/doc.txt +++ b/pkg/semtech-loramac/doc.txt @@ -89,7 +89,11 @@ * * /* 4. send some data */ * char *message = "This is RIOT"; - * semtech_loramac_send(&loramac, (uint8_t *)message, strlen(message)); + * if (semtech_loramac_send(&loramac, + * (uint8_t *)message, strlen(message)) != SEMTECH_LORAMAC_TX_OK) { + printf("Cannot send message '%s'\n", message); + * return 1; + * } * * /* 5. wait for any potentially received data */ * if (semtech_loramac_recv(&loramac) == SEMTECH_LORAMAC_DATA_RECEIVED) {