Skip to main content

Crate qtmonitor_fixture_capture

Crate qtmonitor_fixture_capture 

Source
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++ CaptureOptions holds 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 / SimpleDtoa digits (short, else long significant 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++ MessageToJsonString with add_whitespace, preserve_proto_field_names and 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_erased unless 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 msg as a JSON object at nesting level, following the field rules of message_to_json; a message with no printable fields is {}.
write_value 🔒
Appends one field value as JSON at nesting level.