Basic MAC 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, and supports multiple regions, which are selectable at compile and/or run time. It can handle Class A, Class B, and Class C devices.

The library takes care of all logical MAC states and timing constraints. It also directly drives the Semtech SX1272, SX1276, or SX1261/62 radios. This way, applications are free to perform other tasks, while the library guarantees protocol compliance. To ensure that the state engine complies with the specification and associated regulations, it 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. It even takes possible clock drifts in the timing computations into account.

Applications can access and configure all functionality through a simple event-based programming model. There is no need to deal with platform-specific details like interrupt handlers. By using a thin hardware abstraction layer (HAL), the library can be ported to new hardware platforms easily. 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 32 KB.

Here is a high-level view of all application device components.


The Basic MAC library and the application code run on top of hardware, which typically consists of an embedded MCU with a connected Semtech SX1272/76/61/62 radio and other sensor hardware.

Indices and tables