SharpMeter.Client

NameKindDescription
PsemClient Class High-level PSEM client for communicating with ANSI C12.18/C12.19 electric meters. Provides session management, table read/write, and procedure execution.

SharpMeter.Core

NameKindDescription
Result Record Discriminated union representing either a success value or a PsemError.

SharpMeter.Core.Crc

NameKindDescription
Crc16 Class CRC-16 calculator using the ANSI C12.18 reversed CCITT polynomial.

SharpMeter.Core.Enums

NameKindDescription
AccessLevel Enum Meter security access levels per ANSI C12.18.
AmiDevice Enum AMI (Advanced Metering Infrastructure) communication device types.
CalibrationAction Enum Calibration mode control actions (MP 73).
DirectLoadAction Enum Direct load control actions (SP 21).
EnergyType Enum Energy measurement types for test pulse configuration.
ManufacturerStatusFlags Enum Manufacturer-specific status flags (ED_MFG_STATUS from ST3).
MeterMode Enum Meter operational modes.
MeterModel Enum Supported meter models.
MeterTarget Enum Meter target utility types.
ProcedureResult Enum Result codes for PSEM procedure execution (read from ST8).
RelayAction Enum Remote disconnect relay actions (MP 89).
SoftswitchUpgrade Enum Softswitch feature upgrade identifiers.
StandardStatusFlags Enum Standard meter status flags (ED_STD_STATUS1 from ST3).

SharpMeter.Core.Models

NameKindDescription
MeterInfo Class Aggregated meter identification and configuration information.
TableData Record Represents raw data read from a PSEM table.

SharpMeter.Core.Protocol

NameKindDescription
BaudRate Enum ANSI C12.18 baud rate identifiers for serial communication negotiation.
BaudRateExtensions Class Extension methods for BaudRate.
ControlByte Record Represents the control byte in a PSEM L2 frame.
ControlFlags Enum ANSI C12.18 L2 frame control byte flags.
PsemConstants Class ANSI C12.18 protocol constants.
PsemError Record Represents an error that occurred during PSEM communication.
PsemErrorCode Enum Categorizes PSEM errors by source.
PsemFrame Record Represents an ANSI C12.18 L2 PSEM frame.
ResponseCode Enum ANSI C12.18 Layer 7 response codes returned by the meter.
ServiceCode Enum ANSI C12.18 Layer 7 service request codes.
ServiceRequest Record Represents an L7 PSEM service request with its payload.
ServiceResponse Record Represents an L7 PSEM service response from the meter.

SharpMeter.Core.Tables

NameKindDescription
BitFieldBuilder Class Builder for defining bit sub-fields within a FieldType.BitField.
BitFieldDefinition Record Defines a sub-field within a bit field, specifying which bits to extract.
FieldType Enum Defines how a table field's raw bytes should be interpreted.
ParsedBitField Record A parsed bit sub-field with its extracted value.
ParsedTable Class A fully deserialized PSEM table with named, typed fields.
ParsedTableField Class A deserialized table field with its raw bytes and human-readable value.
StandardTableDefinitions Class Provides built-in TableDefinition instances for standard ANSI C12.19 tables.
TableDefinition Class Defines the structure of a PSEM table — its ID, name, expected size, and field layout.
TableDefinitionBuilder Class Fluent builder for constructing TableDefinition instances. Provides a readable, type-safe API for defining PSEM table structures.
TableDefinitionLoader Class Loads TableDefinition instances from JSON schema files. Supports single table definitions or arrays of definitions.
TableDeserializer Class Deserializes raw PSEM table bytes into ParsedTable using a TableDefinition.
TableFieldDefinition Class Defines a single field within a PSEM table, including its offset, size, type, and optional sub-fields.
TableMapper Class Deserializes raw PSEM table bytes into strongly-typed C# objects using attribute-based mapping.
TableRegistry Class Registry of TableDefinition instances for looking up table structures by ID. Pre-loaded with standard ANSI C12.19 tables. Users can register custom/manufacturing table definitions.

SharpMeter.Core.Tables.Attributes

NameKindDescription
PsemTableAttribute Class Marks a class or record as a PSEM table definition for attribute-based deserialization.
TableFieldAttribute Class Marks a property as a PSEM table field, specifying its byte offset, size, and data type.

SharpMeter.Dlms

NameKindDescription
DlmsClient Class High-level DLMS/COSEM client for communicating with IEC 62056 compliant meters. Supports HDLC transport, association management, and GET/SET/ACTION operations.
DlmsClientOptions Class Configuration options for the DLMS client.

SharpMeter.Dlms.Codec

NameKindDescription
AxdrEncoder Class Encodes and decodes DLMS data values using A-XDR (Adapted External Data Representation) per IEC 62056.

SharpMeter.Dlms.Enums

NameKindDescription
ActionRequestType Enum DLMS ACTION request sub-types.
AuthenticationMechanism Enum DLMS/COSEM authentication mechanism identifiers.
DataAccessResult Enum DLMS data access result codes.
DlmsApduTag Enum DLMS APDU (Application Protocol Data Unit) tag identifiers.
DlmsDataType Enum DLMS/COSEM data type tags per IEC 62056 A-XDR encoding.
GetRequestType Enum DLMS GET request sub-types.
ObisCode Record Represents an OBIS (Object Identification System) code per IEC 62056-61. Format: A-B:C.D.E*F where each field is a byte value.
ObisMedium Enum OBIS medium identifiers (value group A).
SetRequestType Enum DLMS SET request sub-types.

SharpMeter.Dlms.Framing

NameKindDescription
HdlcAddress Record HDLC address with upper/lower address components.
HdlcControl Record HDLC control field supporting I, S, and U frame types.
HdlcFrame Record HDLC (High-level Data Link Control) frame for DLMS/COSEM communication per IEC 62056-46.
HdlcFrameType Enum HDLC frame types.

SharpMeter.Emulator

NameKindDescription
EmulatorConfiguration Class Configuration for the PSEM meter emulator.
EmulatorState Enum Represents the current state of the meter emulator state machine.
EmulatorTransport Class A transport implementation that emulates a PSEM meter. Incoming frames are processed by the emulator and responses are generated automatically. This transport can be used with Client.PsemClient for testing.
MeterEmulator Class Full ANSI C12.18 PSEM meter emulator that processes L7 service requests and generates responses.
TableStore Class In-memory storage for PSEM table data used by the emulator.

SharpMeter.Transport

NameKindDescription
ITransport Interface Defines the transport layer interface for PSEM communication. Implementations handle the physical send/receive of raw bytes over serial, TCP, or in-memory channels.
LoopbackTransport Class In-memory loopback transport using IO.Pipelines for testing. Data written via LoopbackTransport.SendAsync can be read back via LoopbackTransport.ReceiveAsync on the paired transport instance.
SerialTransport Class Serial port transport implementation for PSEM communication.
TcpTransport Class TCP transport implementation for PSEM communication.
TransportOptions Class Configuration options for transport connections.
Was this page helpful?