Skip to content

Offline Mode

Not every part of logic analysis requires a device on the bench. mcsigrok loads all 131 protocol decoder definitions at startup by parsing the AST of the vendored libsigrokdecode source. This means the decoder catalog, channel mappings, option definitions, and stacking relationships are always available — no sigrok-cli binary, no USB device, no hardware at all.

These tools and resources operate entirely from the pre-loaded decoder metadata:

Tool / ResourceWhat it does
list_decodersSearch and filter the decoder catalog
decoder_infoFull metadata for any decoder — channels, options, annotations, stacking
sigrok://catalogComplete decoder catalog as a resource
sigrok://tagsTag taxonomy with decoder counts per category
sigrok://sample-ratesFX2LAFW sample rate reference

These tools need the sigrok-cli binary installed but do not need a connected device:

ToolWhat it does
list_driversEnumerate all supported hardware drivers
export_sessionConvert an existing .sr file to CSV, VCD, or other formats
session_infoInspect metadata of a saved session file

These tools perform live I/O with a connected logic analyzer:

ToolWhat it does
scan_devicesDiscover connected analyzers
show_deviceQuery device capabilities
captureAcquire signals
decode_captureDecode a session file (requires sigrok-cli)
decode_liveCapture and decode in one pass

The offline tools let you fully plan a capture before touching any hardware. This is useful when preparing for field work, ordering the right probes, or coordinating with someone else who has physical access to the target system.

Start by searching the catalog. Three filters are available, and they combine:

Browse by tag:

list_decoders(tag="Embedded/industrial")

Tags group decoders by application domain. Common tags include Embedded/industrial, PC/USB, Wireless/RF, IC/memory, and Analog/mixed signal. The sigrok://tags resource lists all available tags with their decoder counts.

Search by text:

list_decoders(grep="temperature")

This searches across the decoder ID, name, long name, and description. It is case-insensitive. Use it when you know what the protocol does but not what sigrok calls it.

Filter by input type:

list_decoders(input_type="spi")

This finds decoders that accept a specific input. Use input_type="logic" for base-layer decoders that read raw digital signals directly. Use input_type="spi" or input_type="i2c" to find higher-level decoders that stack on a base protocol — see the decoder stacking guide for details.

Once you find a decoder, inspect it with decoder_info to learn exactly what channels to wire:

decoder_info(decoder_id="spi")

The response includes:

  • channels — required channel definitions with names and descriptions
  • optional_channels — channels that add functionality but aren’t strictly necessary
  • options — configurable parameters with default values and valid choices
  • annotations — what the decoder produces (data types, error conditions)
  • stackable_decoders — higher-level decoders you can layer on top
  • stacks_on — base decoders this one can sit on top of

This tells you how many probes you need, which pins to connect where, and what configuration options to prepare.

The sigrok://sample-rates resource lists every sample rate supported by FX2LAFW-based analyzers (Saleae Logic clones and similar Cypress FX2 devices):

20 kHz, 25 kHz, 50 kHz, 100 kHz, 200 kHz, 250 kHz,
500 kHz, 1 MHz, 2 MHz, 3 MHz, 4 MHz, 6 MHz,
8 MHz, 12 MHz, 16 MHz, 24 MHz

Note that the maximum rate depends on channel count: 24 MHz with 8 channels, 12 MHz with 16 channels.

Cross-reference this with the protocol’s requirements. For UART at 115200 baud, 1 MHz or 2 MHz works well. For SPI at 4 MHz, you need at least 8 MHz sampling. The decoding protocols guide has a full table of recommended rates.

The explore_analyzer prompt is a guided workflow that walks through the full discovery-to-decode cycle. Even without hardware connected, it is a useful way to familiarize yourself with the tool sequence:

Use the explore_analyzer prompt

The prompt steps through scan_devices, show_device, capture, list_decoders, decoder_info, and decode_capture in order. On a machine without a connected analyzer, the hardware-dependent steps will fail — but you will see the exact tool calls and parameters you need to prepare for when hardware is available.

Preparing for field work. Before traveling to a site, use list_decoders and decoder_info to determine the exact channel wiring, sample rate, and decoder options you will need. Write them down or save them in a capture checklist. This avoids fumbling with decoder options while standing at an industrial control panel.

Learning the decoder catalog. The 131 decoders cover protocols from UART and SPI through CAN bus, JTAG, SDIO, and niche formats like DCF77 time signals and IR remote control codes. Browsing by tag is the fastest way to see what is available for a given domain.

Checking stacking compatibility. The stackable_decoders and stacks_on fields in decoder_info let you map out multi-layer decode chains before committing to a capture configuration. This is especially useful for USB analysis, where three or four decoders may need to stack.

Writing automation scripts. If you are building a test harness that calls mcsigrok tools programmatically, the offline metadata lets you validate decoder IDs, channel names, and option values without requiring hardware in the CI environment.