Skip to content

feat(pid,dri): add risky-mode save guardrail and ECU module auto-disc… - #205

Merged
tzebrowski merged 1 commit into
masterfrom
feat/ecu-discovery-and-risky-mode-guardrail
Jul 26, 2026
Merged

feat(pid,dri): add risky-mode save guardrail and ECU module auto-disc…#205
tzebrowski merged 1 commit into
masterfrom
feat/ecu-discovery-and-risky-mode-guardrail

Conversation

@tzebrowski

Copy link
Copy Markdown
Owner

…overy

Adds two independent, UDS-safety-oriented features inspired by reviewing StelvioOBD's risk-assessment notes and its discover_ecus.py tool.

Risky-mode save guardrail: EditPidBottomSheet's mode field is free text, so a user could previously save a custom PID with UDS mode 04 (clear DTCs), 08 (component/actuator control), 2E (write data by identifier) or 31 (routine control) with no warning at all. These modes can permanently alter ECU configuration or actuate hardware on a real vehicle. Saving now checks the chosen mode against a small risky-modes map and, if matched, shows a confirmation dialog with the specific reason before persisting; anything else keeps saving immediately as before.

ECU module auto-discovery: every Diagnostic Request ID (DRI) entry used by multi-module DTC scanning previously had to be typed in by hand. This adds a sweep dialog, reachable from a new FAB on the DRI screen, that probes a configurable range of candidate CAN headers with a UDS TesterPresent (3E00) request and lets the user add whichever headers answer as new, unnamed DRI entries to be renamed afterward through the existing edit UI. The probe is dispatched through DataLoggerService/WorkflowOrchestrator the same way routines and DTC actions already are, and results are delivered back to the fragment via a broadcast event carrying a ModuleDiscoveryResult payload. This app-side change depends on the new discoverModule API added to obd-metrics 11.26.0-SNAPSHOT in a companion commit on that repo (which also fixes a bug where ObdCommandHandler silently dropped empty/NO_DATA replies for any command other than RoutineCommand, which would otherwise have prevented "not found" probes from ever reporting back).

Verified via full app build: :datalogger:compileDebugKotlin, :app:compileGiuliaDebugKotlin, spotlessApply, and :app:assembleGiuliaDebug all pass. Not verified against real hardware in this environment - the 7E00 success-code assumption and default DA..F1 header convention follow the existing bundled profile files and the StelvioOBD reference tool, but have not been confirmed against a live adapter/vehicle.

…overy

Adds two independent, UDS-safety-oriented features inspired by reviewing
StelvioOBD's risk-assessment notes and its discover_ecus.py tool.

Risky-mode save guardrail: EditPidBottomSheet's mode field is free text, so
a user could previously save a custom PID with UDS mode 04 (clear DTCs), 08
(component/actuator control), 2E (write data by identifier) or 31 (routine
control) with no warning at all. These modes can permanently alter ECU
configuration or actuate hardware on a real vehicle. Saving now checks the
chosen mode against a small risky-modes map and, if matched, shows a
confirmation dialog with the specific reason before persisting; anything
else keeps saving immediately as before.

ECU module auto-discovery: every Diagnostic Request ID (DRI) entry used by
multi-module DTC scanning previously had to be typed in by hand. This adds
a sweep dialog, reachable from a new FAB on the DRI screen, that probes a
configurable range of candidate CAN headers with a UDS TesterPresent (3E00)
request and lets the user add whichever headers answer as new, unnamed DRI
entries to be renamed afterward through the existing edit UI. The probe is
dispatched through DataLoggerService/WorkflowOrchestrator the same way
routines and DTC actions already are, and results are delivered back to the
fragment via a broadcast event carrying a ModuleDiscoveryResult payload.
This app-side change depends on the new discoverModule API added to
obd-metrics 11.26.0-SNAPSHOT in a companion commit on that repo (which also
fixes a bug where ObdCommandHandler silently dropped empty/NO_DATA replies
for any command other than RoutineCommand, which would otherwise have
prevented "not found" probes from ever reporting back).

Verified via full app build: :datalogger:compileDebugKotlin,
:app:compileGiuliaDebugKotlin, spotlessApply, and :app:assembleGiuliaDebug
all pass. Not verified against real hardware in this environment - the
7E00 success-code assumption and default DA..F1 header convention follow
the existing bundled profile files and the StelvioOBD reference tool, but
have not been confirmed against a live adapter/vehicle.
@tzebrowski
tzebrowski merged commit 31482f7 into master Jul 26, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant