1 Star 0 Fork 28

hydeznb/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);
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/hydeznb/serial-port-forward.git
git@gitee.com:hydeznb/serial-port-forward.git
hydeznb
serial-port-forward
SerialPortForward
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385