In this use case, an uplink message will be send.
- Note
- The driver must be initialised Initialise the driver and must be setup to OTAA OTAA setup steps or ABP OTAA setup steps.
In this example these two variables will be send in an uplink message
uint16_t hum;
int16_t temp;
Uplink Message Setup
The following must be added to a FreeRTOS task in the project:
- Define a payload struct variable
- Populate the payload struct with data
uplinkPayload.port_no = 1;
uplinkPayload.
bytes[0] = hum >> 8;
uplinkPayload.
bytes[1] = hum & 0xFF;
uplinkPayload.
bytes[2] = temp >> 8;
uplinkPayload.
bytes[3] = temp & 0xFF;
- Send the uplink message:
{
}
else if (rc == LORA_MAC_RX_OK)
{
}