zplCore.comzplCore.com

SerialPrinterConnection

public sealed class SerialPrinterConnection : IPrinterConnection, IAsyncDisposable

RS-232 / virtual COM port connection (System.IO.Ports). Opens the port per call.

Constructors

SignatureDescription
# SerialPrinterConnection(string portName, int baudRate = 9600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One, Handshake handshake = Handshake.XOnXOff)

Properties

PropertyTypeDescription
BaudRate { get; }int
DataBits { get; }int
Handshake { get; }Handshake
Parity { get; }Parity
PortName { get; }string
StopBits { get; }StopBits
WriteTimeout { get; set; }TimeSpan

Methods

Method SignatureReturnsDescription
# DisposeAsync()ValueTask
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>
# SendAsync(byte[] data, CancellationToken ct = default)Task