4 Star 71 Fork 20

老大哥 / SerialPortForward

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
PluginCommon.cs 890 Bytes
一键复制 编辑 原始数据 按行查看 历史
using ITLDG.DataCheck;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SerialPortForward
{
public class PluginCommon
{
SerialPortInfo com1, com2;
Action<IPlugin, bool, byte[]> _OnWriteData;
public PluginCommon(SerialPortInfo com1, SerialPortInfo com2, Action<IPlugin, bool, byte[]> OnWriteData)
{
_OnWriteData = OnWriteData;
this.com1 = com1;
this.com2 = com2;
}
/// <summary>
/// 发送数据到串口
/// </summary>
/// <param name="bytes">要发送的数据</param>
/// <param name="isCom1">是否是串口1</param>
public void WriteData(IPlugin plugin, byte[] bytes, bool isCom1 = true)
{
_OnWriteData?.Invoke(plugin, isCom1, bytes);
}
}
}
C#
1
https://gitee.com/itldg/serial-port-forward.git
git@gitee.com:itldg/serial-port-forward.git
itldg
serial-port-forward
SerialPortForward
master

搜索帮助