设备连接

This commit is contained in:
hsc
2026-06-11 17:25:59 +08:00
parent a9ee9e974e
commit a62b6cbc8f
15 changed files with 144 additions and 35 deletions

View File

@@ -0,0 +1,27 @@
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;
}
}