nx_obd_dtc.nx
buildroot/runtime/nx_obd_dtc.nx
about
nx_obd_dtc.nx -- OBD-II diagnostic-trouble-code decoder (the AUTOMOTIVE
vehicle-obd capability). Decodes a 5-char DTC (e.g. "P0301") into its
structure -- system / SAE-generic-vs-manufacturer / subsystem / fault -- then
CLASSIFIES severity and routes it to the platform action rung (DIY vs pro).
Operator (2026-06-23): "cars" -- the first-listed maintenance domain; the CIQ
top-build vehicle-obd-diagnostics (beat FIXD).
THE EXCEED (on-thesis): FIXD reads the code + shows a generic blurb. We decode
the structure, classify severity by system+subsystem, and turn the cryptic
code into a routed ACTION (monitor / fix-DIY / fix-pro) via nx_maint_action --
and the platform's INDEPENDENT physics (battery via electrical, oil/brakes via
consumable, bearings via rotating, fluids via fluid-seal) is the trust layer
that cross-checks the car's self-report. The OBD code is one ingest, not gospel.
HONEST: the DTC STRUCTURE is the SAE J2012 standard (decoded exactly). The
severity-by-subsystem mapping is a reasoned starter heuristic (real per-code
severity varies; the full code DB is a data-layer follow-up #11).
NEVER-BRICK (#26): decodes a string; no syscalls, no vehicle writes, no code
clearing. Read-only by construction.
genealogy_id: project-maintenance-platform-sclass-2026-06-23 (automotive / vehicle-obd)
license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_maint_action.nx
imported by: nx_obd_dtc_test.nx
structs
| 34 | struct ObdDtc |
consts
| 28 | const NX_OBD_SYS_POWERTRAIN: i64 = 0 // 'P' |
| 29 | const NX_OBD_SYS_CHASSIS: i64 = 1 // 'C' |
| 30 | const NX_OBD_SYS_BODY: i64 = 2 // 'B' |
| 31 | const NX_OBD_SYS_NETWORK: i64 = 3 // 'U' |
| 32 | const NX_OBD_SYS_N: i64 = 4 |
functions
| 44 | func obd_hex(c: i64) -> i64 called by 1: nx_obd_decode |
| 51 | func obd_severity(sys: i64, sub: i64) -> i64 called by 1: nx_obd_decode |
| 63 | func obd_action(sys: i64, sub: i64) -> i64 called by 1: nx_obd_decode |
| 74 | func nx_obd_decode(dtc: *u8, out: *ObdDtc) -> i64 |