L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
lora_app.h
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
2/**
3 ******************************************************************************
4 * @file lora_app.h
5 * @author MCD Application Team
6 * @brief Header of application of the LRWAN Middleware
7 ******************************************************************************
8 * @attention
9 *
10 * Copyright (c) 2026 STMicroelectronics.
11 * All rights reserved.
12 *
13 * This software is licensed under terms that can be found in the LICENSE file
14 * in the root directory of this software component.
15 * If no LICENSE file comes with this software, it is provided AS-IS.
16 *
17 ******************************************************************************
18 */
19/* USER CODE END Header */
20
21/* Define to prevent recursive inclusion -------------------------------------*/
22#ifndef __LORA_APP_H__
23#define __LORA_APP_H__
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30/* USER CODE BEGIN Includes */
31
32/* USER CODE END Includes */
33
34/* Exported types ------------------------------------------------------------*/
35/* USER CODE BEGIN ET */
36
37/* USER CODE END ET */
38
39/* Exported constants --------------------------------------------------------*/
40
41/* LoraWAN application configuration (Mw is configured by lorawan_conf.h) */
42#define ACTIVE_REGION LORAMAC_REGION_EU868
43
44/* USER CODE BEGIN EC_CAYENNE_LPP */
45/*!
46 * CAYENNE_LPP is myDevices Application server.
47 */
48/*#define CAYENNE_LPP*/
49/* USER CODE END EC_CAYENNE_LPP */
50
51/*!
52 * Defines the application data transmission duty cycle. 10s, value in [ms].
53 */
54#define APP_TX_DUTYCYCLE 10000
55
56/*!
57 * LoRaWAN User application port
58 * @note do not use 224. It is reserved for certification
59 */
60#define LORAWAN_USER_APP_PORT 2
61
62/*!
63 * LoRaWAN Switch class application port
64 * @note do not use 224. It is reserved for certification
65 */
66#define LORAWAN_SWITCH_CLASS_PORT 3
67
68/*!
69 * LoRaWAN default class
70 */
71#define LORAWAN_DEFAULT_CLASS CLASS_A
72
73/*!
74 * LoRaWAN default confirm state
75 */
76#define LORAWAN_DEFAULT_CONFIRMED_MSG_STATE LORAMAC_HANDLER_CONFIRMED_MSG
77
78/*!
79 * LoRaWAN Adaptive Data Rate
80 * @note Please note that when ADR is enabled the end-device should be static
81 */
82#define LORAWAN_ADR_STATE LORAMAC_HANDLER_ADR_ON
83
84/*!
85 * LoRaWAN Default Data Rate
86 * @note Please note that LORAWAN_DEFAULT_DATA_RATE is used only when LORAWAN_ADR_STATE is disabled
87 */
88#define LORAWAN_DEFAULT_DATA_RATE DR_0
89
90/*!
91 * LoRaWAN Default Tx output power
92 * @note LORAWAN_DEFAULT_TX_POWER must be defined in the [XXXX_MIN_TX_POWER - XXXX_MAX_TX_POWER] range,
93 else the end-device uses the XXXX_DEFAULT_TX_POWER value
94 */
95#define LORAWAN_DEFAULT_TX_POWER TX_POWER_0
96
97/*!
98 * LoRaWAN default activation type
99 */
100#define LORAWAN_DEFAULT_ACTIVATION_TYPE ACTIVATION_TYPE_OTAA
101
102/*!
103 * LoRaWAN force rejoin even if the NVM context is restored
104 * @note useful only when context management is enabled by CONTEXT_MANAGEMENT_ENABLED
105 */
106#define LORAWAN_FORCE_REJOIN_AT_BOOT false
107
108/*!
109 * User application data buffer size
110 */
111#define LORAWAN_APP_DATA_BUFFER_MAX_SIZE 242
112
113/*!
114 * Default Unicast ping slots periodicity
115 *
116 * \remark periodicity is equal to 2^LORAWAN_DEFAULT_PING_SLOT_PERIODICITY seconds
117 * example: 2^4 = 16 seconds. The end-device will open an Rx slot every 16 seconds.
118 */
119#define LORAWAN_DEFAULT_PING_SLOT_PERIODICITY 4
120
121/*!
122 * Default response timeout for class b and class c confirmed
123 * downlink frames in milli seconds.
124 *
125 * The value shall not be smaller than RETRANSMIT_TIMEOUT plus
126 * the maximum time on air.
127 */
128#define LORAWAN_DEFAULT_CLASS_B_C_RESP_TIMEOUT 8000
129
130/* USER CODE BEGIN EC */
131
132/* USER CODE END EC */
133
134/* Exported macros -----------------------------------------------------------*/
135/* USER CODE BEGIN EM */
136
137/* USER CODE END EM */
138
139/* Exported functions prototypes ---------------------------------------------*/
140/**
141 * @brief Init Lora Application
142 */
143void LoRaWAN_Init(void);
144
145/* USER CODE BEGIN EFP */
146
147/**
148 * @brief - set the lorawan parameters from _systemParams before start of loraWan
149 */
151
152/* USER CODE END EFP */
153
154#ifdef __cplusplus
155}
156#endif
157
158#endif /*__LORA_APP_H__*/
void LoRaWAN_Init(void)
Init Lora Application.
Definition lora_app.c:310
void systemParams_SetLoRaWanParams()
set the lorawan parameters from _systemParams before start of loraWan
Definition lora_app.c:300