Expand description
qtmonitor-fixture-capture: capture qtmonitor fake-tag fixture data from
an attached tag.
Port of host/commandline/qtmonitor-fixture-capture.cc. Reads the monitor
information, configuration, status, and voltage responses used by
qtmonitor and serializes them as protobuf JSON inside the documentation
fixture schema (host/docs/fixtures/qtmonitor/). The tool is
intentionally read-only: it does not start, stop, erase, test, or
otherwise drive tag state.
Usage: qtmonitor-fixture-capture [-d] [-b BUS:DEVICE] [-o PATH|-] [--id ID] [--label TEXT] [--notes TEXT] [--fallback-config PATH] [--status-name NAME | --state NAME] [--no-config] [--sanitize] [--print-summary]. The output defaults to qtmonitor-fixture.json, and
its parent directories are created. --capture-default-config is
accepted and does nothing, since capturing the configuration is already
the default. Unlike the other tools it does not use
tag_tools::BaseArgs: with several bases and no --base it lists them
rather than printing help.
sectors_erased is always cleared from the status unless the tag is in
S_RESET; --sanitize additionally replaces the chip UUID with zeros and
source_path with a path derived from --id or the tag type.
§Exit status
0 once the fixture is written; 1 if no single base is selected, or the attach, an info, config, status or voltage read, or the write fails. Option errors exit 2 (clap).
§Hardware side effects
“Read-only” means no request changes tag state; the attach itself still resets the tag, so the status captured is the one after that reset.
Structs§
- Capture 🔒
- The options after parsing, as the C++
CaptureOptionsholds them. - Cli 🔒
- capture qtmonitor fake-tag fixture data from an attached tag
Functions§
- base64 🔒
- Standard base64 with padding, as proto3 JSON writes
bytes. - indent 🔒
- The indent for nesting
level: one space per level, as the C++ JSON printer writes it. - json_
escape 🔒 - Escapes a string for the hand-written JSON envelope.
- json_
float 🔒 - A float as proto3 JSON written by the C++ library:
SimpleFtoa/SimpleDtoadigits (short, elselongsignificant digits when that does not round-trip), non-finite values as the strings proto3 requires. - lower_
kebab 🔒 - Protobuf enum names as stable lower-kebab fixture ids.
- main 🔒
- Selects a base, attaches, reads the four responses and writes the fixture.
- message_
to_ 🔒json - Serialises a message in the fixture JSON convention: the C++
MessageToJsonStringwithadd_whitespace,preserve_proto_field_namesand always-print-fields-without-presence. - print_
summary 🔒 - Prints the tag type, firmware, git hash, captured state, flash page counts, voltage (V) and output path to stderr.
- sanitize_
info 🔒 - Replaces hardware- and workstation-specific TagInfo fields.
- sanitize_
status 🔒 - Clears
sectors_erasedunless the tag is mid-reset, where it means something. - select_
device 🔒 - Chooses the base, requiring –base when more than one is found.
- tag_
type_ 🔒name - The protobuf name of a tag type number, such as
"BITTAG_LE", or the number itself when it has no name. - utc_
timestamp 🔒 - The current UTC time as ISO-8601, e.g.
2026-10-26T12:01:09Z. - write_
fixture 🔒 - Composes the fixture and writes it to the output path, or stdout for
-. - write_
message 🔒 - Appends
msgas a JSON object at nestinglevel, following the field rules ofmessage_to_json; a message with no printable fields is{}. - write_
value 🔒 - Appends one field value as JSON at nesting
level.