Class Sealed
public sealed class TransportOptions

Namespace: SharpMeter.Transport

Configuration options for transport connections.

Properties

NameDescription
BaudRate Gets or sets the baud rate for serial communication.
DataBits Gets or sets the data bits for serial communication.
Host Gets or sets the TCP host address.
Port Gets or sets the TCP port number.
PortName Gets or sets the serial port name (e.g., "COM3").
ReadTimeoutMs Gets or sets the read timeout in milliseconds.
ReceiveBufferSize Gets or sets the receive buffer size in bytes.
WriteTimeoutMs Gets or sets the write timeout in milliseconds.

BaudRate

int TransportOptions.BaudRate { get; set; }

Gets or sets the baud rate for serial communication.

DataBits

int TransportOptions.DataBits { get; set; }

Gets or sets the data bits for serial communication.

Host

string TransportOptions.Host { get; set; }

Gets or sets the TCP host address.

Port

int TransportOptions.Port { get; set; }

Gets or sets the TCP port number.

PortName

string TransportOptions.PortName { get; set; }

Gets or sets the serial port name (e.g., "COM3").

ReadTimeoutMs

int TransportOptions.ReadTimeoutMs { get; set; }

Gets or sets the read timeout in milliseconds.

ReceiveBufferSize

int TransportOptions.ReceiveBufferSize { get; set; }

Gets or sets the receive buffer size in bytes.

WriteTimeoutMs

int TransportOptions.WriteTimeoutMs { get; set; }

Gets or sets the write timeout in milliseconds.

View Source
/// <summary>
///     Configuration options for transport connections.
/// </summary>
public sealed class TransportOptions
{
#region Serial Options
    /// <summary>Gets or sets the serial port name (e.g., "COM3").</summary>
    public string PortName { get; set; } = "COM1";
    /// <summary>Gets or sets the baud rate for serial communication.</summary>
    public int BaudRate { get; set; } = 9600;
    /// <summary>Gets or sets the data bits for serial communication.</summary>
    public int DataBits { get; set; } = 8;
#endregion
#region TCP Options
    /// <summary>Gets or sets the TCP host address.</summary>
    public string Host { get; set; } = "127.0.0.1";
    /// <summary>Gets or sets the TCP port number.</summary>
    public int Port { get; set; } = 1153;
#endregion
#region Common Options
    /// <summary>Gets or sets the read timeout in milliseconds.</summary>
    public int ReadTimeoutMs { get; set; } = 5000;
    /// <summary>Gets or sets the write timeout in milliseconds.</summary>
    public int WriteTimeoutMs { get; set; } = 5000;
    /// <summary>Gets or sets the receive buffer size in bytes.</summary>
    public int ReceiveBufferSize { get; set; } = 4096;
#endregion
}
Was this page helpful?