L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
lora_app.h File Reference

Header of application of the LRWAN Middleware. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACTIVE_REGION   LORAMAC_REGION_EU868
#define APP_TX_DUTYCYCLE   10000
#define LORAWAN_USER_APP_PORT   2
#define LORAWAN_SWITCH_CLASS_PORT   3
#define LORAWAN_DEFAULT_CLASS   CLASS_A
#define LORAWAN_DEFAULT_CONFIRMED_MSG_STATE   LORAMAC_HANDLER_CONFIRMED_MSG
#define LORAWAN_ADR_STATE   LORAMAC_HANDLER_ADR_ON
#define LORAWAN_DEFAULT_DATA_RATE   DR_0
#define LORAWAN_DEFAULT_TX_POWER   TX_POWER_0
#define LORAWAN_DEFAULT_ACTIVATION_TYPE   ACTIVATION_TYPE_OTAA
#define LORAWAN_FORCE_REJOIN_AT_BOOT   false
#define LORAWAN_APP_DATA_BUFFER_MAX_SIZE   242
#define LORAWAN_DEFAULT_PING_SLOT_PERIODICITY   4
#define LORAWAN_DEFAULT_CLASS_B_C_RESP_TIMEOUT   8000

Functions

void LoRaWAN_Init (void)
 Init Lora Application.
void systemParams_SetLoRaWanParams ()
 
  • set the lorawan parameters from _systemParams before start of loraWan

Detailed Description

Header of application of the LRWAN Middleware.

Author
MCD Application Team
Attention

Copyright (c) 2026 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file lora_app.h.

Macro Definition Documentation

◆ ACTIVE_REGION

#define ACTIVE_REGION   LORAMAC_REGION_EU868

Definition at line 42 of file lora_app.h.

◆ APP_TX_DUTYCYCLE

#define APP_TX_DUTYCYCLE   10000

CAYENNE_LPP is myDevices Application server.

Defines the application data transmission duty cycle. 10s, value in [ms].

Definition at line 54 of file lora_app.h.

Referenced by OnTxPeriodicityChanged().

◆ LORAWAN_ADR_STATE

#define LORAWAN_ADR_STATE   LORAMAC_HANDLER_ADR_ON

LoRaWAN Adaptive Data Rate

Note
Please note that when ADR is enabled the end-device should be static

Definition at line 82 of file lora_app.h.

◆ LORAWAN_APP_DATA_BUFFER_MAX_SIZE

#define LORAWAN_APP_DATA_BUFFER_MAX_SIZE   242

User application data buffer size

Definition at line 111 of file lora_app.h.

◆ LORAWAN_DEFAULT_ACTIVATION_TYPE

#define LORAWAN_DEFAULT_ACTIVATION_TYPE   ACTIVATION_TYPE_OTAA

LoRaWAN default activation type

Definition at line 100 of file lora_app.h.

Referenced by myLoraWan_Reconnect(), OnStopJoinTimerEvent(), and StopJoin().

◆ LORAWAN_DEFAULT_CLASS

#define LORAWAN_DEFAULT_CLASS   CLASS_A

LoRaWAN default class

Definition at line 71 of file lora_app.h.

◆ LORAWAN_DEFAULT_CLASS_B_C_RESP_TIMEOUT

#define LORAWAN_DEFAULT_CLASS_B_C_RESP_TIMEOUT   8000

Default response timeout for class b and class c confirmed downlink frames in milli seconds.

The value shall not be smaller than RETRANSMIT_TIMEOUT plus the maximum time on air.

Definition at line 128 of file lora_app.h.

◆ LORAWAN_DEFAULT_CONFIRMED_MSG_STATE

#define LORAWAN_DEFAULT_CONFIRMED_MSG_STATE   LORAMAC_HANDLER_CONFIRMED_MSG

LoRaWAN default confirm state

Definition at line 76 of file lora_app.h.

◆ LORAWAN_DEFAULT_DATA_RATE

#define LORAWAN_DEFAULT_DATA_RATE   DR_0

LoRaWAN Default Data Rate

Note
Please note that LORAWAN_DEFAULT_DATA_RATE is used only when LORAWAN_ADR_STATE is disabled

Definition at line 88 of file lora_app.h.

◆ LORAWAN_DEFAULT_PING_SLOT_PERIODICITY

#define LORAWAN_DEFAULT_PING_SLOT_PERIODICITY   4

Default Unicast ping slots periodicity

Remarks
periodicity is equal to 2^LORAWAN_DEFAULT_PING_SLOT_PERIODICITY seconds example: 2^4 = 16 seconds. The end-device will open an Rx slot every 16 seconds.

Definition at line 119 of file lora_app.h.

◆ LORAWAN_DEFAULT_TX_POWER

#define LORAWAN_DEFAULT_TX_POWER   TX_POWER_0

LoRaWAN Default Tx output power

Note
LORAWAN_DEFAULT_TX_POWER must be defined in the [XXXX_MIN_TX_POWER - XXXX_MAX_TX_POWER] range, else the end-device uses the XXXX_DEFAULT_TX_POWER value

Definition at line 95 of file lora_app.h.

◆ LORAWAN_FORCE_REJOIN_AT_BOOT

#define LORAWAN_FORCE_REJOIN_AT_BOOT   false

LoRaWAN force rejoin even if the NVM context is restored

Note
useful only when context management is enabled by CONTEXT_MANAGEMENT_ENABLED

Definition at line 106 of file lora_app.h.

◆ LORAWAN_SWITCH_CLASS_PORT

#define LORAWAN_SWITCH_CLASS_PORT   3

LoRaWAN Switch class application port

Note
do not use 224. It is reserved for certification

Definition at line 66 of file lora_app.h.

◆ LORAWAN_USER_APP_PORT

#define LORAWAN_USER_APP_PORT   2

LoRaWAN User application port

Note
do not use 224. It is reserved for certification

Definition at line 60 of file lora_app.h.

Function Documentation

◆ LoRaWAN_Init()

void LoRaWAN_Init ( void )

Init Lora Application.

< [31:24] main version

< main byte shift

< [23:16] sub1 version

< sub1 byte shift

< [15:8] sub2 version

< sub2 byte shift

< [7:0] release candidate

< release candidate byte shift

Definition at line 310 of file lora_app.c.

References ActivationType, APP_LOG, APP_VERSION, CFG_SEQ_Task_LmHandlerProcess, CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent, CFG_SEQ_Task_LoRaStopJoinEvent, CFG_SEQ_Task_LoRaStoreContextEvent, EventType, ForceRejoin, JOIN_TIME, LmHandlerCallbacks, LmHandlerParams, LoraInfo_Init(), OnStopJoinTimerEvent(), OnTxTimerEvent(), SendTxData(), StopJoin(), StopJoinTimer, StoreContext(), systemParams_getAppDevEUI(), systemParams_getAppEUI(), systemParams_getAppKey(), TS_OFF, TX_ON_TIMER, TxPeriodicity, TxTimer, and VLEVEL_M.

Referenced by main(), and MX_LoRaWAN_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ systemParams_SetLoRaWanParams()

void systemParams_SetLoRaWanParams ( )

  • set the lorawan parameters from _systemParams before start of loraWan

Definition at line 300 of file lora_app.c.

References _systemParams, and LmHandlerParams.

Referenced by main().

Here is the caller graph for this function: