Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DDS Mini-Bus

A minimal publish/subscribe bus in C++17 + Qt 6 (MinGW). Features:

  • Discovery (broadcast/multicast; loopback for local demos)
  • Serialization (JSON/CBOR) with format negotiation
  • QoS: reliable (ACK/retry) and best-effort
  • UDP (unicast/broadcast/multicast) + TCP transports
  • Config-driven runtime
  • Tests via CTest/QtTest

Architecture / معماری

Diagrams are in PlantUML format. To view them, install the PlantUML extension in VS Code.

Requirements (Windows)

  • Qt 6.9.2 (mingw_64)
  • MinGW 13.x (bundled with Qt Tools)
  • CMake

Note: On Windows/MinGW, the single-process test_integration_scenarios is disabled by default due to known Qt event-loop limitations. All other tests pass. End-to-end behavior is validated via the multi-process demos below. To force-enable it anywhere: set FORCE_ENABLE_INTEGRATION_TESTS=1.

Quick Build (PowerShell)

# Ensure tools on PATH (adjust Qt path if needed)
$env:PATH = "C:\Program Files\CMake\bin;C:\Qt\Tools\mingw1310_64\bin;C:\Qt\6.9.2\mingw_64\bin;$env:PATH"
$env:CMAKE_PREFIX_PATH = "C:\Qt\6.9.2\mingw_64\lib\cmake"

# From the repo root:
cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build build -- -j
cmake --build build --target qt_deploy_copy_configs

Tests

ctest --test-dir build --timeout 120 --output-on-failure -V

Expected on Windows: all tests pass; test_integration_scenarios shows Not Run (Disabled).

Architecture Tests

Run architecture-focused tests that validate discovery, pub/sub reliable, QoS failure, and discovery cycle behaviors.

PowerShell:

ctest --test-dir build -R "(test_discovery_rx|test_discovery_tx|test_pub2sub_reliable|test_discovery_cycle|test_qos_failure)" --output-on-failure -V

Bash:

ctest -R "(test_discovery_rx|test_discovery_tx|test_pub2sub_reliable|test_discovery_cycle|test_qos_failure)" -V

Local Demos

2-terminal (1 Publisher + 1 Subscriber)

Open two PowerShell terminals, then:

Terminal #1 (Subscriber)

.\scripts\run_rx.ps1

Terminal #2 (Publisher)

.\scripts\run_tx.ps1

You should see on RX: discovery: peer=..., [UDP-IN] len=..., and temperature: {...}. On TX: [ROUTE] topic=... and [SEND][DONE] mid=....

3-terminal (1 Publisher + 2 Subscribers)

.\scripts\run_1pub_2subs.ps1

TX should show routes to 2 peers; both RX windows should print temperature messages.

Optional: Real Multicast

If your network/firewall permits:

$env:ALLOW_MULTICAST_TESTS = "1"

and use the multicast config variant.

Troubleshooting

Run demos from build\qt_deploy (Qt DLLs are deployed here).

Verbose logs:

$env:QT_LOGGING_RULES = "dds.disc=true;dds.net=true"

Full clean rebuild:

if (Test-Path .\build) { Remove-Item -Recurse -Force .\build }
cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build build -- -j
ctest --test-dir build --timeout 120 --output-on-failure -V

Repository Layout

config/                 # sample configs
docs/
  Architecture.md
  diagrams/
    component.puml
    sequence_publish_reliable.puml
scripts/
  run_rx.ps1
  run_tx.ps1
  run_1pub_2subs.ps1
src/
tests/
build/                  # generated by CMake (ignored)

UML Diagrams (PlantUML) — How I generate them (Windows)

Diagrams in this repo:

  • docs/diagrams/component.puml
  • docs/diagrams/sequence_publish_reliable.puml

These are plain PlantUML sources. No code changes are required to render them.

Requirements

  • VS Code + extension PlantUML (jebbs.plantuml)
  • Java JDK 17+ (e.g., Eclipse Temurin 17)
  • Graphviz (must have dot.exe)

VS Code settings (local render)

Add to .vscode/settings.json:

{
  "plantuml.render": "Local",
  "plantuml.graphvizDot": "C:\\\\Program Files\\\\Graphviz\\\\bin\\\\dot.exe"
}

Preview in VS Code

Open a .puml → press Alt+D (or run PlantUML: Preview Current Diagram).

Right-click → Export Current Diagram to PNG/SVG.

CLI export (local Java + Graphviz)

From repo root in PowerShell:

# Add Java & Graphviz to PATH for this session
$env:Path = "C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot\bin;C:\Program Files\Graphviz\bin;$env:Path"

# Sanity check
java -version
dot -V

# Output folder
New-Item -ItemType Directory -Force -Path docs\diagrams\out | Out-Null

# Use PlantUML jar from the VS Code extension
$jar = Get-ChildItem "$env:USERPROFILE\.vscode\extensions" -Recurse -Filter plantuml.jar -ErrorAction SilentlyContinue | Select-Object -First 1

# Export PNG (use -tsvg for SVG)
java -jar "$($jar.FullName)" -tpng docs\diagrams\component.puml -o out
java -jar "$($jar.FullName)" -tpng docs\diagrams\sequence_publish_reliable.puml -o out

Generated images will appear under docs/diagrams/out/.

Troubleshooting

Ensure java -version and dot -V work.

Restart VS Code after installing tools.

Files must start with @startuml and end with @enduml.

VS Code workspace must be Trusted.

نمودارهای UML (PlantUML) — روش تولید (ویندوز)

فایل‌های دیاگرام:

  • docs/diagrams/component.puml
  • docs/diagrams/sequence_publish_reliable.puml

این‌ها سورس PlantUML هستند و بدون هیچ تغییری در کد رندر می‌شوند.

پیش‌نیازها

  • VS Code + افزونه PlantUML (jebbs.plantuml)
  • Java JDK 17+ (مثل Eclipse Temurin 17)
  • Graphviz (باید dot.exe داشته باشد)

تنظیم VS Code برای رندر محلی

در .vscode/settings.json قرار دهید:

{
  "plantuml.render": "Local",
  "plantuml.graphvizDot": "C:\\\\Program Files\\\\Graphviz\\\\bin\\\\dot.exe"
}

پیش‌نمایش در VS Code

فایل .puml را باز کنید → Alt+D

راست‌کلیک → Export Current Diagram برای خروجی PNG/SVG

خروجی با خط فرمان

در PowerShell و از ریشه ریپو:

$env:Path = "C:\Program Files\Eclipse Adoptium\jdk-17.0.16.8-hotspot\bin;C:\Program Files\Graphviz\bin;$env:Path"
java -version
dot -V

New-Item -ItemType Directory -Force -Path docs\diagrams\out | Out-Null
$jar = Get-ChildItem "$env:USERPROFILE\.vscode\extensions" -Recurse -Filter plantuml.jar -ErrorAction SilentlyContinue | Select-Object -First 1

java -jar "$($jar.FullName)" -tpng docs\diagrams\component.puml -o out
java -jar "$($jar.FullName)" -tpng docs\diagrams\sequence_publish_reliable.puml -o out

خروجی‌ها در مسیر docs/diagrams/out/ ساخته می‌شوند.

عیب‌یابی

اطمینان حاصل کنید که java -version و dot -V کار می‌کنند.

پس از نصب ابزارها، VS Code را دوباره راه‌اندازی کنید.

فایل‌ها باید با @startuml شروع و با @enduml پایان یابند.

فضای کاری VS Code باید Trusted باشد.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages