# agopengps-official/aog-taskcontroller architecture

> Architecture diagram of the GitHub repository agopengps-official/aog-taskcontroller, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/agopengps-official/aog-taskcontroller
- Repository: https://github.com/agopengps-official/aog-taskcontroller

## Overview

AOG-TaskController bridges AgOpenGPS UDP control traffic to an ISOBUS Task Controller on a CAN network, then returns implement section status to AgOpenGPS. The application also provides a Virtual Terminal interface, optional Tractor ECU and NMEA2000 messaging, and persistent configuration. The map emphasizes those product capabilities; source excerpts are partial, so uncertain internal callback wiring is not expanded.

Main entry points: [`src/app.cpp`](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/app.cpp) (Application), [`src/task_controller.cpp`](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/task_controller.cpp) (Task Controller), [`src/udp_connections.cpp`](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/udp_connections.cpp) (UDP protocol), [`src/main.cpp`](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/main.cpp) (Process entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["Process entry<br/>[main.cpp]"]
  node_app["Application<br/>[app.cpp]"]
  node_udp["UDP protocol"]
end

subgraph group_control["Section control"]
  node_tc["Task Controller"]
  node_pool["Object pool<br/>[AOG_TC.iop]"]
end

subgraph group_terminal["Terminal and tractor"]
  node_vt_ui["VT client and UI<br/>[app.cpp]"]
  node_nmea["NMEA2000 messaging<br/>[app.cpp]"]
end

subgraph group_support["Configuration and diagnostics"]
  node_settings["Settings<br/>[settings.cpp]"]
  node_log["Async logging<br/>[async_log.cpp]"]
  node_crash["Crash diagnostics<br/>[crash_handler.cpp]"]
end

node_aog(("AgOpenGPS"))
node_settings_file["Settings file"]
node_can["CAN network"]
node_adapter["CAN adapter"]
node_implement(("ISOBUS implement"))
node_vt(("Virtual Terminal"))
node_tecu(("Tractor ECU"))
node_logs["Log files"]

node_main -->|"runs"| node_app
node_app -->|"loads configuration"| node_settings
node_settings -->|"reads and writes"| node_settings_file
node_app -->|"sets up"| node_udp
node_aog -->|"sends packets"| node_udp
node_udp -->|"broadcasts packets"| node_aog
node_app -->|"sets up"| node_tc
node_app -->|"initializes"| node_can
node_adapter -->|"connects"| node_can
node_tc -->|"uses"| node_pool
node_tc -->|"exchanges ISOBUS data"| node_can
node_implement -->|"exchanges ISOBUS data"| node_can
node_app -->|"sets up and updates"| node_vt_ui
node_vt_ui -->|"communicates over"| node_can
node_vt -->|"communicates over"| node_can
node_app -.->|"configures optional ECU"| node_tecu
node_app -.->|"configures optional messaging"| node_nmea
node_nmea -.->|"transmits messages"| node_can
node_app -->|"writes diagnostics"| node_log
node_main -->|"installs handlers"| node_crash
node_crash -->|"writes crash reports"| node_logs
node_log -->|"writes logs"| node_logs

click node_main "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/main.cpp"
click node_app "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/app.cpp"
click node_udp "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/udp_connections.cpp"
click node_settings "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/settings.cpp"
click node_tc "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/task_controller.cpp"
click node_pool "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/resources/AOG_TC.iop"
click node_vt_ui "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/app.cpp"
click node_nmea "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/app.cpp"
click node_log "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/async_log.cpp"
click node_crash "https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/crash_handler.cpp"

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_main,node_app,node_udp toneBlue
class node_tc,node_pool toneAmber
class node_vt_ui,node_nmea toneMint
class node_settings,node_log,node_crash toneRose
class node_aog,node_settings_file,node_can,node_adapter,node_implement,node_vt,node_tecu,node_logs toneIndigo
```

## Components

### Application runtime

- [Process entry](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/main.cpp): `src/main.cpp`
- [Application](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/app.cpp): `src/app.cpp`
- [UDP protocol](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/udp_connections.cpp): `src/udp_connections.cpp`

### Section control

- [Task Controller](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/task_controller.cpp): `src/task_controller.cpp`
- [Object pool](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/resources/AOG_TC.iop): `resources/AOG_TC.iop`

### Terminal and tractor

- [VT client and UI](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/app.cpp): `src/app.cpp`
- [NMEA2000 messaging](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/app.cpp): `src/app.cpp`

### Configuration and diagnostics

- [Settings](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/settings.cpp): `src/settings.cpp`
- [Async logging](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/async_log.cpp): `src/async_log.cpp`
- [Crash diagnostics](https://github.com/agopengps-official/aog-taskcontroller/blob/develop/src/crash_handler.cpp): `src/crash_handler.cpp`

### Other components

- **AgOpenGPS**
- **Settings file**
- **CAN network**
- **CAN adapter**
- **ISOBUS implement**
- **Virtual Terminal**
- **Tractor ECU**
- **Log files**

## Connections

- Process entry → Application: runs
- Application → Settings: loads configuration
- Settings → Settings file: reads and writes
- Application → UDP protocol: sets up
- AgOpenGPS → UDP protocol: sends packets
- UDP protocol → AgOpenGPS: broadcasts packets
- Application → Task Controller: sets up
- Application → CAN network: initializes
- CAN adapter → CAN network: connects
- Task Controller → Object pool: uses
- Task Controller → CAN network: exchanges ISOBUS data
- ISOBUS implement → CAN network: exchanges ISOBUS data
- Application → VT client and UI: sets up and updates
- VT client and UI → CAN network: communicates over
- Virtual Terminal → CAN network: communicates over
- Application → Tractor ECU: configures optional ECU
- Application → NMEA2000 messaging: configures optional messaging
- NMEA2000 messaging → CAN network: transmits messages
- Application → Async logging: writes diagnostics
- Process entry → Crash diagnostics: installs handlers
- Crash diagnostics → Log files: writes crash reports
- Async logging → Log files: writes logs
