← Return to the lab

MODULES · SERVICES · CONVERSIONS

Inspectable diagnostic definitions

A small data file connects an ECU name, a request, a reply format and the units shown on screen.

The lab describes its existing diagnostic subset in an original JSON schema. You can download the definitions or inspect the catalog with current connection availability. The catalog includes four modeled modules and 19 runnable service examples. Only the engine ECU implements a diagnostic endpoint.

What belongs to each module?

ModuleAvailable hereDiagnostic routing
Engine ECUImplemented OBD current data, emissions DTCs and identification; a small UDS session/identification subsetOBD: 7DF or 7E0 request. UDS: 7E0 request. Reply: 7E8.
Battery monitorPhysical state, last received packet, freshness, contactor and modeled faultsState inspection only; no assigned diagnostic address
Hybrid supervisorMode, engine request and power allocationState inspection only; no diagnostic services
ABS / yaw controllerWheel states, signal validity, modulation and modeled faultsState inspection only; no diagnostic services

Example: engine speed

{
  "id": "obd.rpm",
  "module_id": "ecu",
  "protocol": "OBD",
  "request_hex": "01 0C",
  "can_id": "7DF",
  "allowed_can_ids": ["7DF", "7E0"],
  "unit": "rpm",
  "positive_prefix_hex": "41 0C",
  "decode": {
    "kind": "linear",
    "data_offset": 2,
    "data_length": 2,
    "byte_order": "big",
    "factor": 0.25,
    "offset": 0,
    "formula": "(256 × A + B) / 4",
    "source_path": "rpm"
  }
}

Offsets are zero-based positions in the reassembled application response, excluding CAN IDs, ISO-TP control bytes and frame padding. For 41 0C 1A F8, the data bytes are 1A F8: (26 × 256 + 248) / 4 = 1726 rpm. Formula text is explanatory; the numeric helper uses the declared byte order, factor and offset without evaluating code.

Availability and effects

The downloaded JSON records implementation support. The read-only API adds the current profile, whether each module is installed and whether the diagnostic branch is connected. Disconnecting the DLC makes diagnostic services unavailable; it does not erase the definitions or stop the vehicle plant. The engine ECU remains responsive with ignition off in this lab's chosen model.

Most entries read data. obd.clear_dtcs changes simulated emissions memory, while session-control entries change the simulated UDS session. Merely opening this catalog performs none of these actions. A name in a catalog does not add firmware behavior: the existing Python diagnostic server remains the implementation.

Validation and scope

The loader validates unique identifiers, module/service relationships, supported addressing, canonical request bytes and decoder field shapes. A state-only module cannot acquire an invented CAN address or service list. Tests send all listed requests to the actual teaching ECU and compare response prefixes, lengths and decoded examples.

This schema is obdii-lab.diagnostic-definitions.v1. It is independent of MCD/ODX and is not an MCD database importer or an output format compatible with mcd-diag-rs. It contains no OEM data, module discovery, adaptations, reflashing, hardware access or real vehicle connection. Editing labels or conversion descriptions does not implement a new ECU service.

Architecture reference

The user's mcd-diag-rs reference demonstrates how diagnostic databases can feed readable definitions and a diagnostic interface. That metadata-driven organization informed this small teaching feature. The lab schema, definitions, loader and examples were independently authored; no code or OEM database from that project is bundled. The project's own licensing is documented in its LICENSE.md.