Files
WCS_YongFeng_CP/WCS_YongFeng_CP/Service/Comm/SerialPortHelper.cs
T
2025-06-06 22:10:47 +08:00

26 lines
749 B
C#

using System.IO.Ports;
namespace WCS_YongFeng
{
/// <summary>
/// 串口助手
/// </summary>
public class SerialPortHelper
{
public SerialPort serialPort { get; set; }
//获取计算机com口
public string[] PortNames { get { return System.IO.Ports.SerialPort.GetPortNames(); } }
public AlgorithmHelper algorithmHelper { get; set; }
public SerialPortHelper()
{
this.serialPort = new SerialPort();
this.algorithmHelper = new AlgorithmHelper();
this.serialPort.BaudRate = 9600;
this.serialPort.StopBits = StopBits.One;
this.serialPort.Parity = Parity.None;
this.serialPort.DataBits = 8;
}
}
}