canair states
usage: canair states [-h] [--json]
{list,add,rm,rename,set-description,set-predicate,set-implies,set-excludes} ...
List the active profile's vehicle operating states, or edit the vocabulary (add/rm/rename/set-description/set-predicate/set-implies/set-excludes). Read-only companion of the state auto-suggestion used when recording captures.
positional arguments:
{list,add,rm,rename,set-description,set-predicate,set-implies,set-excludes}
list List the vocabulary, or look up one state's ECUs
(default)
add Add a new state to the vocabulary
rm Remove a state from the vocabulary
rename Rename a state everywhere the profile references it
set-description Set/clear a state's description
set-predicate Set/clear a state's when: auto-suggest predicate
set-implies Set/clear which broader states this one specializes
set-excludes Set/clear which states this one cannot hold at the
same instant
options:
-h, --help show this help message and exit
--json Output the list as JSON
canair states # list the vocabulary + usage
canair states --json # machine-readable
canair states READY # which ECUs are readable in READY
canair states CHARGING --json # reverse lookup as JSON
canair states add PRECONDITION --description "Cabin pre-conditioning"
canair states set-predicate CHARGING "BMS.BATTERY_CURRENT < -1"
canair states set-implies DRIVING READY # DRIVING is the specific reading
canair states set-implies DRIVING # clear the hierarchy
canair states set-excludes DRIVING PARKED # the two cannot co-occur
canair states set-description ACC "Accessory power (key/button ACC)"
canair states rename PRECONDITION PRECON --dry-run # every file a rename rewrites
canair states rename PRECONDITION PRECON # vocabulary + ecus/ + captures
canair states rm PRECONDITION
canair states list
usage: canair states list [-h] [--json] [state]
positional arguments:
state A state name (e.g. READY) — show which ECUs are readable/awake
in it
options:
-h, --help show this help message and exit
--json Output as JSON
canair states add
usage: canair states add [-h] [--description DESCRIPTION] [--when EXPR]
[--implies STATES] [--excludes STATES]
name
positional arguments:
name State name (normalized to UPPERCASE)
options:
-h, --help show this help message and exit
--description, -d DESCRIPTION
Human-readable description
--when, -w EXPR Auto-suggest predicate over ECU.PARAM
--implies, -i STATES Comma-separated broader states this one specializes
(e.g. READY) — when both match, the live view shows
this one
--excludes, -x STATES
Comma-separated states this one cannot hold at the
same instant (e.g. PARKED) — a session tagged with
both sequenced through them
canair states rm
usage: canair states rm [-h] name
positional arguments:
name State name
options:
-h, --help show this help message and exit
canair states rename
usage: canair states rename [-h] [--dry-run] [--yes] old new
Rename a state in vehicle_states.yaml and in every reference: the
vehicle_states lists in ecus/, every capture session's states and state_spans
timeline, the DTC log and the raw-CAN log index. All or nothing: a failed
write restores every file. Rewriting recorded data asks first unless --yes.
positional arguments:
old Current state name
new New state name (normalized to UPPERCASE)
options:
-h, --help show this help message and exit
--dry-run List the files and references; write nothing
--yes, -y Rewrite recorded data without asking
canair states set-description
usage: canair states set-description [-h] name [value]
positional arguments:
name State name
value Description (omit to clear)
options:
-h, --help show this help message and exit
canair states set-predicate
usage: canair states set-predicate [-h] name [EXPR]
positional arguments:
name State name
EXPR Predicate (omit to clear)
options:
-h, --help show this help message and exit
canair states set-implies
usage: canair states set-implies [-h] name [STATES]
Declare the specificity hierarchy: DRIVING implies READY means that when both
predicates match, DRIVING is the more specific (and shown) reading. Targets
must be declared states and the hierarchy must stay acyclic.
positional arguments:
name State name
STATES Comma-separated state names (omit to clear)
options:
-h, --help show this help message and exit
canair states set-excludes
usage: canair states set-excludes [-h] name [STATES]
Declare mutual exclusivity: DRIVING excludes PARKED means the two cannot
describe one instant, so a session tagged with both sequenced through them and
needs a state_spans timeline (canair captures uds --backfill-state-spans) for
per-capture filtering to be exact. The relation is symmetric — declaring it on
either side is enough. Targets must be declared states and may not also be
related by implies:.
positional arguments:
name State name
STATES Comma-separated state names (omit to clear)
options:
-h, --help show this help message and exit