Definition: This API starts a bidirectional communication process and initiates the data packet send procedure. This API returns immediately after copying the data payload to MAC buffer and posting a task to MAC scheduler. MAC transmits the data packet and wait for down-link packet(s). After down-link procedure is completed, MAC layer calls the application callback function and that ends this API procedure.
Syntax
StackRetStatus_t LORAWAN_Send (LorawanSendReq_t *lorasendreq);
Input Parameters
Parameter Name |
Parameter Type |
Description |
---|---|---|
lorasendreq |
LorawanSendReq_t |
LoRaWAN send request –
|
Return Type and Values
Parameter Name |
Parameter Type |
Description |
---|---|---|
|
ENUM |
Enumerated values containing all return types from LoRaWAN layers |
Return Value |
Reason |
---|---|
LORAWAN_SUCCESS |
LoRaWAN send request is successfully initiated |
LORAWAN_MAC_PAUSED |
LoRaWAN MAC layer is paused. Join procedure will only happen in Active state |
LORAWAN_SILENT_IMMEDIATELY_ACTIVE |
The server decided that any further up-link transmission is not possible from this end device |
LORAWAN_INVALID_PARAMETER |
Port number is wrong |
LORAWAN_BUSY |
MAC layer is not IDLE. Until other transaction is completed, MAC cannot initiate data packet send procedure |
LORAWAN_NWK_NOT_JOINED |
LoRaWAN end device is not joined to the network |
LORAWAN_INVALID_BUFFER_LENGTH |
Buffer length exceeds maximum payload size |
LORAWAN_FCNTR_ERROR_REJOIN_NEEDED |
Re-joining is required. |
API Type – Asynchronous