# siliconlabs/wfx-fullmac-tools architecture

> Architecture diagram of the GitHub repository siliconlabs/wfx-fullmac-tools, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siliconlabs/wfx-fullmac-tools
- Repository: https://github.com/siliconlabs/wfx-fullmac-tools

## Overview

##### Main Components

a) Hardware Layer:
- WF200/WFM200/WGM160P Wi-Fi Modules
- Silicon Labs Starter Kit
- Development Board Components (LEDs, UART)

b) Operating System Layer:
- Micrium OS (Real-time OS)

c) Protocol Stacks:
- Wi-Fi FMAC Driver
- LwIP TCP/IP Stack
- Bluetooth Stack
- MQTT Stack
- TLS Security Layer (Mbed TLS)

d) Applications:
- WiFi CLI
- Secured MQTT
- Ethernet Bridge
- Multiprotocol Demo

**Hardware Layer**
**↑**
**Driver Layer (FMAC, Network Interfaces)**
**↑**
**OS Layer (Micrium OS)**
**↑**
**Protocol Layer (LwIP, BLE Stack, Security)**
**↑**
**Application Layer**

##### Key Relationships

a) Data Flow:
- Bidirectional communication between Wi-Fi module and FMAC driver
- Network stack integration with LwIP
- MQTT over TLS connection path
- BLE protocol stack interaction

b) Component Integration:
- Bridge between Ethernet and SoftAP interfaces
- UART CLI interface connections
- Security certificate handling for MQTT
- NVM3 storage integration

Create distinct sections for:
a) Core Infrastructure:
- OS and driver components
- Network stacks
- Security modules

b) Applications:
- Four main applications as separate but connected modules
- Their dependencies on lower layers

c) External Interfaces:
- UART CLI
- Network connections
- BLE connections
- Web interface

##### Implementation Details

Use these symbols and conventions:
- Rectangles: Main components
- Hexagons: Hardware interfaces
- Double lines: API boundaries
- Small circles: Interface points

##### Additional Elements

Include:
- Version information
- Key dependencies
- Security boundaries
- Resource requirements

This architecture should be represented in a way that clearly shows both the independence and interconnection of the four main applications while highlighting the shared infrastructure they utilize.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef hardware fill:#E0E0E0,stroke:#333
    classDef driver fill:#90EE90,stroke:#333
    classDef os fill:#87CEEB,stroke:#333
    classDef protocol fill:#FFA500,stroke:#333
    classDef application fill:#DDA0DD,stroke:#333
    classDef security fill:#FFB6C1,stroke:#333
    classDef interface fill:#ADD8E6,stroke:#333

    %% Hardware Layer
    subgraph Hardware
        WF["WF200/WFM200/WGM160P"]:::hardware
        SK["Silicon Labs Kit"]:::hardware
        DEV["Dev Board Components"]:::hardware
    end

    %% Driver Layer
    subgraph Drivers
        FMAC["FMAC Driver"]:::driver
        NI["Network Interfaces"]:::driver
    end

    %% OS Layer
    subgraph OS
        RTOS["Micrium OS"]:::os
    end

    %% Protocol Layer
    subgraph Protocols
        LWIP["LwIP Stack"]:::protocol
        click LWIP "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/multiprotocol_micriumos/lwip_host/"
        BLE["Bluetooth Stack"]:::protocol
        click BLE "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/multiprotocol_micriumos/bluetooth/"
        MQTT["MQTT Stack"]:::protocol
        click MQTT "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/secured_mqtt/mqtt/"
        TLS["TLS Security Layer"]:::protocol
        click TLS "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/secured_mqtt/altcp_tls/"
    end

    %% Security Components
    subgraph Security
        SAE["SAE/WPA3"]:::security
        click SAE "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/wifi_cli_micriumos/sae/"
        CERT["TLS Certificates"]:::security
        click CERT "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/secured_mqtt/resources/security_files/"
        WPA["WPA Supplicant"]:::security
        click WPA "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/wpa_supplicant-2.7/"
    end

    %% Network Interfaces
    subgraph Interfaces
        WIFI_IF["WiFi Interface"]:::interface
        click WIFI_IF "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/multiprotocol_micriumos/wifi/"
        ETH_IF["Ethernet Interface"]:::interface
        click ETH_IF "https://github.com/SiliconLabs/wfx-fullMAC-tools/blob/main/ethernet_bridge/net_dev_efm32_ether_bridge.*"
        BLE_IF["Bluetooth Interface"]:::interface
        click BLE_IF "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/multiprotocol_micriumos/bluetooth/"
        WEB["Web Interface"]:::interface
        click WEB "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/multiprotocol_micriumos/lwip_host/webpage/"
    end

    %% Applications
    subgraph Applications
        WCLI["WiFi CLI App"]:::application
        click WCLI "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/wifi_cli_micriumos/wifi_cli/"
        SMQTT["Secured MQTT App"]:::application
        click SMQTT "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/secured_mqtt/"
        ETHB["Ethernet Bridge App"]:::application
        click ETHB "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/ethernet_bridge/"
        MPROT["Multiprotocol Demo"]:::application
        click MPROT "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/multiprotocol_micriumos/"
    end

    %% CLI Components
    subgraph CLI
        WCLI_COMP["WiFi CLI"]:::interface
        click WCLI_COMP "https://github.com/SiliconLabs/wfx-fullMAC-tools/tree/main/wifi_cli_micriumos/wifi_cli/"
        MQTT_CLI["MQTT CLI"]:::interface
        click MQTT_CLI "https://github.com/SiliconLabs/wfx-fullMAC-tools/blob/main/secured_mqtt/mqtt/mqtt_cli_app.*"
    end

    %% Relationships
    Hardware --> Drivers
    Drivers --> OS
    OS --> Protocols
    Protocols --> Applications
    Security --> Protocols
    Interfaces --> Protocols
    CLI --> Applications

    %% Legend
    subgraph Legend
        L1["Hardware"]:::hardware
        L2["Drivers"]:::driver
        L3["OS"]:::os
        L4["Protocols"]:::protocol
        L5["Applications"]:::application
        L6["Security"]:::security
        L7["Interfaces"]:::interface
    end
```
