You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1 KiB

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