SharpMeter

A modern, high-performance .NET library for smart meter communication supporting both ANSI C12.18/C12.19 PSEM and DLMS/COSEM (IEC 62056) protocols.

Features

  • Dual Protocol Support — PSEM and DLMS/COSEM in a single library
  • Fully Async — All I/O operations use async/await with CancellationToken
  • Zero-Allocation Hot Paths — Span<T>, ArrayPool<T>, System.IO.Pipelines
  • Pluggable Transport — ITransport interface for serial, TCP, or custom transports
  • Result<T> Error Handling — No exceptions for control flow
  • Built-in Emulator — Test without physical hardware
  • IAsyncEnumerable Streaming — Stream large table reads
  • ILogger<T> Integration — Microsoft.Extensions.Logging throughout

Packages

Package Description
SharpMeter.Core Protocol types, CRC-16, Result<T>, enums, models
SharpMeter.Transport ITransport interface, serial, TCP, loopback transports
SharpMeter.Client PSEM client — session, table, procedure services
SharpMeter.Dlms DLMS/COSEM — HDLC framing, OBIS codes, A-XDR codec
SharpMeter.Emulator Full PSEM meter emulator for testing

Quick Install

dotnet add package SharpMeter.Client      # For PSEM (ANSI C12.18)
dotnet add package SharpMeter.Dlms        # For DLMS/COSEM
dotnet add package SharpMeter.Emulator    # For testing

Next Steps

Last updated: 2026-04-08
Was this page helpful?