API Reference

TRSFiles.TraceParamType

Encodes a trace parameter

  • typ is a coding byte, see trs_coding
  • len is the number of elements (i.e. number of bytes is len * typ.width)
  • offset is the byte offset in the data field where this param lives

For example TraceParam(trs_coding(UInt16), 16, 0) is a 16 element short array at byte offset 0. A next parameter would thus be at byte offset 32 (even though you probably shouldn't overlap parameters, the library allows it).

When you create a TRS file and your header has trace parameters, we sanity check and adjust the data length so that it fits.

Example use:

trs = trs_open("bla.trs", "w"; header = Dict(
        TRSFiles.TITLE_SPACE => ntitle,
        TRSFiles.LENGTH_DATA => ndata,
        TRSFiles.NUMBER_SAMPLES => nsamples,
        TRSFiles.SAMPLE_CODING => trs_coding(sampletype),
        TRSFiles.TRACE_PARAMETER_DEFINITIONS => Dict(
            "INPUT" => TraceParam(trs_coding(UInt8), 16, 0),
            "KEY" => TraceParam(trs_coding(UInt8), 16, 16),
            "OUTPUT" => TraceParam(trs_coding(UInt8), 16, 32),
        )))
source
TRSFiles.trs_dataMethod

Returns a matrix view of the data for key key in the trace set. Every column i contains the data for key key of trace i.

Calling this function without a key returns a matrix view of all data.

source
TRSFiles.trs_data_keysMethod

Returns a set of the data keys in the trace set, for example "LEGACY_DATA" or "INPUT", "OUTPUT", etc.

These keys are used as the key parameters in trs_data.

source
TRSFiles.trs_openFunction

Opens a trace set, you can use modes "r" or "w" or "a", but no combinations. Using mode "w" requires you to pass a header dictionary.

source
TRSFiles.trs_samplesMethod

Returns a matrix view of the samples in the trace set. Every column i contains the samples of trace i.

source
TRSFiles.trs_titleMethod

Returns a matrix view of the title bytes in the trace set. Every column i contains the title bytes of trace i.

source
TRSFiles.trs_yscaleMethod

Returns the scaling factor for the y-values in this traces. Multiplying the samples with this factor makes the values of the unit label returned by trs_ylabel.

source