Skip to content
Snippets Groups Projects
Unverified Commit afc85e3d authored by Alexandre Abadie's avatar Alexandre Abadie
Browse files

pkg/semtech-loramac: improve send and recv functions doc

parent 1f0b2c39
No related branches found
No related tags found
No related merge requests found
......@@ -828,6 +828,9 @@ uint8_t semtech_loramac_send(semtech_loramac_t *mac, uint8_t *data, uint8_t len)
return SEMTECH_LORAMAC_NOT_JOINED;
}
/* Correctly set the caller pid */
mac->caller_pid = thread_getpid();
loramac_send_params_t params;
params.payload = data;
params.len = len;
......
......@@ -149,17 +149,22 @@ uint8_t semtech_loramac_join(semtech_loramac_t *mac, uint8_t type);
/**
* @brief Sends data to the LoRaWAN network
*
* This function returns immediately and leave the mac in busy state until a
* message is received from the network (with RX1 and RX2 receive windows).
* 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.
*
* @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_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_TX_SCHEDULED when the TX is scheduled in the mac
* @return SEMTECH_LORAMAC_DUTYCYCLE_RESTRICTED when the send is rejected because of dutycycle restriction
* @return SEMTECH_LORAMAC_TX_ERROR when an invalid parameter is given
*/
uint8_t semtech_loramac_send(semtech_loramac_t *mac, uint8_t *data, uint8_t len);
......@@ -172,6 +177,9 @@ uint8_t semtech_loramac_send(semtech_loramac_t *mac, uint8_t *data, uint8_t len)
* class C device, a message can be received at any time. In this case, this
* function can be used in a dedicated listener thread.
*
* Be sure to call this function before the end of the RX windows otherwise it
* may block the calling thread.
*
* @see semtech_loramac_send
*
* @param[in] mac Pointer to the mac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment