Expand description
tag-info: print a tag’s information, configuration, status and state
log, or (--json) all of it as one JSON object for recording.
Port of host/commandline/tag-info.cc. Attaching connects under reset,
so the state shown is the one the tag restored on boot, not the one it
was in.
Usage: tag-info [-d] [-b BUS:DEVICE] [-j|--json].
Without --json it prints, in order: the base identity (or
“unidentified” for base firmware without the identify command), the
tag’s git SHA when the base reports one, the TagInfo message as protobuf
text followed by one type: label : value line per field, the
configuration, the current state with any firmware report, and the
persistent state-transition log. A failed configuration read is reported
on stderr and the rest still prints.
§Exit status
0 on success; 1 if no base matches, the attach fails or GetInfo fails.
Option errors exit 2 (clap).
§Hardware side effects
The tag is reset by the attach, and any run it was making is ended by
that reset (see docs/bench/verifying-firmware.md). Nothing is written to
the tag.
Structs§
- Cli 🔒
- print tag information. Attaching connects under reset, so the state shown is the one the tag restored on boot, not the one it was in: a tag past its start time is reported RUNNING because the reset started it, and a tag that had stalled reports whatever its backup registers held
Constants§
- INIT_
FAIL_ 🔒LSM_ CONFIG - IMUTag collection-init failure bits; see IMUTag inc/sensors.h.
- INIT_
FAIL_ 🔒MAG - Init-failure bit: the magnetometer failed to initialise.
- INIT_
FAIL_ 🔒PRESSURE - Init-failure bit: the pressure sensor failed to initialise.
- INIT_
FAIL_ 🔒STATUS_ MASK - Mask of the 8-bit first-failing-driver status code in the detail word.
- INIT_
FAIL_ 🔒STATUS_ SHIFT - Bit position of the first failing driver’s status code in the detail word.
Functions§
- format_
marker_ 🔒time - A marker epoch as UTC, or as a bare value when implausible: the tag stores -1 for an erased slot, and an unset RTC gives an epoch near zero.
- format_
transition_ 🔒detail - A marker’s detail word, decoded for the reason that produced it. Only the collection-init failure (EVENT_UNKNOWN) is decoded; anything else is shown in hex rather than dropped, so newer firmware detail is still visible.
- label 🔒
- Human labels for some TagInfo fields.
- main 🔒
- Parses the options, attaches (resetting the tag) and prints the report
or, with
--json, the JSON object. - ostream_
float 🔒 - A float as
std::ostreamprints it by default (%g, six digits). - print_
fields 🔒 - Lists every TagInfo field with its type, so a field added to the protocol prints without a change here. A field with explicit presence that is unset prints “(not set)”, not a default indistinguishable from a real zero; repeated fields are not expanded.
- print_
json 🔒 - Prints info, config and status as one JSON object, serialised by the library with the options tagcore uses to store them. Config and status are included when available rather than required.
- print_
marker 🔒 - Prints one state-transition marker: its index, state, transition reason and time, then any decoded detail word, then the flash page counts, supply voltage (V) and temperature recorded with it.
- print_
state_ 🔒log - Prints the tag’s persistent state-transition marker log.
- type_
name 🔒 - The C++
FieldDescriptor::type_name()of a field.