LoRa Basics MAC
LoRa Basics MAC is is a portable implementation of the LoRa™ Alliance’s LoRaWAN™ specification in the C programming language. It is a fork of IBM’s LMiC library. It supports multiple regions, selectable at compile- and/or run-time, and it can handle class A, class B, and class C devices.
The library takes care of all logical MAC states and timing constraints and directly drives the Semtech SX1272, SX1276, or SX1261/62 radios. This way, applications are free to perform other tasks while protocol compliance is guaranteed by the library. In order to ensure compliance with the specification and associated regulations, the state engine has been tested and verified using a logic simulation environment. The library has been carefully engineered to precisely satisfy the timing constraints of the LoRaWAN protocol and to even consider possible clock drifts in the timing computations.
Applications can access and configure all functionality via a simple event-based programming model and do not have to deal with platform-specific details like interrupt handlers. By using a thin hardware abstraction layer (HAL), the library can be easily ported to new hardware platforms. For the STM32L0 platform, a reference implementation of the HAL is supplied and the overall code footprint of all components on this platform is less than 20K.
High-level view of all application device components. On top of the hardware, typically consisting of an embedded MCU with a connected Semtech SX1272/76/61/62 radio and other sensor hardware, runs the Basic MAC library and the application code.