Skip to main content

Crate tag_info

Crate tag_info 

Source
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::ostream prints 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.