4. Scan for data¶
Identity tells you what an ECU is. Scanning tells you what the ECU answers. canair scan
sweeps a range of PIDs or DIDs on one ECU and reports which ones return data. This data is the raw
material that you capture and decode.
Sweep a range¶
rangeis the general-purpose kind. A barecanair scan MyECUis a shorthand for it.--range START-ENDis the DID or PID range in hex, or a comma list of ranges (B000-B01F,B100-B11F). If you omit it, canair uses a smart default for each ECU. On a UDS ECU, the default is every DID family (a high byte such asB4xx) that the profile shows the ECU using. canair reads the families from the22and2FPIDs of the ECU and from the actuators that an IOControl scan found. An ECU often keeps its live-data DIDs in the same few families as its actuators. An ECU that you know only by its actuators therefore still gets a useful read sweep.--slots Nlimits each family to its first N DIDs.--service SVCselects the UDS service to probe, for exampleread-didfor22orlive-datafor21.canair scan range --helplists the presets.--saverecords the responders tocaptures/, so canair keeps the hits.--sessionand--wakeenter an extended session and wake a sleeping ECU first. Some ECUs answer only under these conditions.
Run canair scan range --help for the full flag list. Run canair scan range with no ECU for an
interactive wizard.
Safe discovery of other capabilities¶
canair scan has dedicated, safe sub-kinds. They probe what an ECU can do. Each one selects
the correct UDS or KWP2000 service automatically:
canair scan iocontrol MyECU # discover IOControl actuators (returnControlToECU)
canair scan routines MyECU # discover diagnostic routines (safe: requestRoutineResults)
canair scan sessions MyECU # discover which diagnostic session types it supports
These probes ask whether a capability exists. They do not actuate it.
There is one exception. The IOControl service of KWP2000 leaves its control-option byte to the
manufacturer. The 00 that scan iocontrol sends switches an output on on at least one Kia
ECU. For this reason, the scan asks for confirmation before it sweeps a KWP2000 ECU. Use --yes
to skip the question.
To trigger an actuator or a routine, use a separate action that asks for confirmation first (see Safety).
Turning hits into a plan¶
A scan hit means "this DID returns bytes". It does not mean that you know what the bytes mean. Record what to investigate next as a research lead. Then canair tracks it:
canair pids add-research MyECU --type decode --target 2101 \
--status captured --notes "27 bytes, changes while driving"
canair research --summary # your open reverse-engineering backlog
After scan iocontrol finds the actuators of an ECU, ask which of their DID families nobody has
read yet. An ECU often keeps its live-data records next to its actuators. Use this check on an ECU
that seemed to have no live data:
The command uses what the profile already records:
- the
iocontrol:andiocontrol_discoveries:entries scan_log:- the targets in
research: - the saved
scan range --savesessions (a sweep that the ECU slept through does not count)
Next: 5. Capture →