# kety-folf/hf_dsstv architecture

> Architecture diagram of the GitHub repository kety-folf/hf_dsstv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kety-folf/hf_dsstv
- Repository: https://github.com/kety-folf/hf_dsstv

## Overview

HF_DSSTV is a cross-platform amateur-radio picture-transfer product: desktop and Android apps share an OFDM/LDPC modem, with a Python reference implementation and command-line tools. The operator configures a station, selects or prepares an image, transmits it over radio, and receives/reassembles incoming pictures. Broadcast and connected ARQ are distinct transfer modes; the signal-processing path includes framing, modulation, and decoding. The desktop station engine is the clearest sampled runtime orchestrator. Several app and modem internals are unsampled, so their subsystem links follow explicit README capabilities or are omitted rather than inferred.

Main entry points: [`desktop/station/src/engine.rs`](https://github.com/kety-folf/hf_dsstv/blob/main/desktop/station/src/engine.rs) (Station engine), [`hf_dsstv/picture/transfer.py`](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/transfer.py) (Transfer reassembly), [`hf_dsstv/modem/frames.py`](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/modem/frames.py) (Frame layer), [`android/app/src/main/java/com/hfdsstv/app/AppState.kt`](https://github.com/kety-folf/hf_dsstv/blob/main/android/app/src/main/java/com/hfdsstv/app/AppState.kt) (Android app state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator_apps["Operator apps"]
  node_desktop_ui["Desktop UI"]
  node_desktop_worker["Desktop worker<br/>[worker.rs]"]
  node_android_ui["Android UI"]
  node_android_state["Android app state<br/>[AppState.kt]"]
end

subgraph group_station_io["Station and radio"]
  node_station_engine["Station engine<br/>[engine.rs]"]
  node_audio_devices["Audio devices<br/>[lib.rs]"]
  node_radio_control["Radio control"]
  node_android_radio["Android radio I/O"]
end

subgraph group_transfer["Picture transfer"]
  node_picture_prep["Picture preparation<br/>[compress.py]"]
  node_strip_transfer["Strip transfer<br/>[strips.py]"]
  node_fountain_coding["Fountain coding<br/>[fountain.py]"]
  node_transfer_reassembly["Transfer reassembly<br/>[transfer.py]"]
  node_arq_sessions["ARQ sessions"]
  node_picture_store[("Picture storage<br/>[store.py]")]
end

subgraph group_signal["Shared signal processing"]
  node_frame_layer["Frame layer<br/>[frames.py]"]
  node_ofdm_modem["OFDM modem"]
  node_link_protocol["Link protocol"]
  node_rust_android_core["Android Rust core"]
end

subgraph group_tools["CLI and simulation"]
  node_cli_tools["CLI tools<br/>[__main__.py]"]
  node_channel_sim["Channel simulator<br/>[channel.py]"]
end

node_operator(("Radio operator"))
node_radio{{"HF radio"}}

node_operator -->|"operates"| node_desktop_ui
node_operator -->|"operates"| node_android_ui
node_desktop_ui -->|"commands"| node_desktop_worker
node_desktop_worker -->|"drives"| node_station_engine
node_android_ui -->|"controls"| node_android_state
node_android_state -->|"uses"| node_android_radio
node_station_engine -->|"reads and plays"| node_audio_devices
node_station_engine -->|"controls PTT"| node_radio_control
node_station_engine -->|"prepares images"| node_picture_prep
node_station_engine -->|"runs sessions"| node_arq_sessions
node_station_engine -->|"handles transfers"| node_transfer_reassembly
node_picture_prep -->|"encodes strips"| node_strip_transfer
node_strip_transfer -->|"reassembles"| node_transfer_reassembly
node_fountain_coding -->|"decodes packets"| node_transfer_reassembly
node_transfer_reassembly -->|"uses decoder"| node_fountain_coding
node_transfer_reassembly -->|"packs packets"| node_link_protocol
node_frame_layer -->|"modulates and decodes"| node_ofdm_modem
node_frame_layer -->|"encodes headers"| node_link_protocol
node_rust_android_core -.->|"serves modem calls"| node_android_state
node_cli_tools -->|"encodes and decodes"| node_frame_layer
node_cli_tools -->|"simulates channel"| node_channel_sim
node_station_engine -->|"transmits and receives"| node_radio
node_android_radio -->|"transmits and receives"| node_radio
node_transfer_reassembly -.->|"stores received images"| node_picture_store

click node_desktop_ui "https://github.com/kety-folf/hf_dsstv/tree/main/desktop/app/src/ui"
click node_desktop_worker "https://github.com/kety-folf/hf_dsstv/blob/main/desktop/app/src/worker.rs"
click node_android_ui "https://github.com/kety-folf/hf_dsstv/tree/main/android/app/src/main/java/com/hfdsstv/app/ui"
click node_android_state "https://github.com/kety-folf/hf_dsstv/blob/main/android/app/src/main/java/com/hfdsstv/app/AppState.kt"
click node_station_engine "https://github.com/kety-folf/hf_dsstv/blob/main/desktop/station/src/engine.rs"
click node_audio_devices "https://github.com/kety-folf/hf_dsstv/blob/main/desktop/audio/src/lib.rs"
click node_radio_control "https://github.com/kety-folf/hf_dsstv/tree/main/desktop/rig/src"
click node_android_radio "https://github.com/kety-folf/hf_dsstv/tree/main/android/app/src/main/java/com/hfdsstv/app/radio"
click node_picture_prep "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/compress.py"
click node_strip_transfer "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/strips.py"
click node_fountain_coding "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/fountain.py"
click node_transfer_reassembly "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/transfer.py"
click node_arq_sessions "https://github.com/kety-folf/hf_dsstv/tree/main/hf_dsstv/session"
click node_picture_store "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/store.py"
click node_frame_layer "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/modem/frames.py"
click node_ofdm_modem "https://github.com/kety-folf/hf_dsstv/tree/main/hf_dsstv/modem"
click node_link_protocol "https://github.com/kety-folf/hf_dsstv/tree/main/hf_dsstv/link"
click node_rust_android_core "https://github.com/kety-folf/hf_dsstv/tree/main/android/core/src"
click node_cli_tools "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/tools/__main__.py"
click node_channel_sim "https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/sim/channel.py"

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_desktop_ui,node_desktop_worker,node_android_ui,node_android_state toneBlue
class node_station_engine,node_audio_devices,node_radio_control,node_android_radio toneAmber
class node_picture_prep,node_strip_transfer,node_fountain_coding,node_transfer_reassembly,node_arq_sessions,node_picture_store toneMint
class node_frame_layer,node_ofdm_modem,node_link_protocol,node_rust_android_core toneRose
class node_cli_tools,node_channel_sim,node_operator,node_radio toneIndigo
```

## Components

### Operator apps

- [Desktop UI](https://github.com/kety-folf/hf_dsstv/tree/main/desktop/app/src/ui): `desktop/app/src/ui`
- [Desktop worker](https://github.com/kety-folf/hf_dsstv/blob/main/desktop/app/src/worker.rs): `desktop/app/src/worker.rs`
- [Android UI](https://github.com/kety-folf/hf_dsstv/tree/main/android/app/src/main/java/com/hfdsstv/app/ui): `android/app/src/main/java/com/hfdsstv/app/ui`
- [Android app state](https://github.com/kety-folf/hf_dsstv/blob/main/android/app/src/main/java/com/hfdsstv/app/AppState.kt): `android/app/src/main/java/com/hfdsstv/app/AppState.kt`

### Station and radio

- [Station engine](https://github.com/kety-folf/hf_dsstv/blob/main/desktop/station/src/engine.rs): `desktop/station/src/engine.rs`
- [Audio devices](https://github.com/kety-folf/hf_dsstv/blob/main/desktop/audio/src/lib.rs): `desktop/audio/src/lib.rs`
- [Radio control](https://github.com/kety-folf/hf_dsstv/tree/main/desktop/rig/src): `desktop/rig/src`
- [Android radio I/O](https://github.com/kety-folf/hf_dsstv/tree/main/android/app/src/main/java/com/hfdsstv/app/radio): `android/app/src/main/java/com/hfdsstv/app/radio`

### Picture transfer

- [Picture preparation](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/compress.py): `hf_dsstv/picture/compress.py`
- [Strip transfer](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/strips.py): `hf_dsstv/picture/strips.py`
- [Fountain coding](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/fountain.py): `hf_dsstv/picture/fountain.py`
- [Transfer reassembly](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/transfer.py): `hf_dsstv/picture/transfer.py`
- [ARQ sessions](https://github.com/kety-folf/hf_dsstv/tree/main/hf_dsstv/session): `hf_dsstv/session`
- [Picture storage](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/picture/store.py): `hf_dsstv/picture/store.py`

### Shared signal processing

- [Frame layer](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/modem/frames.py): `hf_dsstv/modem/frames.py`
- [OFDM modem](https://github.com/kety-folf/hf_dsstv/tree/main/hf_dsstv/modem): `hf_dsstv/modem`
- [Link protocol](https://github.com/kety-folf/hf_dsstv/tree/main/hf_dsstv/link): `hf_dsstv/link`
- [Android Rust core](https://github.com/kety-folf/hf_dsstv/tree/main/android/core/src): `android/core/src`

### CLI and simulation

- [CLI tools](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/tools/__main__.py): `hf_dsstv/tools/__main__.py`
- [Channel simulator](https://github.com/kety-folf/hf_dsstv/blob/main/hf_dsstv/sim/channel.py): `hf_dsstv/sim/channel.py`

### Other components

- **Radio operator**
- **HF radio**

## Connections

- Radio operator → Desktop UI: operates (evidence: `README.md`)
- Radio operator → Android UI: operates (evidence: `README.md`)
- Desktop UI → Desktop worker: commands (evidence: `desktop/app/src/worker.rs`)
- Desktop worker → Station engine: drives (evidence: `desktop/app/src/worker.rs`)
- Android UI → Android app state: controls (evidence: `android/app/src/main/java/com/hfdsstv/app/MainActivity.kt`)
- Android app state → Android radio I/O: uses (evidence: `android/app/src/main/java/com/hfdsstv/app/radio/ConnectedController.kt`)
- Station engine → Audio devices: reads and plays (evidence: `desktop/station/src/engine.rs`)
- Station engine → Radio control: controls PTT (evidence: `desktop/station/src/engine.rs`)
- Station engine → Picture preparation: prepares images (evidence: `desktop/station/src/engine.rs`)
- Station engine → ARQ sessions: runs sessions (evidence: `desktop/station/src/engine.rs`)
- Station engine → Transfer reassembly: handles transfers (evidence: `desktop/station/src/engine.rs`)
- Picture preparation → Strip transfer: encodes strips (evidence: `hf_dsstv/picture/strips.py`)
- Strip transfer → Transfer reassembly: reassembles (evidence: `hf_dsstv/picture/transfer.py`)
- Fountain coding → Transfer reassembly: decodes packets (evidence: `hf_dsstv/picture/transfer.py`)
- Transfer reassembly → Fountain coding: uses decoder (evidence: `hf_dsstv/picture/transfer.py`)
- Transfer reassembly → Link protocol: packs packets (evidence: `hf_dsstv/picture/transfer.py`)
- Frame layer → OFDM modem: modulates and decodes (evidence: `hf_dsstv/modem/frames.py`)
- Frame layer → Link protocol: encodes headers (evidence: `hf_dsstv/modem/frames.py`)
- Android Rust core → Android app state: serves modem calls
- CLI tools → Frame layer: encodes and decodes (evidence: `hf_dsstv/tools/__main__.py`)
- CLI tools → Channel simulator: simulates channel (evidence: `hf_dsstv/tools/__main__.py`)
- Station engine → HF radio: transmits and receives (evidence: `README.md`)
- Android radio I/O → HF radio: transmits and receives (evidence: `README.md`)
- Transfer reassembly → Picture storage: stores received images (evidence: `hf_dsstv/picture/store.py`)
