28 lines
828 B
C#
28 lines
828 B
C#
using System.IO.Ports;
|
||
|
||
namespace Model.Models
|
||
{
|
||
/// <summary>
|
||
/// 串口通信参数(DeviceCommand 内部纯数据类,供设备类构造函数使用)。
|
||
/// 与 UIShare.UIViewModel.SerialPortConfigVM 字段一一对应,
|
||
/// StopBits / Parity 在此处使用 System.IO.Ports 强类型枚举,
|
||
/// 由 DeviceManager 从字符串解析后填入。
|
||
/// </summary>
|
||
public class SerialPortConfig
|
||
{
|
||
public string PortName { get; set; } = "COM1";
|
||
|
||
public int BaudRate { get; set; } = 9600;
|
||
|
||
public int DataBits { get; set; } = 8;
|
||
|
||
public StopBits StopBits { get; set; } = StopBits.One;
|
||
|
||
public Parity Parity { get; set; } = Parity.None;
|
||
|
||
public int ReadTimeout { get; set; } = 3000;
|
||
|
||
public int WriteTimeout { get; set; } = 3000;
|
||
}
|
||
}
|