LORAWAN_Send

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

Table 1. Input Parameter

Parameter Name

Parameter Type

Description

lorasendreq

LorawanSendReq_t

LoRaWAN send request –

  1. 1.Transmission type
  2. 2.Port value
  3. 3.Pointer to application payload buffer
  4. 4.Length of application payload

Return Type and Values

Table 2. Return Type

Parameter Name

Parameter Type

Description

StackRetStatus_t

ENUM

Enumerated values containing all return types from LoRaWAN layers

Table 3. Return Values

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