设备列表
This commit is contained in:
27
DeviceCommand/Base/SerialPortConfig.cs
Normal file
27
DeviceCommand/Base/SerialPortConfig.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.IO.Ports;
|
||||
|
||||
namespace DeviceCommand.Base
|
||||
{
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user