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:
parent
2c76637abe
commit
1f57c0bd2e
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user