Class DeviceMessageProtocol
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
namestring
Properties
Entries
Gets every message kind the protocol supports.
public IReadOnlyList<DeviceProtocolEntry> Entries { get; }
Property Value
Name
Gets the protocol's name, for example "OCPP 1.6J".
public string Name { get; }
Property Value
Methods
Add<TMessage>()
Adds TMessage as a message kind, with its prefix as the description.
public DeviceMessageProtocol Add<TMessage>()
Returns
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
frameDeviceFrame