Table of Contents

Class RmtUtils

Namespace
nanoFramework.Hardware.Esp32.Rmt
Assembly
nanoFramework.Hardware.Esp32.Rmt.dll

Static class contains general utilities related to coding and decoding RMT data.

public static class RmtUtils
Inheritance
RmtUtils
Inherited Members

Methods

DecodeSymbolArrayToBytes(RmtSymbol[], int, bool, int, int, bool)

Decodes a sequence of captured RMT symbols into a packed byte array. This method interprets each symbol as one bit, using the duration of the SPACE level (carrier OFF) to determine whether the bit is 0 or 1.

public static byte[] DecodeSymbolArrayToBytes(RmtSymbol[] symbols, int thresholdMicroseconds, bool msbFirst, int symbolOffset, int symbolLength, bool spaceIsHigh)

Parameters

symbols RmtSymbol[]

The array of RmtSymbol structures captured by an RMT receiver. Each symbol contains two durations and two logic levels representing the waveform transitions.

thresholdMicroseconds int

The duration threshold, in microseconds, used to classify a bit. Durations shorter than this value are treated as logical 0; durations equal to or longer than this value are treated as logical 1.

msbFirst bool

If true, bits are packed into each byte starting from the most significant bit. If false, bits are packed starting from the least significant bit.

symbolOffset int

The index of the first symbol to decode. This allows skipping protocol‑specific headers, leaders, or preambles. Must be within the bounds of the symbol array.

symbolLength int

The number of symbols to decode. If set to -1, all remaining symbols from symbolOffset to the end of the array are decoded.

spaceIsHigh bool

Indicates which logic level represents SPACE (carrier OFF). If true, SPACE corresponds to logic HIGH; if false, SPACE corresponds to logic LOW. The duration of the SPACE level is used to determine the bit value.

Returns

byte[]

A byte array containing the decoded bit stream, packed sequentially from the selected symbols. The array length is (count + 7) / 8, where count is the number of decoded symbols. When symbolLength is -1, count is symbols.Length - symbolOffset.