1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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
This commit is contained in:
Alexandre Abadie 2019-04-10 08:20:40 +02:00
parent 2c76637abe
commit 1f57c0bd2e
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -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) {