LoRaMAC
4.7.0
Documentation of the API
|
The repository comes with the following directories on top level:
Directory | Description |
---|---|
cmake | CMake scripts and helpers |
doc | Documentation |
src | Source code |
The most important directory is the 'src' directory:
Directory | Description |
---|---|
apps | Application examples |
boards | Contains board specific implementations of hardware platform drivers |
mac | The LoRaMAC sources |
peripherals | This directory contains drivers for peripherals which are available on some hardware platforms |
radio | The radio driver implementations |
system | Generic abstraction layer for the different hardware platforms |
In general, the motivation is to provide a simple and well defined project structure to allow a fast an easy porting to another platform. This project comes with several examples of hardware platforms, e.g. the NucleoL476, B-L072Z-LRWAN1, etc.. The hardware platform implementations are available at the directory 'src/boards'. If you want to add a new hardware platform, you have to perform the following tasks:
The RX window calculation is implemented according to chapter 3.1.2 of the following documents:
AN1200.23 SX1272 Settings for LoRaWAN or AN1200.24 SX1276 Settings for LoRaWAN
TRxLate = DEFAULT_MIN_RX_SYMBOLS * tSymbol - RADIO_WAKEUP_TIME
TRxEarly = 8 - DEFAULT_MIN_RX_SYMBOLS * tSymbol - RxWindowTimeout - RADIO_WAKEUP_TIME
TRxLate - TRxEarly = 2 * DEFAULT_SYSTEM_MAX_RX_ERROR
RxOffset = ( TRxLate + TRxEarly ) / 2
RxWindowTimeout = ( 2 * DEFAULT_MIN_RX_SYMBOLS - 8 ) * tSymbol + 2 * DEFAULT_SYSTEM_MAX_RX_ERROR
RxOffset = 4 * tSymbol - RxWindowTimeout / 2 - RADIO_WAKE_UP_TIME
Minimal value of RxWindowTimeout must be 5 symbols which implies that the system always tolerates at least an error of 1.5 * tSymbol.
The LoRaMAC stack supports a runtime calibration of the RX window timing. As described in section RX Window Calculation, the RX window timing especially depends on DEFAULT_SYSTEM_MAX_RX_ERROR and DEFAULT_MIN_RX_SYMBOLS. The related MIB types are MIB_SYSTEM_MAX_RX_ERROR and MIB_MIN_RX_SYMBOLS.
The following code snippet shows how to update those values during runtime: