code wiki / (root) / nx_obd_dtc.nx

nx_obd_dtc.nx

buildroot/runtime/nx_obd_dtc.nx

4649 B107 linesdepth 4pulls 9 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_maint_action.nx nx_obd_dtc.nx nx_obd_dtc_test.nx

imports: nx_maint_action.nx

imported by: nx_obd_dtc_test.nx

structs

34struct ObdDtc

consts

28const NX_OBD_SYS_POWERTRAIN: i64 = 0 // 'P'
29const NX_OBD_SYS_CHASSIS: i64 = 1 // 'C'
30const NX_OBD_SYS_BODY: i64 = 2 // 'B'
31const NX_OBD_SYS_NETWORK: i64 = 3 // 'U'
32const NX_OBD_SYS_N: i64 = 4

functions

44func obd_hex(c: i64) -> i64
called by 1: nx_obd_decode
51func obd_severity(sys: i64, sub: i64) -> i64
called by 1: nx_obd_decode
63func obd_action(sys: i64, sub: i64) -> i64
called by 1: nx_obd_decode
74func nx_obd_decode(dtc: *u8, out: *ObdDtc) -> i64
called by 1: main calls 3: obd_hexobd_severityobd_action