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 (references are NOT rewritten)
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 (ACC1)"
canair states rename ACC2 IGN
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 DESCRIPTION, -d DESCRIPTION
Human-readable description
--when EXPR, -w EXPR Auto-suggest predicate over ECU.PARAM
--implies STATES, -i STATES
Comma-separated broader states this one specializes
(e.g. READY) — when both match, the live view shows
this one
--excludes STATES, -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
options:
-h, --help show this help message and exit
canair states rename
usage: canair states rename [-h] old new
positional arguments:
old
new
options:
-h, --help show this help message and exit
canair states set-description
usage: canair states set-description [-h] name [value]
positional arguments:
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
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
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
STATES Comma-separated state names (omit to clear)
options:
-h, --help show this help message and exit