# johnjocke/dpdu-passthru architecture

> Architecture diagram of the GitHub repository johnjocke/dpdu-passthru, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/johnjocke/dpdu-passthru
- Repository: https://github.com/johnjocke/dpdu-passthru

## Overview

This is a Windows D-PDU API driver that adapts J2534-compatible K-Line interfaces for Tech2Win diagnostics. The main workflow is: Tech2Win calls the exported D-PDU API, the driver discovers and opens a J2534 interface, creates a logical link, dispatches communication primitives for ISO14230 or KW82, and returns diagnostic results through D-PDU events. Settings and logging support that runtime. The protocol and link flow is visible in excerpts; README documents supported integrations and capabilities, while several implementation details are unsampled.

Main entry points: [`driver/dpdu.cpp`](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/dpdu.cpp) (D-PDU exports), [`driver/ComLogicalLink.cpp`](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/ComLogicalLink.cpp) (Logical link), [`driver/j2534/j2534_v0404.h`](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/j2534/j2534_v0404.h) (PassThru interface), [`driver/j2534/shim_loader.cpp`](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/j2534/shim_loader.cpp) (Adapter discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["D-PDU interface"]
  node_dpdu_api["D-PDU exports<br/>[dpdu.cpp]"]
  node_pdu_contract["PDU definitions<br/>[pdu_api.h]"]
  node_link["Logical link<br/>[ComLogicalLink.cpp]"]
end

subgraph group_transport["J2534 transport"]
  node_j2534_interface["PassThru interface<br/>[j2534_v0404.h]"]
  node_shim["Adapter discovery<br/>[shim_loader.cpp]"]
end

subgraph group_protocol["Diagnostic protocols"]
  node_primitive_base["Primitive lifecycle<br/>[ComPrimitive.cpp]"]
  node_iso14230["ISO14230 protocol"]
  node_kw82["KW82 protocol"]
end

subgraph group_support["Runtime support"]
  node_settings["Runtime settings<br/>[Settings.cpp]"]
  node_logger["Activity logging<br/>[Logger.cpp]"]
end

node_tech2win(("Tech2Win"))
node_adapter["J2534 adapter"]
node_ecu(("Vehicle ECU"))

node_tech2win -->|"calls API"| node_dpdu_api
node_dpdu_api -->|"uses definitions"| node_pdu_contract
node_dpdu_api -->|"loads adapter"| node_shim
node_shim -->|"binds functions"| node_j2534_interface
node_shim -->|"discovers and loads"| node_adapter
node_dpdu_api -->|"creates and controls"| node_link
node_link -->|"calls PassThru"| node_j2534_interface
node_link -->|"dispatches protocol"| node_iso14230
node_link -->|"dispatches protocol"| node_kw82
node_link -->|"queues and processes"| node_primitive_base
node_iso14230 -->|"exchanges messages"| node_j2534_interface
node_kw82 -->|"exchanges messages"| node_j2534_interface
node_adapter -->|"communicates over K-Line"| node_ecu
node_link -->|"signals events"| node_dpdu_api
node_dpdu_api -->|"loads at startup"| node_settings
node_iso14230 -->|"reads workarounds"| node_settings
node_dpdu_api -->|"records activity"| node_logger

click node_dpdu_api "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/dpdu.cpp"
click node_pdu_contract "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/pdu_api.h"
click node_link "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/ComLogicalLink.cpp"
click node_j2534_interface "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/j2534/j2534_v0404.h"
click node_shim "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/j2534/shim_loader.cpp"
click node_primitive_base "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/ComPrimitive.cpp"
click node_iso14230 "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/ISO14230ComPrimitive.cpp"
click node_kw82 "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/KW82ComPrimitive.cpp"
click node_settings "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/Settings.cpp"
click node_logger "https://github.com/johnjocke/dpdu-passthru/blob/master/driver/Logger.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_dpdu_api,node_pdu_contract,node_link toneBlue
class node_j2534_interface,node_shim toneAmber
class node_primitive_base,node_iso14230,node_kw82 toneMint
class node_settings,node_logger toneRose
class node_tech2win,node_adapter,node_ecu toneIndigo
```

## Components

### D-PDU interface

- [D-PDU exports](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/dpdu.cpp): `driver/dpdu.cpp`
- [PDU definitions](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/pdu_api.h): `driver/pdu_api.h`
- [Logical link](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/ComLogicalLink.cpp): `driver/ComLogicalLink.cpp`

### J2534 transport

- [PassThru interface](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/j2534/j2534_v0404.h): `driver/j2534/j2534_v0404.h`
- [Adapter discovery](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/j2534/shim_loader.cpp): `driver/j2534/shim_loader.cpp`

### Diagnostic protocols

- [Primitive lifecycle](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/ComPrimitive.cpp): `driver/ComPrimitive.cpp`
- [ISO14230 protocol](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/ISO14230ComPrimitive.cpp): `driver/ISO14230ComPrimitive.cpp`
- [KW82 protocol](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/KW82ComPrimitive.cpp): `driver/KW82ComPrimitive.cpp`

### Runtime support

- [Runtime settings](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/Settings.cpp): `driver/Settings.cpp`
- [Activity logging](https://github.com/johnjocke/dpdu-passthru/blob/master/driver/Logger.cpp): `driver/Logger.cpp`

### Other components

- **Tech2Win**
- **J2534 adapter**
- **Vehicle ECU**

## Connections

- Tech2Win → D-PDU exports: calls API (evidence: `README.md`)
- D-PDU exports → PDU definitions: uses definitions (evidence: `driver/dpdu.cpp`)
- D-PDU exports → Adapter discovery: loads adapter (evidence: `driver/dpdu.cpp`)
- Adapter discovery → PassThru interface: binds functions (evidence: `driver/j2534/shim_loader.cpp`)
- Adapter discovery → J2534 adapter: discovers and loads (evidence: `README.md`)
- D-PDU exports → Logical link: creates and controls (evidence: `driver/dpdu.cpp`)
- Logical link → PassThru interface: calls PassThru (evidence: `driver/ComLogicalLink.cpp`)
- Logical link → ISO14230 protocol: dispatches protocol (evidence: `driver/ComLogicalLink.cpp`)
- Logical link → KW82 protocol: dispatches protocol (evidence: `driver/ComLogicalLink.cpp`)
- Logical link → Primitive lifecycle: queues and processes (evidence: `driver/ComLogicalLink.cpp`)
- ISO14230 protocol → PassThru interface: exchanges messages (evidence: `driver/ISO14230ComPrimitive.cpp`)
- KW82 protocol → PassThru interface: exchanges messages (evidence: `driver/KW82ComPrimitive.cpp`)
- J2534 adapter → Vehicle ECU: communicates over K-Line (evidence: `README.md`)
- Logical link → D-PDU exports: signals events (evidence: `driver/dpdu.cpp`)
- D-PDU exports → Runtime settings: loads at startup
- ISO14230 protocol → Runtime settings: reads workarounds (evidence: `driver/ISO14230ComPrimitive.cpp`)
- D-PDU exports → Activity logging: records activity (evidence: `driver/dpdu.cpp`)
