# panigrahip/3gppdecoder architecture

> Architecture diagram of the GitHub repository panigrahip/3gppdecoder, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/panigrahip/3gppdecoder
- Repository: https://github.com/panigrahip/3gppdecoder

## Overview

##### Project type and purpose
- This is a desktop GUI application written in C++ using the Qt framework.
- Its purpose is to decode 3GPP wireless messages (LTE, UMTS, GSM) and RLC PDU headers on Windows.

##### File structure
- Top‑level files:
- 3GPP Decoder.pro: Qt project file, defines build targets, source files, resources.
- README.md: project description and build instructions.
- Source files:
- main.cpp: application entry‑point, initializes QApplication and loads MainWindow.
- mainwindow.* (.cpp/.h/.ui): main UI container, menu actions, slots.
- aboutdialog.*, preferencedialog.*: modal dialogs for “About” and “Preferences.”
- Decoder modules:
- tsharkdecoder.*: wraps TShark-based decoding logic.
- umtsrlcdecoder.*: RLC PDU header decoding routines.
- Resources:

##### Key insights from README
- Built with Qt Creator, uses Qt widgets and signals/slots.
- Decoding feature set covers RRC, NAS messages and RLC headers.

##### Components
a. UI Layer
- QApplication / MainWindow
- AboutDialog, PreferenceDialog
- UI forms (*.ui) rendered by Qt Widgets
b. Business Logic / Decoder Layer
- TSharkDecoder module
- UMTSRLCDecoder module
- (Potentially future GSM / LTE-specific decoders)
c. Resource Layer
- Configuration storage (preferences)
d. External Dependencies
- Qt Framework (QtCore, QtWidgets)
- TShark (external binary/library invoked by TSharkDecoder)

##### Relationships and interactions
- On startup: main.cpp → QApplication → MainWindow
- User actions in MainWindow (e.g., “Open PDU,” “Decode”) → signal/slot to Business Logic
- Business Logic modules parse input data → return decoded structures/strings
- MainWindow (or dialogs) display results
- Preferences dialog reads/writes configuration → influences decoder behavior (e.g., paths)
- About dialog shows static metadata (version, links)

##### Architectural patterns and design principles
- MVC-ish separation: Qt UI forms and controllers distinct from decoder classes.
- Single responsibility: each decoder class handles one protocol.
- Resource bundling: images.qrc centralizes UI assets.
- Plugin‑ready design: new decoder modules can be added alongside existing ones.

##### Essential elements
- Class names and UI form names matching the codebase.
- Build file (.pro) indicating the overall project boundary.
- Notes on configuration and resource loading.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Project Files"
        PRO["3GPP Decoder.pro"]:::project
        README["README.md"]:::project
    end

    subgraph "UI Layer"
        MAINCPP["main.cpp"]:::ui
        QAPP["QApplication"]:::ui
        MAINWIN["MainWindow\n(mainwindow.cpp/.h/.ui)"]:::ui
        ABOUTDLG["AboutDialog\n(aboutdialog.cpp/.h/.ui)"]:::ui
        PREFDLG["PreferenceDialog\n(preferencedialog.cpp/.h/.ui)"]:::ui
    end

    subgraph "Logic Layer"
        TSHARK["TSharkDecoder\n(tsharkdecoder.cpp/.h)"]:::logic
        UMTS["UMTSRLCDecoder\n(umtsrlcdecoder.cpp/.h)"]:::logic
    end

    subgraph "Resource Layer"
        IMAGES["images.qrc"]:::resource
        CONFIG["Configuration Storage"]:::resource
    end

    subgraph "External Dependencies"
        QTFRAME["Qt Framework\n(QtCore, QtWidgets)"]:::external
        TSHARKBIN["TShark Binary"]:::external
    end

    PRO -->|defines build| MAINCPP
    MAINCPP -->|initializes| QAPP
    QAPP -->|creates| MAINWIN
    MAINWIN -->|opens| ABOUTDLG
    MAINWIN -->|opens| PREFDLG
    MAINWIN -->|requests decode| TSHARK
    MAINWIN -->|requests decode| UMTS
    TSHARK -->|invokes| TSHARKBIN
    TSHARK -->|returns data| MAINWIN
    UMTS -->|returns data| MAINWIN
    MAINWIN -->|loads icons| IMAGES
    PREFDLG -->|reads/writes| CONFIG
    PREFDLG -->|configures| TSHARK
    PREFDLG -->|configures| UMTS
    MAINCPP -->|uses| QTFRAME
    MAINWIN -->|uses| QTFRAME
    ABOUTDLG -->|uses| QTFRAME
    PREFDLG -->|uses| QTFRAME

    click PRO "https://github.com/panigrahip/3gppdecoder/blob/master/3GPP Decoder.pro"
    click MAINCPP "https://github.com/panigrahip/3gppdecoder/blob/master/main.cpp"
    click MAINWIN "https://github.com/panigrahip/3gppdecoder/blob/master/mainwindow.cpp"
    click ABOUTDLG "https://github.com/panigrahip/3gppdecoder/blob/master/aboutdialog.cpp"
    click PREFDLG "https://github.com/panigrahip/3gppdecoder/blob/master/preferencedialog.cpp"
    click TSHARK "https://github.com/panigrahip/3gppdecoder/blob/master/tsharkdecoder.cpp"
    click UMTS "https://github.com/panigrahip/3gppdecoder/blob/master/umtsrlcdecoder.cpp"
    click IMAGES "https://github.com/panigrahip/3gppdecoder/blob/master/images.qrc"
    click README "https://github.com/panigrahip/3gppdecoder/blob/master/README.md"

    classDef project fill:#cccccc,stroke:#333,stroke-width:1px
    classDef ui fill:#cfe2f3,stroke:#2a6ebb,stroke-width:1px
    classDef logic fill:#d9ead3,stroke:#6aa84f,stroke-width:1px
    classDef resource fill:#fff2cc,stroke:#e69138,stroke-width:1px
    classDef external fill:#f9cb9c,stroke:#e06666,stroke-width:1px,stroke-dasharray: 5 5
```
