Class DeviceMessageProtocol

Namespace
ProtoTest.Devices
Assembly
ProtoTest.Devices.dll

A protocol catalog built from message types: each type is one message kind, named after the type. A matched ExpectMessageAsync counts toward its kind, and DeviceCoverageCollector reports the types no test expected.

public sealed class DeviceMessageProtocol : IProtoDeviceProtocol
Inheritance
DeviceMessageProtocol
Implements
Inherited Members
Extension Methods

Constructors

DeviceMessageProtocol(string)

Creates an empty catalog named name; add message types with Add<TMessage>().

public DeviceMessageProtocol(string name)

Parameters

name string

Properties

Entries

Gets every message kind the protocol supports.

public IReadOnlyList<DeviceProtocolEntry> Entries { get; }

Property Value

IReadOnlyList<DeviceProtocolEntry>

Name

Gets the protocol's name, for example "OCPP 1.6J".

public string Name { get; }

Property Value

string

Methods

Add<TMessage>()

Adds TMessage as a message kind, with its prefix as the description.

public DeviceMessageProtocol Add<TMessage>()

Returns

DeviceMessageProtocol

Type Parameters

TMessage

Classify(DeviceFrame)

Classifies a frame to a message kind, or null when it is unknown to this protocol.

public string? Classify(DeviceFrame frame)

Parameters

frame DeviceFrame

Returns

string