Skip to content

canair ecu

usage: canair ecu [-h] <kind> ...

[UDS] Inspect or edit the profile's ECU registry.
  show   list ECUs, or show one ECU's details and PID stats (default)
  add    register a new ECU in the active profile's ecus/ (offline)

A bare `canair ecu` or `canair ecu BMS` is shorthand for `canair ecu show …`.

positional arguments:
  <kind>
    show      List ECUs, or show one ECU's details and PID stats
    add       Register a new ECU in the active profile (offline; no device)

options:
  -h, --help  show this help message and exit

  canair ecu                 # plain list of all ECUs (one per line)
  canair ecu BMS             # details + stats for the BMS
  canair ecu MDPS            # aliases resolve too (MDPS -> EPS)
  canair ecu 0x7E4           # hex TX id also works
  canair ecu 0x7EC           # hex RX id resolves too (the ECU's response address)
  canair ecu --states        # add a STATES column (states each ECU is readable in)
  canair ecu --sort states   # group the list by vehicle state
  canair ecu BMS --json      # machine-readable
  canair ecu --json          # all ECUs as JSON
  canair ecu HVAC edit       # open HVAC's ecus/ YAML in $EDITOR (TTY only)

Columns & legend:
  BUS    physical CAN bus segment(s) the ECU sits on (profile-specific codes,
         e.g. Hyundai B-CAN/P-CAN/C-CAN/MM-CAN/H-CAN/ALL); some ECUs span two
         (shown `H-CAN/P-CAN`). Blank (`—`) when unknown. The list is sorted by
         BUS by default. Shown as the last (widest, most-variable) column so
         the numeric columns stay aligned.
  PIDS   number of active (non-ignored) PIDs/DIDs defined.
  VERIF  verified/total parameters (green when all verified).
  CAPS   number of saved captures for the ECU.
  cap    in the per-PID detail view, "N cap" = number of saved captures for
         that individual PID.
  STATES the vehicle states the ECU is readable/awake in — its ECU-level
         `vehicle_states`, or the union of its PIDs' when that's unset. Opt-in
         (`--states`); shown after BUS.

  Sort with `--sort {bus,name,tx,proto,pids,verif,caps,states}`: string/hex
  columns (bus, name, tx, proto, states) ascending; numeric columns (pids,
  verif, caps) descending. `name` breaks ties.

canair ecu show

usage: canair ecu show [-h]
                       [--sort {bus,name,tx,proto,pids,verif,caps,states}]
                       [--states] [--json]
                       [ecu] [{pids,edit}]

List ECUs, or show one ECU's details and PID stats.

positional arguments:
  ecu                   ECU name, alias, or hex TX/RX id (omit to list all)
  {pids,edit}           'pids': compact per-PID view with each PID's latest
                        decoded state (e.g. `canair ecu BMS pids`); 'edit':
                        open the ECU's ecus/ YAML file in $EDITOR (TTY only —
                        agents must use `canair pids` instead; e.g. `canair
                        ecu HVAC edit`)

options:
  -h, --help            show this help message and exit
  --sort {bus,name,tx,proto,pids,verif,caps,states}
                        List ordering: 'bus' (default; group by CAN segment)
                        or by column: name/tx/proto/states (ascending),
                        pids/verif/caps (descending)
  --states              Add a STATES column: the vehicle states each ECU is
                        readable/awake in (ECU-level vehicle_states, else the
                        union of its PIDs')
  --json                Output as JSON

  canair ecu                 # plain list of all ECUs (one per line)
  canair ecu BMS             # details + stats for the BMS
  canair ecu MDPS            # aliases resolve too (MDPS -> EPS)
  canair ecu 0x7E4           # hex TX id also works
  canair ecu 0x7EC           # hex RX id resolves too (the ECU's response address)
  canair ecu --states        # add a STATES column (states each ECU is readable in)
  canair ecu --sort states   # group the list by vehicle state
  canair ecu BMS --json      # machine-readable
  canair ecu --json          # all ECUs as JSON
  canair ecu HVAC edit       # open HVAC's ecus/ YAML in $EDITOR (TTY only)

Columns & legend:
  BUS    physical CAN bus segment(s) the ECU sits on (profile-specific codes,
         e.g. Hyundai B-CAN/P-CAN/C-CAN/MM-CAN/H-CAN/ALL); some ECUs span two
         (shown `H-CAN/P-CAN`). Blank (`—`) when unknown. The list is sorted by
         BUS by default. Shown as the last (widest, most-variable) column so
         the numeric columns stay aligned.
  PIDS   number of active (non-ignored) PIDs/DIDs defined.
  VERIF  verified/total parameters (green when all verified).
  CAPS   number of saved captures for the ECU.
  cap    in the per-PID detail view, "N cap" = number of saved captures for
         that individual PID.
  STATES the vehicle states the ECU is readable/awake in — its ECU-level
         `vehicle_states`, or the union of its PIDs' when that's unset. Opt-in
         (`--states`); shown after BUS.

  Sort with `--sort {bus,name,tx,proto,pids,verif,caps,states}`: string/hex
  columns (bus, name, tx, proto, states) ascending; numeric columns (pids,
  verif, caps) descending. `name` breaks ties.

canair ecu add

usage: canair ecu add [-h] [--name NAME] [--description DESCRIPTION]
                      [--id-protocol ID_PROTOCOL] [--rx-id RX_ID]
                      [--mode MODE] [--target-address TARGET_ADDRESS]
                      [--source-address SOURCE_ADDRESS] [--fc-id FC_ID]
                      [--notes NOTES] [--overwrite] [--dir DIR]
                      TX

Register a new ECU as ecus/<name>.yaml in the active profile.

Offline counterpart to `canair discover --register` (which needs a live bus): use this to seed a known ECU into a blank profile — e.g. one shared with another model-year — ready for contributions. The write is validated and comment-preserving (never hand-edit ecus/).

positional arguments:
  TX                    ECU TX id (hex, e.g. 7C6 or 0x7C6)

options:
  -h, --help            show this help message and exit
  --name NAME           ECU short name (default: Unknown-<TX>)
  --description DESCRIPTION
                        Human description
  --id-protocol ID_PROTOCOL
                        Identity protocol (UDS | KWP2000)
  --rx-id RX_ID         CAN response address override (hex, e.g. 0x784) — for
                        an ECU whose response addr isn't tx_id + the profile's
                        addressing.rx_offset
  --mode MODE           Addressing mode (normal_11bit | normal_29bit |
                        normal_fixed_29bit | normal_extended_11bit |
                        extended_29bit) — required to seed a 29-bit ECU
  --target-address TARGET_ADDRESS
                        ISO-TP target extension byte (hex) —
                        extended-11-bit/29-bit modes
  --source-address SOURCE_ADDRESS
                        ISO-TP tester (source) byte (hex, default 0xF1) —
                        extended-11-bit modes
  --fc-id FC_ID         Flow-control arbitration override (hex) — functional-
                        TX / physical-RX ECUs
  --notes NOTES         Free-text notes
  --overwrite           Overwrite existing identity fields
  --dir DIR             ecus/ directory (default: active profile)

examples:
  canair ecu add 7C6 --name CLU --description 'Cluster (instrument panel)'
  canair ecu add 0x7E4 --name BMS --id-protocol KWP2000
  canair ecu add 0x704 --name BMS --rx-id 0x784   # non-standard response addr
  canair ecu add 0x18DB33F1 --name EVC --mode normal_29bit --rx-id 0x18DAF1DB --fc-id 0x18DADBF1
  canair ecu add 770 --name IGPM --notes 'Seeded offline; no PIDs yet'