Skip to content

canair pids

usage: canair pids [-h]
                   {upsert-param,rename-param,rm-param,rename-pid,rm-pid,add-pid,add-research,set-status,rm-research,set-research-notes,set-research-result,set-pid-status,set-pid-variable-length,set-pid-notes,set-identity,rm-identity,set-can-bus,set-iocontrol-ranges,set-wake,set-addressing}
                   ...

[UDS] Safely edit ecus/ parameters and research entries (domain A — diagnostic UDS PIDs, freeform WiCAN expressions). The broadcast-frame (domain B) authoring counterpart is `canair signals` (linear signals/ maps).

positional arguments:
  {upsert-param,rename-param,rm-param,rename-pid,rm-pid,add-pid,add-research,set-status,rm-research,set-research-notes,set-research-result,set-pid-status,set-pid-variable-length,set-pid-notes,set-identity,rm-identity,set-can-bus,set-iocontrol-ranges,set-wake,set-addressing}
    upsert-param        Add or update a parameter
    rename-param        Rename a parameter (key only; fields preserved)
    rm-param            Remove a parameter
    rename-pid          Rename a PID key (e.g. B002 -> 22B002)
    rm-pid              Remove a whole PID (header, status, parameters)
    add-pid             Create a new parameter-less PID (discovery/identity
                        placeholder)
    add-research        Append a research: entry
    set-status          Update a research item's status
    rm-research         Remove a research: item
    set-research-notes  Set (or clear) a research item's free-text notes
    set-research-result
                        Set (or clear) a research item's short result summary
    set-pid-status      Set a PID's lifecycle status
    set-pid-variable-length
                        Flag a PID as returning legitimately variable-length
                        responses
    set-pid-notes       Set (or clear) a PID's free-text notes
    set-identity        Set a curated identity field (e.g. notes)
    rm-identity         Remove an identity field from an ECU
    set-can-bus         Set the physical CAN bus segment(s) the ECU sits on
    set-iocontrol-ranges
                        Set the IOControl (0x2F) scan DID ranges swept on this
                        ECU
    set-wake            Set how to rouse a fast-sleeping ECU before reads
                        (wake ritual)
    set-addressing      Set an ECU's CAN addressing override (mode / extension
                        bytes / FC id / rx_id)

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

  # Record a decoded parameter
  canair pids upsert-param MCU 2102 MCU_MOTOR_TORQUE "[S12:S13]/100" \
      --unit Nm --min -300 --max 300 --unverified --source "Soul VMCU CSV" \
      --notes "signed 16-bit BE at B12:B13"

  # Track a new investigation, then close it out
  canair pids add-research MCU --type decode --target 2103 \
      --status captured --priority P2 --prereq charging --notes "27 bytes, zeros"
  canair pids set-status MCU 2103 done --type decode

  # Set an ECU's curated identity notes (comment/format-preserving)
  canair pids set-identity BMS notes "Battery Management System — see sessions:."

canair pids upsert-param

usage: canair pids upsert-param [-h] [--unit UNIT] [--ha-class HA_CLASS]
                                [--mqtt-topic MQTT_TOPIC] [--min MIN]
                                [--max MAX] [--source SOURCE]
                                [--source-link URL] [--display DISPLAY]
                                [--notes NOTES]
                                [--type {numeric,enum,bitmask,ascii,date,bcd}]
                                [--value RAW=LABEL] [--bit INDEX=LABEL]
                                [--verified | --unverified]
                                [--enabled | --disabled] [--dir DIR]
                                [--no-validate]
                                ecu pid name expression

positional arguments:
  ecu
  pid
  name
  expression

options:
  -h, --help            show this help message and exit
  --unit UNIT
  --ha-class HA_CLASS
  --mqtt-topic MQTT_TOPIC
  --min MIN
  --max MAX
  --source SOURCE
  --source-link URL
  --display DISPLAY
  --notes NOTES
  --type {numeric,enum,bitmask,ascii,date,bcd}
                        Typed decoding: enum/bitmask/ascii/date/bcd (default
                        numeric). See --value / --bit for the enum/bitmask
                        maps.
  --value RAW=LABEL     Enum mapping (repeatable), e.g. --value 40=fan1
                        --value 45=fanMAX
  --bit INDEX=LABEL     Bitmask mapping (repeatable, 0=LSB), e.g. --bit 0=mon
                        --bit 5=sat
  --verified
  --unverified
  --enabled
  --disabled
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids rename-param

usage: canair pids rename-param [-h] [--dir DIR] [--no-validate]
                                ecu pid old new

positional arguments:
  ecu
  pid
  old            Current parameter name
  new            New parameter name

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids rm-param

usage: canair pids rm-param [-h] [--dir DIR] [--no-validate] ecu pid name

positional arguments:
  ecu
  pid
  name

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids rename-pid

usage: canair pids rename-pid [-h] [--dir DIR] [--no-validate] ecu old new

positional arguments:
  ecu
  old            Current PID code
  new            New PID code (hex, e.g. 22B002)

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids rm-pid

usage: canair pids rm-pid [-h] [--dir DIR] [--no-validate] ecu pid

positional arguments:
  ecu
  pid

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids add-pid

usage: canair pids add-pid [-h] [--status {active,draft,static,ignored}]
                           [--prereq PREREQ] [--period PERIOD] [--notes NOTES]
                           [--dir DIR] [--no-validate]
                           ecu pid

positional arguments:
  ecu
  pid                   PID code, hex (e.g. 21F2)

options:
  -h, --help            show this help message and exit
  --status {active,draft,static,ignored}
                        PID lifecycle (default: draft — swept/queryable but
                        not shipped)
  --prereq PREREQ, --vehicle-states PREREQ
                        Power state(s) in which this PID responds
                        (repeatable). Validated against the profile's vehicle-
                        state vocabulary at write time.
  --period PERIOD       Polling interval in ms
  --notes NOTES         Freeform notes for the PID
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids add-research

usage: canair pids add-research [-h] --type
                                {scan,decode,verify,iocontrol_scan} --target
                                TARGET --status {pending,captured,nrc,done}
                                [--priority {P1,P2,P3}] [--prereq PREREQ]
                                [--date DATE] [--created YYYY-MM-DD]
                                [--updated YYYY-MM-DD] [--result RESULT]
                                [--notes NOTES] [--source SRC]
                                [--what-to-test ITEM]
                                [--capture-protocol TEXT] [--dir DIR]
                                [--no-validate]
                                ecu

positional arguments:
  ecu

options:
  -h, --help            show this help message and exit
  --type {scan,decode,verify,iocontrol_scan}
  --target TARGET
  --status {pending,captured,nrc,done}
  --priority {P1,P2,P3}
  --prereq PREREQ, --vehicle-states PREREQ
                        Power state(s) prerequisite for this research
                        (repeatable). Validated against the profile's vehicle-
                        state vocabulary at write time.
  --date DATE
  --created YYYY-MM-DD  Override auto creation date (default: today)
  --updated YYYY-MM-DD  Override auto updated date (default: today)
  --result RESULT
  --notes NOTES
  --source SRC
  --what-to-test ITEM
  --capture-protocol TEXT
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids set-status

usage: canair pids set-status [-h]
                              [--type {scan,decode,verify,iocontrol_scan}]
                              [--index INDEX] [--dir DIR] [--no-validate]
                              ecu target {pending,captured,nrc,done}

positional arguments:
  ecu
  target
  {pending,captured,nrc,done}

options:
  -h, --help            show this help message and exit
  --type {scan,decode,verify,iocontrol_scan}
                        Disambiguate when multiple items share the target
  --index INDEX         Disambiguate by 0-based position among matches (after
                        --type filtering); needed when several items share the
                        same target and type
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids rm-research

usage: canair pids rm-research [-h]
                               [--type {scan,decode,verify,iocontrol_scan}]
                               [--index INDEX] [--dir DIR] [--no-validate]
                               ecu target

positional arguments:
  ecu
  target

options:
  -h, --help            show this help message and exit
  --type {scan,decode,verify,iocontrol_scan}
                        Disambiguate when multiple items share the target
  --index INDEX         Disambiguate by 0-based position among matches (after
                        --type filtering); needed when several items share the
                        same target and type
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids set-research-notes

usage: canair pids set-research-notes [-h]
                                      [--type {scan,decode,verify,iocontrol_scan}]
                                      [--index INDEX] [--dir DIR]
                                      [--no-validate]
                                      ecu target [value]

Set a research: item's notes: without touching status: or other fields, and without hand-editing the YAML.

Omit VALUE to clear the field. Short notes stay inline; longer ones become a word-wrapped folded block scalar. Disambiguate with --type/--index the same way as set-status/rm-research.

positional arguments:
  ecu
  target
  value                 New notes text (omit to clear the field)

options:
  -h, --help            show this help message and exit
  --type {scan,decode,verify,iocontrol_scan}
                        Disambiguate when multiple items share the target
  --index INDEX         Disambiguate by 0-based position among matches (after
                        --type filtering); needed when several items share the
                        same target and type
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids set-research-result

usage: canair pids set-research-result [-h]
                                       [--type {scan,decode,verify,iocontrol_scan}]
                                       [--index INDEX] [--dir DIR]
                                       [--no-validate]
                                       ecu target [value]

Set a research: item's result: without touching status: or other fields, and without hand-editing the YAML.

Omit VALUE to clear the field. Short results stay inline; longer ones become a word-wrapped folded block scalar. Disambiguate with --type/--index the same way as set-status/rm-research.

positional arguments:
  ecu
  target
  value                 New result text (omit to clear the field)

options:
  -h, --help            show this help message and exit
  --type {scan,decode,verify,iocontrol_scan}
                        Disambiguate when multiple items share the target
  --index INDEX         Disambiguate by 0-based position among matches (after
                        --type filtering); needed when several items share the
                        same target and type
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids set-pid-status

usage: canair pids set-pid-status [-h] [--dir DIR] [--no-validate]
                                  ecu pid {active,draft,static,ignored}

positional arguments:
  ecu
  pid
  {active,draft,static,ignored}

options:
  -h, --help            show this help message and exit
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids set-pid-variable-length

usage: canair pids set-pid-variable-length [-h] [--dir DIR] [--no-validate]
                                           ecu pid {true,false}

positional arguments:
  ecu
  pid
  {true,false}   true = variable-length (a short payload is not truncation);
                 false = clear the flag (fixed-length, the default)

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids set-pid-notes

usage: canair pids set-pid-notes [-h] [--dir DIR] [--no-validate]
                                 ecu pid [value]

Set the PID-level notes: — the record of what the page is and what is known about it. Because that record goes stale as decoding progresses, correcting it needs a validated editor rather than a hand-edit.

Omit VALUE to clear the field. Short notes stay inline; longer ones become a word-wrapped folded block scalar. An existing note keeps its position; a new one is inserted above parameters:.

positional arguments:
  ecu
  pid
  value          New notes text (omit to clear the field)

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids set-identity

usage: canair pids set-identity [-h] [--dir DIR] [--no-validate]
                                ecu field value

positional arguments:
  ecu
  field          Identity field name, e.g. notes or description
  value          New value (notes are stored as a folded block scalar)

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids rm-identity

usage: canair pids rm-identity [-h] [--dir DIR] [--no-validate] ecu field

positional arguments:
  ecu
  field          Identity field name to drop, e.g. software

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids set-can-bus

usage: canair pids set-can-bus [-h] [--dir DIR] [--no-validate]
                               ecu CODE [CODE ...]

positional arguments:
  ecu
  CODE           One or more bus codes from the profile's can_buses.yaml
                 (Hyundai: B-CAN/P-CAN/C-CAN/MM-CAN/H-CAN/ALL); some ECUs span
                 two, e.g. H-CAN P-CAN

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids set-iocontrol-ranges

usage: canair pids set-iocontrol-ranges [-h] [--dir DIR] [--no-validate]
                                        ecu RANGE [RANGE ...]

Set the ECU's iocontrol_scan_ranges: list — the 'START-END' hex DID ranges the
`canair scan iocontrol` sweep covers. When unset, ranges are derived from the
ECU's known 2F/22 DID keys, else the full DID space (0000-FFFF). This replaces
the old hardcoded HK body-controller zones with a per-ECU, profile-declared
range.

positional arguments:
  ecu
  RANGE          One or more 'START-END' hex DID ranges (e.g. B000-BFFF
                 C000-C0FF)

options:
  -h, --help     show this help message and exit
  --dir DIR      ecus/ directory (default: active profile)
  --no-validate  Skip the post-edit schema validation gate

canair pids set-wake

usage: canair pids set-wake [-h] --method {rapid_read,session,relay}
                            [--prime-pid REQ] [--attempts N]
                            [--interval-ms MS] [--sleep-timer-ms MS]
                            [--session-mode XX] [--notes NOTES] [--dir DIR]
                            [--no-validate]
                            ecu

Declare a per-ECU wake ritual (canlib.wake). Some modules (e.g. a Smart Key
Module) power their CAN transceiver only briefly and sleep again within a
second or two, so a single 10 01 wake races the sleep timer. `rapid_read`
fires a cheap prime PID back-to-back to hold the transceiver awake, then opens
a session — honoured by `session <ECU> --wake` on both transports.

positional arguments:
  ecu

options:
  -h, --help            show this help message and exit
  --method {rapid_read,session,relay}
                        rapid_read = back-to-back primes (fast-sleepers);
                        session = single 10 01; relay = rapid_read + iocontrol
                        relay (Ioniq SKM, needs skm_wakeup quirk)
  --prime-pid REQ       Cheap full UDS request fired repeatedly to hold the
                        ECU awake (SID-first, e.g. 22B003 / 1001 / 3E00;
                        default 1001)
  --attempts N          Back-to-back prime frames (default 6)
  --interval-ms MS      Gap between primes in ms — must be under the ECU's
                        sleep timer (default 60)
  --sleep-timer-ms MS   Documented time the ECU stays awake after a frame
                        (informational)
  --session-mode XX     DiagnosticSessionControl sub-function entered after
                        waking (default 03)
  --notes NOTES         Free-text note on the wake ritual
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

canair pids set-addressing

usage: canair pids set-addressing [-h] [--mode MODE]
                                  [--target-address TARGET_ADDRESS]
                                  [--source-address SOURCE_ADDRESS]
                                  [--fc-id FC_ID] [--rx-id RX_ID] [--dir DIR]
                                  [--no-validate]
                                  ecu

Set the make-specific CAN addressing knobs on an ECU: the addressing `mode` (11-bit vs the 29-bit modes / extended-11-bit), the ISO-TP extension bytes (`target_address`/`source_address`, for BMW/PSA extended-11-bit), a flow-control arbitration override (`fc_id`, for functional-TX / physical-RX ECUs like Renault/Mitsubishi), and/or the response-address `rx_id`. Writes only the fields given.

positional arguments:
  ecu

options:
  -h, --help            show this help message and exit
  --mode MODE           Addressing mode (normal_11bit | normal_29bit |
                        normal_fixed_29bit | normal_extended_11bit |
                        extended_29bit)
  --target-address TARGET_ADDRESS
                        ISO-TP target extension byte (hex, e.g. 0x12) —
                        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
  --rx-id RX_ID         CAN response-address override (hex, e.g. 0x784)
  --dir DIR             ecus/ directory (default: active profile)
  --no-validate         Skip the post-edit schema validation gate

examples:
  canair pids set-addressing PCM --mode normal_fixed_29bit
  canair pids set-addressing DME --mode normal_extended_11bit --target-address 0x12
  canair pids set-addressing EVC --mode normal_29bit --fc-id 0x18DADBF1
  canair pids set-addressing BMS --rx-id 0x784