27 lines
881 B
C#
27 lines
881 B
C#
namespace Common.Hardware.Ports
|
|
{
|
|
using System;
|
|
using System.IO.Ports;
|
|
|
|
public struct SerialPortStopBits
|
|
{
|
|
private readonly StopBits value;
|
|
|
|
private SerialPortStopBits(StopBits value)
|
|
=> this.value = value;
|
|
|
|
public override String ToString()
|
|
=> this.value.ToString();
|
|
|
|
public static readonly SerialPortStopBits None = StopBits.None;
|
|
public static readonly SerialPortStopBits One = StopBits.One;
|
|
public static readonly SerialPortStopBits Two = StopBits.Two;
|
|
public static readonly SerialPortStopBits OnePointFive = StopBits.OnePointFive;
|
|
|
|
public static implicit operator SerialPortStopBits(StopBits stopBits)
|
|
=> new SerialPortStopBits(stopBits);
|
|
|
|
public static implicit operator StopBits(SerialPortStopBits stopBits)
|
|
=> stopBits.value;
|
|
}
|
|
} |