27#include "stm32_timer.h"
30#include "lorawan_version.h"
31#include "subghz_phy_version.h"
40#include "secure-element.h"
54typedef enum TxEventType_e
77#define LED_PERIOD_TIME 500
91#define LORAWAN_NVM_BASE_ADDRESS ((void *)0x0803F000UL)
125static void OnTxData(LmHandlerTxParams_t *params);
132static void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params);
344 SecureElementPrintKeys();
401static void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params)
445 if (joinParams != NULL && joinParams->Status == LORAMAC_HANDLER_SUCCESS)
533 if ((LORAMAC_HANDLER_SUCCESS == LmHandlerHalt()) && (LmHandlerJoinStatus() == LORAMAC_HANDLER_SET))
550 if (LORAMAC_HANDLER_SUCCESS != LmHandlerStop())
593 LmHandlerErrorStatus_t status = LORAMAC_HANDLER_ERROR;
598 status = LmHandlerNvmDataStore();
600 if (status == LORAMAC_HANDLER_NVM_DATA_UP_TO_DATE)
604 else if (status == LORAMAC_HANDLER_ERROR)
618 if (state == LORAMAC_HANDLER_NVM_STORE)
Implements the Cayenne Low Power Protocol.
Header for ADC interface configuration.
Definition the version of the application.
#define APP_VERSION
Application version.
This file contains definitions for FLASH Interface functionalities.
FLASH_IF_StatusTypedef FLASH_IF_Write(void *pDestination, const void *pSource, uint32_t uLength)
This function writes a data buffer in internal or external flash.
FLASH_IF_StatusTypedef FLASH_IF_Read(void *pDestination, const void *pSource, uint32_t uLength)
This function reads a amount of data from flash and copy into the output data buffer.
static ActivationType_t ActivationType
LoRaWAN default activation type.
static UTIL_TIMER_Time_t TxPeriodicity
Tx Timer period.
static void OnSysTimeUpdate(void)
callback when system time has been updated
static void OnTxData(LmHandlerTxParams_t *params)
callback when LoRaWAN application has sent a frame
static void OnSystemReset(void)
Will be called to reset the system.
static void OnTxFrameCtrlChanged(LmHandlerMsgTypes_t isTxConfirmed)
Change the confirmation control of the uplink frames.
static void OnStoreContextRequest(void *nvm, uint32_t nvm_size)
Store the NVM Data context to the Flash.
static LmHandlerCallbacks_t LmHandlerCallbacks
LoRaWAN handler Callbacks.
static void OnNvmDataChange(LmHandlerNvmContextStates_t state)
Notifies the upper layer that the NVM context has changed.
static TxEventType_t EventType
Type of Event to generate application Tx.
static LmHandlerParams_t LmHandlerParams
LoRaWAN handler parameters.
static void OnStopJoinTimerEvent(void *context)
Join switch timer callback function.
static void OnTxTimerEvent(void *context)
TX timer callback function.
static void StopJoin(void)
stop current LoRa execution to switch into non default Activation mode
static void OnClassChange(DeviceClass_t deviceClass)
callback when LoRaWAN application Class is changed
TxEventType_t
LoRa State Machine states.
@ TX_ON_EVENT
Appdata Transmission external event plugged on OnSendEvent( ).
@ TX_ON_TIMER
Appdata Transmission issue based on timer every TxDutyCycleTime.
#define LORAWAN_NVM_BASE_ADDRESS
LoRaWAN NVM Flash address.
static UTIL_TIMER_Object_t StopJoinTimer
Join Timer period.
static void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params)
callback when LoRaWAN application has received a frame
static void OnMacProcessNotify(void)
static void OnTxPeriodicityChanged(uint32_t periodicity)
Change the periodicity of the uplink frames.
void LoRaWAN_Init(void)
Init Lora Application.
static void OnPingSlotPeriodicityChanged(uint8_t pingSlotPeriodicity)
Change the periodicity of the ping slot frames.
static void OnRestoreContextRequest(void *nvm, uint32_t nvm_size)
Restore the NVM Data context from the Flash.
static void SendTxData(void)
LoRa End Node send request.
static void OnBeaconStatusChange(LmHandlerBeaconParams_t *params)
callback when LoRaWAN Beacon status is updated
static bool ForceRejoin
LoRaWAN force rejoin even if the NVM context is restored.
static void StoreContext(void)
LoRa store context in Non Volatile Memory.
static void OnJoinRequest(LmHandlerJoinParams_t *joinParams)
join event callback function
void systemParams_SetLoRaWanParams()
set the lorawan parameters from _systemParams before start of loraWan
static UTIL_TIMER_Object_t TxTimer
Timer to handle the application Tx.
Header of application of the LRWAN Middleware.
#define LORAWAN_DEFAULT_ACTIVATION_TYPE
#define LORAWAN_ADR_STATE
#define LORAWAN_DEFAULT_CLASS_B_C_RESP_TIMEOUT
#define LORAWAN_DEFAULT_PING_SLOT_PERIODICITY
#define LORAWAN_DEFAULT_DATA_RATE
#define LORAWAN_FORCE_REJOIN_AT_BOOT
#define LORAWAN_DEFAULT_CONFIRMED_MSG_STATE
#define LORAWAN_DEFAULT_CLASS
#define LORAWAN_DEFAULT_TX_POWER
void LoraInfo_Init(void)
initialize the LoraInfo table
To give info to the application about LoRaWAN configuration.
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
called from GPIO interrupt
void OnTimeSynchronized(void)
Called after date/time has been synchronized from LoRaWAN.
void OnLoRaWANRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params)
Handle received downlink data from LoRaWAN server.
void OnLoRaWanConnected(void)
Called after LoRaWAN successfully connects to the server.
void OnLoRaWANTxData(LmHandlerTxParams_t *params)
Handle transmission event callback.
systemParams_t _systemParams
uint8_t * systemParams_getAppKey()
Return a pointer to the AppKey stored in _systemParams. Used by the LoRaWAN stack to derive session k...
uint8_t * systemParams_getAppEUI()
Return a pointer to the AppEUI (JoinEUI) stored in _systemParams. Used by the LoRaWAN stack during th...
uint8_t * systemParams_getAppDevEUI()
Return a pointer to the DevEUI stored in _systemParams. The DevEUI is auto-generated from the chip UI...
Function prototypes for sys_app.c file.
void GetDevAddr(uint32_t *devAddr)
callback to get the board 32 bits unique ID (LSB)
#define APP_LOG(TS, VL,...)
int16_t GetTemperatureLevel(void)
callback to get the current temperature in the MCU
void GetUniqueId(uint8_t *id)
callback to get the board 64 bits unique ID
uint8_t GetBatteryLevel(void)
callback to get the battery level in % of full charge (254 full charge, 0 no charge)
Header for sensors application.
Definitions for modules requiring utilities.
@ CFG_SEQ_Task_LoRaSendOnTxTimerOrButtonEvent
@ CFG_SEQ_Task_LoRaStopJoinEvent
@ CFG_SEQ_Task_LoRaStoreContextEvent
@ CFG_SEQ_Task_LmHandlerProcess