Files
swaits 978553e5ac feat!: examples on donglora 1.0 async API with shared _common helpers
Rewrite all scripts against the DongLoRa Protocol v2 async Dongle surface, and extract the shared MeshCore US preset into a single module.

* _common.py: MESHCORE_US preset (910.525 MHz / BW 62.5 / SF 7 / CR 4/5 / sync 0x1424 / 20 dBm) plus small helpers, imported by every example.

* New: explore.py, which prints the device capabilities and runs a single TX + RX roundtrip for quick hardware validation.

* simple_rx.py, simple_tx.py, ping_pong.py, lora_bridge.py all switch to donglora.Dongle and the new Modulation / LoRaConfig types.

* all_commands.py removed; it was an index of the old v0.1 command enum that no longer exists after the Protocol v2 split.

* justfile: drop stale recipes that referenced removed scripts.
2026-04-22 09:59:16 -06:00

44 lines
1.1 KiB
Makefile

set shell := ["bash", "-c"]
_proj := source_directory()
_uv := "uv run --project " + _proj
[private]
_ensure_tools:
@mise trust --yes . 2>/dev/null; mise install --quiet
# Run all checks (fmt, lint)
check: fmt-check lint
# Format code
fmt: _ensure_tools
@uv run ruff format .
# Check formatting without changing files
fmt-check: _ensure_tools
@uv run ruff format --check .
# Lint
lint: _ensure_tools
@uv run ruff check .
# Receive LoRa packets (Ctrl-C to stop)
rx *args: _ensure_tools
@{{_uv}} {{source_directory()}}/simple_rx.py {{args}}
# Transmit a single packet
tx *args: _ensure_tools
@{{_uv}} {{source_directory()}}/simple_tx.py {{args}}
# Two-dongle ping-pong demo (--role tx|rx)
ping-pong *args: _ensure_tools
@{{_uv}} {{source_directory()}}/ping_pong.py {{args}}
# Probe the connected DongLoRa: dump GET_INFO and exercise one TX + RX
explore *args: _ensure_tools
@{{_uv}} {{source_directory()}}/explore.py {{args}}
# Two-way LoRa bridge over TCP
bridge *args: _ensure_tools
@{{_uv}} {{source_directory()}}/lora_bridge.py {{args}}