Skip to content

Commit

Permalink
Merge pull request #11869 from fjmolinas/pr_lorawan_retcode
Browse files Browse the repository at this point in the history
 examples/lorawan: fix semtech_loramac_send TX ret code
  • Loading branch information
leandrolanzieri authored Jul 19, 2019
2 parents 43a5eef + cdf687c commit c7f8012
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/lorawan/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void _send_message(void)
/* Try to send the message */
uint8_t ret = semtech_loramac_send(&loramac,
(uint8_t *)message, strlen(message));
if (ret != SEMTECH_LORAMAC_TX_OK) {
if (ret != SEMTECH_LORAMAC_TX_DONE) {
printf("Cannot send message '%s', ret code: %d\n", message, ret);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/semtech-loramac/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
* /* 4. send some data */
* char *message = "This is RIOT";
* if (semtech_loramac_send(&loramac,
* (uint8_t *)message, strlen(message)) != SEMTECH_LORAMAC_TX_OK) {
* (uint8_t *)message, strlen(message)) != SEMTECH_LORAMAC_TX_DONE) {
printf("Cannot send message '%s'\n", message);
* return 1;
* }
Expand Down
4 changes: 2 additions & 2 deletions pkg/semtech-loramac/include/semtech_loramac.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ uint8_t semtech_loramac_join(semtech_loramac_t *mac, uint8_t type);
* This function returns after TX status is replied from the MAC. To receive
* potential messages sent from the network an explicit call to
* @ref semtech_loramac_recv must be done after this function if it returned
* @ref SEMTECH_LORAMAC_TX_OK and within the RX windows delays.
* @ref SEMTECH_LORAMAC_TX_DONE and within the RX windows delays.
*
* @see semtech_loramac_recv
*
* @param[in] mac Pointer to the mac
* @param[in] data The TX data
* @param[in] len The length of the TX data
*
* @return SEMTECH_LORAMAC_TX_OK when the message can be transmitted
* @return SEMTECH_LORAMAC_TX_DONE when the message was transmitted
* @return SEMTECH_LORAMAC_NOT_JOINED when the network is not joined
* @return SEMTECH_LORAMAC_BUSY when the mac is already active (join or tx in progress)
* @return SEMTECH_LORAMAC_DUTYCYCLE_RESTRICTED when the send is rejected because of dutycycle restriction
Expand Down

0 comments on commit c7f8012

Please sign in to comment.