# lora-net/swl2001 architecture

> Architecture diagram of the GitHub repository lora-net/swl2001, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lora-net/swl2001
- Repository: https://github.com/lora-net/swl2001

## Overview

LoRa Basic Modem is an embedded LoRaWAN stack exposed through a modem API. The principal workflow is an application issuing modem commands, which the modem schedules and processes through LoRaWAN and radio layers before communicating over the radio. The README also documents FUOTA packages, relay operation, certification, and LoRa Edge geolocation. The tree and excerpts show only selected implementation details, so some documented capability links are dashed where their internal wiring is not evidenced.

Main entry points: [`lbm_lib/smtc_modem_api/smtc_modem_api.h`](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_api.h) (Modem API), [`lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c`](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c) (TX Protocol Manager), [`lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c`](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c) (Beacon TX Service), [`lbm_lib/smtc_modem_core/modem_supervisor/modem_supervisor_light.h`](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_supervisor_light.h) (Modem Supervisor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Application Interface"]
  node_modem_api["Modem API<br/>[smtc_modem_api.h]"]
  node_test_api["Test API"]
  node_geo_api["Geolocation API"]
end

subgraph group_protocol["LoRaWAN Stack"]
  node_supervisor["Modem Supervisor"]
  node_tx_manager["TX Protocol Manager"]
  node_lorawan_api["LoRaWAN API Layer<br/>[lorawan_api.h]"]
  node_mac_stack["LoRaWAN MAC"]
end

subgraph group_services["Modem Services"]
  node_fuota["FUOTA Packages"]
  node_relay["Relay RX Service"]
  node_beacon["Beacon TX Service"]
  node_certification["Certification"]
  node_geo_service["Geolocation Services"]
end

subgraph group_radio["Radio and Platform"]
  node_radio_planner["Radio Planner<br/>[radio_planner.h]"]
  node_lr11xx["LR11xx Driver"]
  node_hal["Modem HAL<br/>[smtc_modem_hal.h]"]
end

node_application(("Application"))
node_network(("LoRaWAN Network"))

node_application -.->|"issues commands"| node_modem_api
node_application -.->|"runs tests"| node_test_api
node_application -.->|"requests geolocation"| node_geo_api
node_modem_api -.->|"submits requests"| node_supervisor
node_test_api -.->|"selects test mode"| node_tx_manager
node_supervisor -.->|"schedules transmissions"| node_tx_manager
node_tx_manager -->|"uses LoRaWAN layer"| node_lorawan_api
node_tx_manager -.->|"coordinates radio"| node_radio_planner
node_lorawan_api -.->|"uses MAC"| node_mac_stack
node_mac_stack -.->|"exchanges frames"| node_network
node_modem_api -.->|"exposes package services"| node_fuota
node_modem_api -.->|"exposes relay features"| node_relay
node_modem_api -.->|"supports beacon service"| node_beacon
node_modem_api -.->|"supports certification"| node_certification
node_geo_api -.->|"provides geolocation"| node_geo_service
node_relay -->|"uses LoRaWAN layer"| node_lorawan_api
node_beacon -->|"uses supervisor"| node_supervisor
node_beacon -->|"schedules radio work"| node_radio_planner
node_radio_planner -.->|"dispatches radio work"| node_lr11xx
node_lr11xx -->|"sends chip commands"| node_hal

click node_modem_api "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_api.h"
click node_test_api "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_test_api.h"
click node_geo_api "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_geolocation_api.h"
click node_supervisor "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_supervisor_light.h"
click node_tx_manager "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c"
click node_lorawan_api "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/lorawan_api/lorawan_api.h"
click node_mac_stack "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/lr1mac/src/lr1_stack_mac_layer.h"
click node_fuota "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/lorawan_packages/fragmented_data_block_transport/v2.0.0/lorawan_fragmentation_package_v2.0.0.c"
click node_relay "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_services/relay_service/lorawan_relay_rx_service.c"
click node_beacon "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c"
click node_certification "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c"
click node_geo_service "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_geolocation_api.h"
click node_radio_planner "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_planner/src/radio_planner.h"
click node_lr11xx "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/lr11xx_driver/src/lr11xx_crypto_engine.c"
click node_hal "https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_hal/smtc_modem_hal.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_modem_api,node_test_api,node_geo_api toneBlue
class node_supervisor,node_tx_manager,node_lorawan_api,node_mac_stack toneAmber
class node_fuota,node_relay,node_beacon,node_certification,node_geo_service toneMint
class node_radio_planner,node_lr11xx,node_hal toneRose
class node_application,node_network toneIndigo
```

## Components

### Application Interface

- [Modem API](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_api.h): `lbm_lib/smtc_modem_api/smtc_modem_api.h`
- [Test API](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_test_api.h): `lbm_lib/smtc_modem_api/smtc_modem_test_api.h`
- [Geolocation API](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_geolocation_api.h): `lbm_lib/smtc_modem_api/smtc_modem_geolocation_api.h`

### LoRaWAN Stack

- [Modem Supervisor](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_supervisor_light.h): `lbm_lib/smtc_modem_core/modem_supervisor/modem_supervisor_light.h`
- [TX Protocol Manager](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c): `lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c`
- [LoRaWAN API Layer](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/lorawan_api/lorawan_api.h): `lbm_lib/smtc_modem_core/lorawan_api/lorawan_api.h`
- [LoRaWAN MAC](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/lr1mac/src/lr1_stack_mac_layer.h): `lbm_lib/smtc_modem_core/lr1mac/src/lr1_stack_mac_layer.h`

### Modem Services

- [FUOTA Packages](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/lorawan_packages/fragmented_data_block_transport/v2.0.0/lorawan_fragmentation_package_v2.0.0.c): `lbm_lib/smtc_modem_core/lorawan_packages/fragmented_data_block_transport/v2.0.0/lorawan_fragmentation_package_v2.0.0.c`
- [Relay RX Service](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_services/relay_service/lorawan_relay_rx_service.c): `lbm_lib/smtc_modem_core/modem_services/relay_service/lorawan_relay_rx_service.c`
- [Beacon TX Service](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c): `lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c`
- [Certification](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c): `lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c`
- [Geolocation Services](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_api/smtc_modem_geolocation_api.h): `lbm_lib/smtc_modem_api/smtc_modem_geolocation_api.h`

### Radio and Platform

- [Radio Planner](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_planner/src/radio_planner.h): `lbm_lib/smtc_modem_core/radio_planner/src/radio_planner.h`
- [LR11xx Driver](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_core/radio_drivers/lr11xx_driver/src/lr11xx_crypto_engine.c): `lbm_lib/smtc_modem_core/radio_drivers/lr11xx_driver/src/lr11xx_crypto_engine.c`
- [Modem HAL](https://github.com/lora-net/swl2001/blob/master/lbm_lib/smtc_modem_hal/smtc_modem_hal.h): `lbm_lib/smtc_modem_hal/smtc_modem_hal.h`

### Other components

- **Application**
- **LoRaWAN Network**

## Connections

- Application → Modem API: issues commands (evidence: `README.md`)
- Application → Test API: runs tests (evidence: `README.md`)
- Application → Geolocation API: requests geolocation (evidence: `README.md`)
- Modem API → Modem Supervisor: submits requests
- Test API → TX Protocol Manager: selects test mode (evidence: `lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c`)
- Modem Supervisor → TX Protocol Manager: schedules transmissions (evidence: `lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c`)
- TX Protocol Manager → LoRaWAN API Layer: uses LoRaWAN layer (evidence: `lbm_lib/smtc_modem_core/modem_supervisor/modem_tx_protocol_manager.c`)
- TX Protocol Manager → Radio Planner: coordinates radio
- LoRaWAN API Layer → LoRaWAN MAC: uses MAC (evidence: `lbm_lib/smtc_modem_core/lorawan_api/lorawan_api.h`)
- LoRaWAN MAC → LoRaWAN Network: exchanges frames (evidence: `README.md`)
- Modem API → FUOTA Packages: exposes package services (evidence: `README.md`)
- Modem API → Relay RX Service: exposes relay features (evidence: `README.md`)
- Modem API → Beacon TX Service: supports beacon service (evidence: `lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c`)
- Modem API → Certification: supports certification (evidence: `README.md`)
- Geolocation API → Geolocation Services: provides geolocation (evidence: `README.md`)
- Relay RX Service → LoRaWAN API Layer: uses LoRaWAN layer (evidence: `lbm_lib/smtc_modem_core/modem_services/relay_service/lorawan_relay_rx_service.c`)
- Beacon TX Service → Modem Supervisor: uses supervisor (evidence: `lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c`)
- Beacon TX Service → Radio Planner: schedules radio work (evidence: `lbm_lib/smtc_modem_core/modem_services/beacon_tx_service/lorawan_beacon_tx_service_example.c`)
- Radio Planner → LR11xx Driver: dispatches radio work
- LR11xx Driver → Modem HAL: sends chip commands (evidence: `lbm_lib/smtc_modem_core/radio_drivers/lr11xx_driver/src/lr11xx_crypto_engine.c`)
