24 lines
658 B
C#
24 lines
658 B
C#
namespace Common.Hardware.Ports
|
|
{
|
|
using System;
|
|
|
|
public struct SerialPortDataBits
|
|
{
|
|
private readonly Int32 value;
|
|
|
|
private SerialPortDataBits(Int32 value)
|
|
=> this.value = value;
|
|
|
|
public override String ToString()
|
|
=> this.value.ToString();
|
|
|
|
public static readonly SerialPortDataBits X7 = 7;
|
|
public static readonly SerialPortDataBits X8 = 8;
|
|
|
|
public static implicit operator SerialPortDataBits(Int32 dataBits)
|
|
=> new SerialPortDataBits(dataBits);
|
|
|
|
public static implicit operator Int32(SerialPortDataBits dataBits)
|
|
=> dataBits.value;
|
|
}
|
|
} |