Table of Contents

Class CobsDecoder

Namespace
Pamoja.Serial
Assembly
Pamoja.Serial.dll

Reassembles whole COBS frames from the chunks a serial port delivers.

public sealed class CobsDecoder : IDisposable
Inheritance
CobsDecoder
Implements
Inherited Members

Remarks

The counterpart to SlipDecoder, for links where the framing overhead has to stay small and predictable.

Constructors

CobsDecoder()

Creates an empty decoder, ready for the first chunk.

public CobsDecoder()

Exceptions

PamojaException

The native decoder could not be created.

Properties

Discarded

How many corrupt frames this decoder has discarded.

public ulong Discarded { get; }

Property Value

ulong

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Feed(ReadOnlySpan<byte>)

Feeds a chunk of the stream.

public byte[][] Feed(ReadOnlySpan<byte> chunk)

Parameters

chunk ReadOnlySpan<byte>

The bytes just read from the port.

Returns

byte[][]

Every frame this chunk completed, in order.

Exceptions

PamojaException

The native call failed.

Reset()

Discards any partly assembled frame.

public void Reset()