namespace EC.Util.Port;
///
/// 串口参数类
///
public class SerialPortParam
{
#region Fields
///
/// 串口名称
///
public string ComName { get; set; }
///
///波特率
///
public int BaudRate { get; set; }
///
/// 奇偶校验0-4=no,odd,even,mark,space
///
public int Parity { get; set; }
///
/// 校验位对应值
///
public int ParityValue { get; set; }
///
///数据位 默认
///
public int DataBits { get; set; }
///
/// 停止位
///
public int StopBits { get; set; }
///
/// ?Byte时,触发一次事件。设置为1时,易造成线程死锁
///
public int ReceivedBytesThreshold { get; set; }
#endregion Fields
public SerialPortParam()
{
ComName = string.Empty;
BaudRate = 9600;
Parity = 0;
DataBits = 8;
StopBits = 1;
ReceivedBytesThreshold = 128;
}
}