diff --git a/.gitignore b/.gitignore index 2e24693..19c86b4 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ obj/ # 排除某些项目 +Net461DllTest/Enums/PlcVarEnum.cs \ No newline at end of file diff --git a/Library/Entity/ExplicitData.cs b/Library/Entity/ExplicitData.cs index ff97094..3b3a69c 100644 --- a/Library/Entity/ExplicitData.cs +++ b/Library/Entity/ExplicitData.cs @@ -20,9 +20,9 @@ namespace Serein.Library.Entity /// public bool IsExplicitData { get; set; } /// - /// 是否为值转换器 + /// 转换器 IEnumConvertor<,> /// - public bool IsEnumConvertor { get; set; } + public Func Convertor { get; set; } ///// ///// 显式类型 ///// @@ -57,6 +57,7 @@ namespace Serein.Library.Entity IsExplicitData = IsExplicitData, ExplicitType = ExplicitType, ExplicitTypeName = ExplicitTypeName, + Convertor = Convertor, DataType = DataType, ParameterName = ParameterName, DataValue = string.IsNullOrEmpty(DataValue) ? string.Empty : DataValue, diff --git a/Library/Entity/MethodDetails.cs b/Library/Entity/MethodDetails.cs index 55b9155..1cd15c0 100644 --- a/Library/Entity/MethodDetails.cs +++ b/Library/Entity/MethodDetails.cs @@ -7,11 +7,13 @@ namespace Serein.Library.Entity { - + /// + /// 每个节点有独自的MethodDetails实例 + /// public class MethodDetails { /// - /// 拷贝 + /// 从DLL拖动出来时拷贝新的实例 /// /// public MethodDetails Clone() @@ -37,7 +39,7 @@ namespace Serein.Library.Entity /// /// 是否保护参数 /// - public bool IsProtectionParameter { get; set; } = false; + public bool IsProtectionParameter { get; set; } = true; /// /// 作用实例的类型 diff --git a/Library/NodeAttribute.cs b/Library/NodeAttribute.cs index 7479c56..bd733cc 100644 --- a/Library/NodeAttribute.cs +++ b/Library/NodeAttribute.cs @@ -9,6 +9,14 @@ namespace Serein.Library.Attributes [AttributeUsage(AttributeTargets.Property)] public sealed class AutoInjectionAttribute : Attribute { + } + + /// + /// 表示该类自动注册 + /// + [AttributeUsage(AttributeTargets.Class)] + public sealed class AutoRegisterAttribute : Attribute + { } /// @@ -95,54 +103,30 @@ namespace Serein.Library.Attributes } } - - - [AttributeUsage(AttributeTargets.Field)] - public class PLCValueAttribute : Attribute + /// + /// 绑定转换器 + /// + [AttributeUsage(AttributeTargets.Parameter)] + public class BindConvertorAttribute : Attribute { - public enum VarType + public Type EnumType { get; } + public Type ConvertorType { get; } + + public BindConvertorAttribute(Type @enum, Type convertor) { - /// - /// 可写入值 - /// - Write, - /// - /// 定时读取的可写入值(用来写入前判断),应该几乎不会有这种类型? - /// - TimingReadOrWrite, - /// - /// 只读取值(使用时刷新) - /// - ReadOnly, - /// - /// 定时刷新的只读取值(定时刷新用来触发触发器) - /// - TimingReadOnly, - } - - public bool IsProtected { get; } - public Type DataType { get; } - public string Var { get; } - //public int Length { get; } - //public double Offset { get; } - public VarType Type { get; } - //public int RefreshInterval { get; } - - - - public PLCValueAttribute(Type type, - string @var, - VarType varType - //int refreshInterval = 100 - ) - { - DataType = type; - Var = @var; - //Offset = offset; - //RefreshInterval = refreshInterval; - Type = varType; - //Length = length; + this.EnumType = @enum; + this.ConvertorType = convertor; } } + /// + /// 枚举转换器接口 + /// + /// + /// + public interface IEnumConvertor + { + TValue Convertor(TEnum e); + } + } diff --git a/Library/Utils/EnumHelper.cs b/Library/Utils/EnumHelper.cs index 0ef6161..3056f9c 100644 --- a/Library/Utils/EnumHelper.cs +++ b/Library/Utils/EnumHelper.cs @@ -24,16 +24,16 @@ namespace Serein.Library.Utils return attribute != null ? valueSelector(attribute) : default; } - //public static TResult GetBoundValue(TEnum enumValue, - // Func valueSelector) - // where TEnum : Enum - // where TAttribute : Attribute - //{ - // var fieldInfo = typeof(TEnum).GetField(enumValue.ToString()); - // var attribute = fieldInfo.GetCustomAttribute(); + public static TResult GetBoundValue(TEnum enumValue, + Func valueSelector) + where TEnum : Enum + where TAttribute : Attribute + { + var fieldInfo = typeof(TEnum).GetField(enumValue.ToString()); + var attribute = fieldInfo.GetCustomAttribute(); - // return attribute != null ? valueSelector(attribute) : default; - //} + return attribute != null ? valueSelector(attribute) : default; + } diff --git a/Net461DllTest/Data/MyData.cs b/Net461DllTest/Data/MyData.cs deleted file mode 100644 index 5ad9543..0000000 --- a/Net461DllTest/Data/MyData.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Net461DllTest.Data -{ - public class MyData - { - public int[] Values { get; set; } = new int[] { 1, 1, 4, 5, 1, 4, 1, 9, 9, 9 }; - public int Count { get; set; } - public string Tips { get; set; } - } -} diff --git a/Net461DllTest/Device/PlcDevice.cs b/Net461DllTest/Device/PlcDevice.cs deleted file mode 100644 index a7eb7ad..0000000 --- a/Net461DllTest/Device/PlcDevice.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Net461DllTest.Data; -using Net461DllTest.Signal; -using Serein.Library.Attributes; -using Serein.Library.NodeFlow.Tool; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Net461DllTest.Device -{ - - - public class PlcDevice : ChannelFlowTrigger - { - [AutoInjection] - public MyData MyData { get; set; } - - public PlcDevice() - { - PlcId = 114514 + 10000000 * new Random().Next(1, 9); - } - public int PlcId { get; set; } - - public void InitDevice(string ip, int port, string tips) - { - Write($"模拟设备初始化 :{Environment.NewLine}" + - $" ip :{ip}{Environment.NewLine}" + - $"port:{port}{Environment.NewLine}" + - $"tips:{tips}{Environment.NewLine}"); - } - - public void Write(T value) - { - Console.WriteLine($"{value}"); - } - public void Read() - { - Console.WriteLine($"读取数据:... "); - } - public void Disconnect() - { - Console.WriteLine($"断开连接..."); - } - } - -} diff --git a/Net461DllTest/Device/PrakingDevice.cs b/Net461DllTest/Device/PrakingDevice.cs new file mode 100644 index 0000000..e5b50aa --- /dev/null +++ b/Net461DllTest/Device/PrakingDevice.cs @@ -0,0 +1,18 @@ +using Net461DllTest.LogicControl; +using Serein.Library.Attributes; +using Serein.Library.NodeFlow.Tool; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Net461DllTest.Device +{ + [AutoRegister] + public class PrakingDevice : ChannelFlowTrigger + { + + } + +} diff --git a/Net461DllTest/Device/SiemensPlcDevice.cs b/Net461DllTest/Device/SiemensPlcDevice.cs new file mode 100644 index 0000000..b573e15 --- /dev/null +++ b/Net461DllTest/Device/SiemensPlcDevice.cs @@ -0,0 +1,70 @@ +using IoTClient.Clients.PLC; +using Net461DllTest.Enums; +using Net461DllTest.Signal; +using Net461DllTest.Utils; +using Serein.Library.NodeFlow.Tool; +using System; + +namespace Net461DllTest.Device +{ + + /// + /// 官方文档:如果没有主动Open,则会每次读写操作的时候自动打开自动和关闭连接,这样会使读写效率大大减低。所以建议手动Open和Close。 + /// + public class SiemensPlcDevice : ChannelFlowTrigger + { + public SiemensClient Client { get; set; } + + public IoTClient.Common.Enums.SiemensVersion Version { get; set; } + public string IP { get; set; } + public int Port { get; set; } + public PlcState State { get; set; } = PlcState.PowerOff; + + + public void Init(IoTClient.Common.Enums.SiemensVersion version,string ip, int port) + { + Client = new SiemensClient(version, ip, port); + Version = version; + IP = ip; + Port = port; + } + + public void ResetDevice() + { + Client?.Close(); + Client = null; + } + + public void Write(PlcVarInfo plcValue, object value) + { + try + { + Client.WriteToPlcValue(plcValue, value); + } + catch (Exception ex) + { + Console.WriteLine($"写入出错:{this}{plcValue}。{ex.Message}"); + throw; + } + } + public object Read(PlcVarInfo plcValue) + { + try + { + return Client.ReadToPlcValue(plcValue); + } + catch (Exception ex) + { + Console.WriteLine($"读取出错:{this}{plcValue}。{ex.Message}"); + throw; + } + + } + + public override string ToString() + { + return $"西门子Plc[{this.Version}-{this.IP}:{this.Port}]"; + } + } + +} diff --git a/Net461DllTest/Enums/FromValue.cs b/Net461DllTest/Enums/FromValue.cs new file mode 100644 index 0000000..70cafbb --- /dev/null +++ b/Net461DllTest/Enums/FromValue.cs @@ -0,0 +1,19 @@ +using Net461DllTest.View; +using Serein.Library.Attributes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Net461DllTest.Signal +{ + public enum FromValue + { + None, + [BindValue(typeof(FromWorkBenchView))] + FromWorkBenchView, + [BindValue(typeof(TestFormView))] + TestFormView, + } +} diff --git a/Net461DllTest/Enums/PlcState.cs b/Net461DllTest/Enums/PlcState.cs new file mode 100644 index 0000000..12e4eed --- /dev/null +++ b/Net461DllTest/Enums/PlcState.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Net461DllTest.Enums +{ + public enum PlcState + { + /// + /// 关机 + /// + PowerOff, + /// + /// 正在运行 + /// + Runing, + /// + /// 发生异常 + /// + Error, + /// + /// 维护中 + /// + Maintenance, + } +} diff --git a/Net461DllTest/Flow/LogicControl.cs b/Net461DllTest/Flow/LogicControl.cs deleted file mode 100644 index 58a46b2..0000000 --- a/Net461DllTest/Flow/LogicControl.cs +++ /dev/null @@ -1,131 +0,0 @@ -using Net461DllTest.Data; -using Net461DllTest.Device; -using Net461DllTest.Signal; -using Net461DllTest.Web; -using Serein.Library.Api; -using Serein.Library.Attributes; -using Serein.Library.Enums; -using Serein.Library.Ex; -using Serein.Library.Framework.NodeFlow; -using Serein.Library.NodeFlow.Tool; -using Serein.Library.Web; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Net461DllTest.Flow -{ - [DynamicFlow] - public class LogicControl - { - [AutoInjection] - public PlcDevice MyPlc { get; set; } - - - #region 初始化、初始化完成以及退出的事件 - [NodeAction(NodeType.Init)] // Init : 初始化事件,流程启动时执行 - public void Init(IDynamicContext context) - { - context.Env.IOC.Register(); // 注册Plc设备 - context.Env.IOC.Register(); // 注册数据类 - context.Env.IOC.Register(); // 注册Web服务 - // // 注册控制器 - context.Env.IOC.Run(router => { - router.RegisterController(typeof(ApiController)); - }); - } - - [NodeAction(NodeType.Loading)] // Loading 初始化完成已注入依赖项,可以开始逻辑上的操作 - public void Loading(IDynamicContext context) - { - context.Env.IOC.Run((web) => - { - web.Start("http://*:8089/"); // 开启 Web 服务 - }); - } - - [NodeAction(NodeType.Exit)] // 流程结束时自动执行 - public void Exit(IDynamicContext context) - { - MyPlc.Disconnect(); - MyPlc.CancelAllTasks(); - } - - #endregion - - #region 触发器 - - [NodeAction(NodeType.Flipflop, "等待信号触发", ReturnType = typeof(int))] - public async Task WaitTask(OrderSignal order = OrderSignal.Command_1) - { - try - { - TriggerData triggerData = await MyPlc.CreateChannelWithTimeoutAsync(order, TimeSpan.FromMinutes(5), 0); - if (triggerData.Type == TriggerType.Overtime) - { - throw new FlipflopException("超时取消"); - } - //int.TryParse(triggerData.Value.ToString(),out int result); - MyPlc.MyData.Count += (int)triggerData.Value; - return new FlipflopContext(FlipflopStateType.Succeed, MyPlc.MyData.Count); - } - catch (FlipflopException) - { - throw; - } - catch (Exception) - { - return new FlipflopContext(FlipflopStateType.Error); - } - - } - - #endregion - - #region 动作 - - [NodeAction(NodeType.Action, "初始化")] - public PlcDevice PlcInit(string ip = "192.168.1.1", - int port = 6688, - string tips = "测试") - { - MyPlc.InitDevice(ip, port, tips); - return MyPlc; - } - - - [NodeAction(NodeType.Action, "自增")] - public PlcDevice 自增(int number = 1) - { - MyPlc.MyData.Count += number; - return MyPlc; - } - - [NodeAction(NodeType.Action, "重置计数")] - public void 重置计数() - { - MyPlc.MyData.Count = 0; - } - - [NodeAction(NodeType.Action, "触发信号")] - public void 光电1信号触发(int data) - { - MyPlc.Write($"{MyPlc.PlcId.ToString("00000")} - 信号源[光电1] - 模拟写入 : {data}{Environment.NewLine}"); - } - - //[NodeAction(NodeType.Action, "触发光电2")] - //public void 光电2信号触发(int data) - //{ - // MyPlc.Write($"{MyPlc.PlcId.ToString("00000")} - 信号源[光电2] - 模拟写入 : {data}{Environment.NewLine}"); - //} - - //[NodeAction(NodeType.Action, "触发光电3")] - //public void 光电3信号触发(int data) - //{ - // MyPlc.Write($"{MyPlc.PlcId.ToString("00000")} - 信号源[光电3] - 模拟写入 : {data}{Environment.NewLine}"); - //} - #endregion - } -} diff --git a/Net461DllTest/LogicControl/ParkingLogicControl.cs b/Net461DllTest/LogicControl/ParkingLogicControl.cs new file mode 100644 index 0000000..291e700 --- /dev/null +++ b/Net461DllTest/LogicControl/ParkingLogicControl.cs @@ -0,0 +1,91 @@ +using Net461DllTest.Device; +using Net461DllTest.Signal; +using Net461DllTest.ViewModel; +using Serein.Library.Api; +using Serein.Library.Attributes; +using Serein.Library.Enums; +using Serein.Library.Ex; +using Serein.Library.Framework.NodeFlow; +using Serein.Library.NodeFlow.Tool; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Net461DllTest.LogicControl +{ + + public enum ParkingCommand + { + GetPparkingSpace, + } + + + [DynamicFlow] + public class ParkingLogicControl + { + [AutoInjection] + public PrakingDevice PrakingDevice { get; set; } + + + [NodeAction(NodeType.Init)] + public void Init(IDynamicContext context) + { + + context.Env.IOC.Register(); + } + + + + [NodeAction(NodeType.Flipflop, "等待车位调取命令",ReturnType=typeof(string))] + public async Task GetPparkingSpace(ParkingCommand parkingCommand = ParkingCommand.GetPparkingSpace) + { + try + { + TriggerData triggerData = await PrakingDevice.CreateChannelWithTimeoutAsync(parkingCommand, TimeSpan.FromMinutes(5), 0); + if (triggerData.Type == TriggerType.Overtime) + { + throw new FlipflopException("超时取消"); + } + if(triggerData.Value is string spaceNum) + { + await Console.Out.WriteLineAsync("收到命令:调取车位,车位号"+ spaceNum); + return new FlipflopContext(FlipflopStateType.Succeed, spaceNum); + } + else + { + throw new FlipflopException("并非车位号"); + } + + } + catch (FlipflopException) + { + throw; + } + catch (Exception) + { + return new FlipflopContext(FlipflopStateType.Error); + } + } + + + [NodeAction(NodeType.Action, "手动触发模拟调取车位")] + public void Storage(string spaceNum = "101") + { + if (PrakingDevice.TriggerSignal(ParkingCommand.GetPparkingSpace, spaceNum)) + { + Console.WriteLine("发送命令成功:调取车位" + spaceNum); + + } + else + { + Console.WriteLine("发送命令失败:调取车位" + spaceNum); + + } + } + + + + } +} diff --git a/Net461DllTest/LogicControl/PlcLogicControl.cs b/Net461DllTest/LogicControl/PlcLogicControl.cs new file mode 100644 index 0000000..7d784df --- /dev/null +++ b/Net461DllTest/LogicControl/PlcLogicControl.cs @@ -0,0 +1,191 @@ +using IoTClient.Clients.PLC; +using IoTClient.Common.Enums; +using Net461DllTest.Device; +using Net461DllTest.Enums; +using Net461DllTest.Signal; +using Net461DllTest.Web; +using Serein.Library.Api; +using Serein.Library.Attributes; +using Serein.Library.Enums; +using Serein.Library.Ex; +using Serein.Library.Framework.NodeFlow; +using Serein.Library.NodeFlow.Tool; +using Serein.Library.Utils; +using Serein.Library.Web; +using System; +using System.ComponentModel; +using System.Reflection; +using System.Threading.Tasks; + +namespace Net461DllTest.LogicControl +{ + [DynamicFlow] + public class PlcLogicControl + { + [AutoInjection] + public SiemensPlcDevice MyPlc { get; set; } + + + + + #region 初始化、初始化完成以及退出的事件 + [NodeAction(NodeType.Init)] // Init : 初始化事件,流程启动时执行 + public void Init(IDynamicContext context) + { + context.Env.IOC.Register(); // 注册Plc设备 + context.Env.IOC.Register(); // 注册Web服务 + // // 注册控制器 + context.Env.IOC.Run(router => { + router.RegisterController(typeof(ApiController)); + }); + } + + [NodeAction(NodeType.Loading)] // Loading 初始化完成已注入依赖项,可以开始逻辑上的操作 + public void Loading(IDynamicContext context) + { + context.Env.IOC.Run((web) => + { + web.Start("http://*:8089/"); // 开启 Web 服务 + }); + } + + [NodeAction(NodeType.Exit)] // 流程结束时自动执行 + public void Exit(IDynamicContext context) + { + MyPlc.ResetDevice(); + MyPlc.CancelAllTasks(); + } + + #endregion + + #region 触发器节点 + + [NodeAction(NodeType.Flipflop, "等待信号触发", ReturnType = typeof(int))] + public async Task WaitTask(OrderSignal order = OrderSignal.Command_1) + { + try + { + TriggerData triggerData = await MyPlc.CreateChannelWithTimeoutAsync(order, TimeSpan.FromMinutes(5), 0); + if (triggerData.Type == TriggerType.Overtime) + { + throw new FlipflopException("超时取消"); + } + //int.TryParse(triggerData.Value.ToString(),out int result); + return new FlipflopContext(FlipflopStateType.Succeed, triggerData.Value); + } + catch (FlipflopException) + { + throw; + } + catch (Exception) + { + return new FlipflopContext(FlipflopStateType.Error); + } + + } + + #endregion + + #region 动作节点 + + [NodeAction(NodeType.Action, "初始化")] + public SiemensPlcDevice PlcInit(SiemensVersion version = SiemensVersion.None, + string ip = "192.168.10.100", + int port = 102) + { + if (MyPlc.Client is null) + { + try + { + MyPlc.Init(version, ip, port); + Console.WriteLine($"西门子PLC初始化成功[{version},{ip}:{port}]"); + } + catch (Exception ex) + { + Console.WriteLine($"西门子PLC[{version},{ip}:{port}]初始化异常:{ex.Message}"); + } + } + else + { + Console.WriteLine( $"西门子PLC已经初始化[{version},{ip}:{port}]"); + } + return MyPlc; + } + + + [NodeAction(NodeType.Action, "设置PLC状态")] + public SiemensPlcDevice SetState(PlcState state = PlcState.PowerOff) + { + if(MyPlc.Client != null) + { + var oldState = MyPlc.State; + MyPlc.State = state; + Console.WriteLine($"PLC状态从[{oldState}]转为[{state}]"); + return MyPlc; + } + else + { + Console.WriteLine($"PLC尚未初始化"); + return MyPlc; + } + + } + + + [NodeAction(NodeType.Action, "PLC获取变量")] + public object ReadVar([BindConvertor(typeof(PlcVarEnum), typeof(PlcVarConvertor))] PlcVarInfo varInfo) + { + var result = MyPlc.Read(varInfo); + Console.WriteLine($"获取变量成功:({varInfo})\t result = {result}"); + return result; + } + + [NodeAction(NodeType.Action, "PLC写入变量")] + public SiemensPlcDevice WriteVar2(object value, [BindConvertor(typeof(PlcVarEnum), typeof(PlcVarConvertor))] PlcVarInfo varInfo) + { + + if (MyPlc.State == PlcState.Runing) + { + if (!varInfo.IsProtected) + { + MyPlc.Write(varInfo, value); + Console.WriteLine($"PLC变量{varInfo}写入数据:{value}"); + } + else + { + Console.WriteLine($"PLC变量{varInfo}当前禁止写入"); + } + } + else + { + Console.WriteLine($"PLC处于非预期状态{MyPlc.State}"); + } + return MyPlc; + } + + + /// + /// 转换器,用于将枚举转为自定义特性中的数据 + /// + public class PlcVarConvertor: IEnumConvertor + { + public PlcVarInfo Convertor(PlcVarEnum plcVarValue) + { + if (plcVarValue == PlcVarEnum.None) + { + throw new Exception("非预期枚举值"); + } + var plcValue = EnumHelper.GetBoundValue(plcVarValue, attr => attr.PlcInfo) + ?? throw new Exception($"获取变量异常:{plcVarValue},没有标记PlcValueAttribute"); + if (string.IsNullOrEmpty(plcValue.VarAddress)) + { + throw new Exception($"获取变量异常:{plcVarValue},变量地址为空"); + } + return plcValue; + } + + } + + #endregion + } +} diff --git a/Net461DllTest/Flow/ViewLogicControl.cs b/Net461DllTest/LogicControl/ViewLogicControl.cs similarity index 71% rename from Net461DllTest/Flow/ViewLogicControl.cs rename to Net461DllTest/LogicControl/ViewLogicControl.cs index 3bc4435..d65c122 100644 --- a/Net461DllTest/Flow/ViewLogicControl.cs +++ b/Net461DllTest/LogicControl/ViewLogicControl.cs @@ -1,6 +1,4 @@ -using Net461DllTest.Data; -using Net461DllTest.Device; -using Net461DllTest.View; +using Net461DllTest.Signal; using Net461DllTest.ViewModel; using Serein.Library.Api; using Serein.Library.Attributes; @@ -9,10 +7,9 @@ using Serein.Library.Utils; using System; using System.Collections.Generic; using System.Linq; -using System.Reflection; using System.Windows.Forms; -namespace Net461DllTest.Flow +namespace Net461DllTest.LogicControl { public class ViewManagement @@ -44,14 +41,7 @@ namespace Net461DllTest.Flow } - public enum FromId - { - None, - [BindValue(typeof(FromWorkBenchView))] - FromWorkBenchView, - [BindValue(typeof(TeseFormView))] - TeseFormView, - } + [DynamicFlow] public class ViewLogicControl @@ -68,9 +58,9 @@ namespace Net461DllTest.Flow [NodeAction(NodeType.Action, "打开窗体(指定枚举值)")] - public void OpenForm(IDynamicContext context, FromId fromId = FromId.None, bool isTop = true) + public void OpenForm(IDynamicContext context, FromValue fromId = FromValue.None, bool isTop = true) { - var fromType = EnumHelper.GetBoundValue(fromId, attr => attr.Value); + var fromType = EnumHelper.GetBoundValue(fromId, attr => attr.Value); if (fromType is null) return; if (context.Env.IOC.Instantiate(fromType) is Form form) { @@ -79,16 +69,17 @@ namespace Net461DllTest.Flow } [NodeAction(NodeType.Action, "打开窗体(使用转换器)")] - public void OpenForm2([EnumTypeConvertor(typeof(FromId))] Form form, bool isTop = true) + public void OpenForm2([EnumTypeConvertor(typeof(FromValue))] Form form, bool isTop = true) { ViewManagement.OpenView(form, isTop); } + [NodeAction(NodeType.Action, "关闭窗体")] - public void CloseForm(IDynamicContext context, FromId fromId = FromId.None) + public void CloseForm(IDynamicContext context, FromValue fromId = FromValue.None) { - var fromType = EnumHelper.GetBoundValue(fromId, attr => attr.Value); + var fromType = EnumHelper.GetBoundValue(fromId, attr => attr.Value); if (fromType is null) return; ViewManagement.CloseView(fromType); } @@ -96,5 +87,6 @@ namespace Net461DllTest.Flow + } } diff --git a/Net461DllTest/Net461DllTest.csproj b/Net461DllTest/Net461DllTest.csproj index 227a6e5..3676fab 100644 --- a/Net461DllTest/Net461DllTest.csproj +++ b/Net461DllTest/Net461DllTest.csproj @@ -39,9 +39,15 @@ + + ..\packages\IoTClient.1.0.40\lib\netstandard2.0\IoTClient.dll + + + ..\packages\System.IO.Ports.4.6.0\lib\net461\System.IO.Ports.dll + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll @@ -54,11 +60,17 @@ - - - - + + + + + + + + + + Form @@ -66,12 +78,11 @@ FromWorkBenchView.cs - - + Form - - TeseFormView.cs + + TestFormView.cs @@ -89,14 +100,15 @@ FromWorkBenchView.cs - - TeseFormView.cs + + TestFormView.cs + diff --git a/Net461DllTest/Signal/OrderSignal.cs b/Net461DllTest/Signal/OrderSignal.cs index 6ad3bf6..7eeb8a8 100644 --- a/Net461DllTest/Signal/OrderSignal.cs +++ b/Net461DllTest/Signal/OrderSignal.cs @@ -1,18 +1,15 @@ -using Serein.Library.Attributes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static Serein.Library.Attributes.PLCValueAttribute; - -namespace Net461DllTest.Signal +namespace Net461DllTest.Signal { public enum OrderSignal { - View_1, - View_2, Command_1, Command_2, + Command_3, + Command_4, + Command_5, + Command_6, + Command_7, + Command_8, + Command_9, } } diff --git a/Net461DllTest/Signal/PLCVarSignal.cs b/Net461DllTest/Signal/PLCVarSignal.cs new file mode 100644 index 0000000..9cb5a1c --- /dev/null +++ b/Net461DllTest/Signal/PLCVarSignal.cs @@ -0,0 +1,64 @@ +using Serein.Library.Attributes; +using System; +using static Net461DllTest.Signal.PlcValueAttribute; + +namespace Net461DllTest.Signal +{ + + [AttributeUsage(AttributeTargets.Field)] + public class PlcValueAttribute : Attribute + { + /// + /// 变量类型 + /// + public enum VarType + { + /// + /// 只读取的值 + /// + ReadOnly, + /// + /// 可写入的值 + /// + Writable, + } + + /// + /// 变量属性 + /// + public PlcVarInfo PlcInfo { get; } + + + public PlcValueAttribute(Type type, + string @var, + VarType varType + ) + { + PlcInfo = new PlcVarInfo(type, var, varType); + } + } + + public class PlcVarInfo + { + public PlcVarInfo(Type type, + string @var, + VarType varType + ) + { + DataType = type; + VarAddress = @var; + Type = varType; + } + public bool IsProtected { get; } + public Type DataType { get; } + public string VarAddress { get; } + public VarType Type { get; } + + public override string ToString() + { + return $"数据类型:{DataType} 地址:{VarAddress}"; + } + } + + +} diff --git a/Net461DllTest/Signal/Signal.cs b/Net461DllTest/Signal/Signal.cs deleted file mode 100644 index 4dd4c0b..0000000 --- a/Net461DllTest/Signal/Signal.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Net461DllTest.Flow; -using Serein.Library.Attributes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Net461DllTest.Signal -{ - - -} diff --git a/Net461DllTest/Utils/ToValue.cs b/Net461DllTest/Utils/ToValue.cs new file mode 100644 index 0000000..db045ff --- /dev/null +++ b/Net461DllTest/Utils/ToValue.cs @@ -0,0 +1,231 @@ +using IoTClient; +using IoTClient.Clients.PLC; +using IoTClient.Enums; +using Net461DllTest.Signal; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace Net461DllTest.Utils +{ + internal static class MyPlcExtension + { + public static DataTypeEnum ToDataTypeEnum(this PlcVarInfo varInfo) + { + Type dataType = varInfo.DataType; + DataTypeEnum plcDataType; + switch (dataType) + { + case Type _ when dataType == typeof(string): + plcDataType = DataTypeEnum.String; + break; + case Type _ when dataType == typeof(char): + plcDataType = DataTypeEnum.String; + break; + case Type _ when dataType == typeof(bool): + plcDataType = DataTypeEnum.Bool; + break; + case Type _ when dataType == typeof(float): + plcDataType = DataTypeEnum.Float; + break; + case Type _ when dataType == typeof(double): + plcDataType = DataTypeEnum.Double; + break; + case Type _ when dataType == typeof(byte): + plcDataType = DataTypeEnum.Byte; + break; + case Type _ when dataType == typeof(short): + plcDataType = DataTypeEnum.Int16; + break; + case Type _ when dataType == typeof(ushort): + plcDataType = DataTypeEnum.UInt16; + break; + case Type _ when dataType == typeof(int): + plcDataType = DataTypeEnum.Int32; + break; + case Type _ when dataType == typeof(uint): + plcDataType = DataTypeEnum.UInt32; + break; + case Type _ when dataType == typeof(long): + plcDataType = DataTypeEnum.Int64; + break; + case Type _ when dataType == typeof(ulong): + plcDataType = DataTypeEnum.UInt64; + break; + default: + plcDataType = DataTypeEnum.None; + break; + } + + + return plcDataType; + } + + /// + /// 读取设备的值 + /// + /// + /// + /// + /// + public static object ReadToPlcValue(this SiemensClient client,PlcVarInfo varInfo) + { + Type dataType = varInfo.DataType; + object resultvalue; + if (dataType == typeof(string)) + { + var result = client.ReadString(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(char)) + { + var result = client.ReadString(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(bool)) + { + var result = client.ReadBoolean(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(float)) + { + var result = client.ReadFloat(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(double)) + { + var result = client.ReadDouble(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(byte)) + { + var result = client.ReadByte(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(short)) + { + var result = client.ReadInt16(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(ushort)) + { + var result = client.ReadUInt16(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(int)) + { + var result = client.ReadInt32(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(uint)) + { + var result = client.ReadUInt32(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(long)) + { + var result = client.ReadInt64(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else if (dataType == typeof(ulong)) + { + var result = client.ReadUInt64(varInfo.VarAddress); + if (!result.IsSucceed) throw new Exception(result.Err); + resultvalue = result.Value; + } + else + { + resultvalue = default; + } + return resultvalue; + } + + public static void WriteToPlcValue(this SiemensClient client, PlcVarInfo varInfo ,object value) + { + if(client == null) throw new ArgumentNullException("client"); + Type dataType = varInfo.DataType; + Result result = null; + if (dataType == typeof(string)) + { + result = client.Write(varInfo.VarAddress, value.ToString()); + } + else if (dataType == typeof(char)) + { + result = client.Write(varInfo.VarAddress, value.ToString()); + } + else if (dataType == typeof(bool)) + { + var @bool = bool.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @bool); + } + else if (dataType == typeof(float)) + { + var @float = float.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @float); + } + else if (dataType == typeof(double)) + { + var @double = double.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @double); + } + else if (dataType == typeof(byte)) + { + var @byte = byte.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @byte); + } + else if (dataType == typeof(short)) + { + var @short = short.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @short); + } + else if (dataType == typeof(ushort)) + { + var @ushort = ushort.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @ushort); + } + else if (dataType == typeof(int)) + { + var @int = int.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @int); + } + else if (dataType == typeof(uint)) + { + var @uint = uint.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @uint); + } + else if (dataType == typeof(long)) + { + var @long = long.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @long); + } + else if (dataType == typeof(ulong)) + { + var @ulong = ulong.Parse(value.ToString()); + result = client.Write(varInfo.VarAddress, @ulong); + } + if (result is null) + { + throw new Exception($"未定义的数据类型"); + } + if(!result.IsSucceed) + { + throw new Exception(result.Err); + } + } + + } +} diff --git a/Net461DllTest/View/FromWorkBenchView.Designer.cs b/Net461DllTest/View/FromWorkBenchView.Designer.cs index 2d14bf7..caffe5e 100644 --- a/Net461DllTest/View/FromWorkBenchView.Designer.cs +++ b/Net461DllTest/View/FromWorkBenchView.Designer.cs @@ -29,33 +29,35 @@ private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); - this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBoxPlcInfo = new System.Windows.Forms.TextBox(); this.button2 = new System.Windows.Forms.Button(); this.listBox1 = new System.Windows.Forms.ListBox(); + this.textBoxSpaceNum = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // button1 // - this.button1.Location = new System.Drawing.Point(187, 22); + this.button1.Location = new System.Drawing.Point(220, 56); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(98, 23); + this.button1.Size = new System.Drawing.Size(65, 23); this.button1.TabIndex = 0; this.button1.Text = "查看状态"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // - // textBox1 + // textBoxPlcInfo // - this.textBox1.Location = new System.Drawing.Point(35, 24); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(137, 21); - this.textBox1.TabIndex = 1; + this.textBoxPlcInfo.Location = new System.Drawing.Point(35, 24); + this.textBoxPlcInfo.Name = "textBoxPlcInfo"; + this.textBoxPlcInfo.ReadOnly = true; + this.textBoxPlcInfo.Size = new System.Drawing.Size(250, 21); + this.textBoxPlcInfo.TabIndex = 1; // // button2 // - this.button2.Location = new System.Drawing.Point(178, 179); + this.button2.Location = new System.Drawing.Point(205, 181); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(107, 23); + this.button2.Size = new System.Drawing.Size(80, 23); this.button2.TabIndex = 2; this.button2.Text = "触发"; this.button2.UseVisualStyleBackColor = true; @@ -70,14 +72,23 @@ this.listBox1.Size = new System.Drawing.Size(250, 88); this.listBox1.TabIndex = 6; // + // textBoxSpaceNum + // + this.textBoxSpaceNum.Location = new System.Drawing.Point(35, 183); + this.textBoxSpaceNum.Name = "textBoxSpaceNum"; + this.textBoxSpaceNum.Size = new System.Drawing.Size(106, 21); + this.textBoxSpaceNum.TabIndex = 7; + this.textBoxSpaceNum.Text = "104"; + // // FromWorkBenchView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(341, 251); + this.Controls.Add(this.textBoxSpaceNum); this.Controls.Add(this.listBox1); this.Controls.Add(this.button2); - this.Controls.Add(this.textBox1); + this.Controls.Add(this.textBoxPlcInfo); this.Controls.Add(this.button1); this.Name = "FromWorkBenchView"; this.Text = "Form1"; @@ -89,8 +100,9 @@ #endregion private System.Windows.Forms.Button button1; - private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox textBoxPlcInfo; private System.Windows.Forms.Button button2; private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.TextBox textBoxSpaceNum; } } \ No newline at end of file diff --git a/Net461DllTest/View/FromWorkBenchView.cs b/Net461DllTest/View/FromWorkBenchView.cs index 92f204b..4719625 100644 --- a/Net461DllTest/View/FromWorkBenchView.cs +++ b/Net461DllTest/View/FromWorkBenchView.cs @@ -31,17 +31,21 @@ namespace Net461DllTest private void button1_Click(object sender, EventArgs e) { - textBox1.Text = ViewModel.GetDeviceInfo(); + textBoxPlcInfo.Text = ViewModel.GetDeviceInfo(); } private void button2_Click(object sender, EventArgs e) { + if(listBox1.SelectedItem is null) + { + return; + } string type = listBox1.SelectedItem.ToString(); - if (Enum.TryParse(type, out OrderSignal signal) && Enum.IsDefined(typeof(OrderSignal), signal)) + if (!string.IsNullOrEmpty(type) && Enum.TryParse(type, out OrderSignal signal) && Enum.IsDefined(typeof(OrderSignal), signal)) { Console.WriteLine($"Trigger : {type}"); - ViewModel.Trigger(signal); + ViewModel.Trigger(signal,textBoxSpaceNum.Text); } } diff --git a/Net461DllTest/View/TeseFormView.cs b/Net461DllTest/View/TeseFormView.cs deleted file mode 100644 index 7bf4128..0000000 --- a/Net461DllTest/View/TeseFormView.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Net461DllTest.Data; -using Net461DllTest.Signal; -using Serein.Library.Attributes; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; - -namespace Net461DllTest.View -{ - public partial class TeseFormView : Form - { - [AutoInjection] - public MyData MyData { get; set; } - - public TeseFormView() - { - InitializeComponent(); - - } - - private void button1_Click(object sender, EventArgs e) - { - MyData.Count = 0; - } - } -} diff --git a/Net461DllTest/View/TeseFormView.Designer.cs b/Net461DllTest/View/TestFormView.Designer.cs similarity index 90% rename from Net461DllTest/View/TeseFormView.Designer.cs rename to Net461DllTest/View/TestFormView.Designer.cs index 9c580dd..41ea4a4 100644 --- a/Net461DllTest/View/TeseFormView.Designer.cs +++ b/Net461DllTest/View/TestFormView.Designer.cs @@ -1,6 +1,8 @@ -namespace Net461DllTest.View +using System; + +namespace Net461DllTest.View { - partial class TeseFormView + partial class TestFormView { /// /// Required designer variable. @@ -37,17 +39,17 @@ this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 0; - this.button1.Text = "清空"; + this.button1.Text = "测试"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // - // TeseFormView + // TestFormView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(254, 118); this.Controls.Add(this.button1); - this.Name = "TeseFormView"; + this.Name = "TestFormView"; this.Text = "TeseForm"; this.ResumeLayout(false); diff --git a/Net461DllTest/View/TestFormView.cs b/Net461DllTest/View/TestFormView.cs new file mode 100644 index 0000000..b747544 --- /dev/null +++ b/Net461DllTest/View/TestFormView.cs @@ -0,0 +1,19 @@ +using System; +using System.Windows.Forms; + +namespace Net461DllTest.View +{ + public partial class TestFormView : Form + { + + public TestFormView() + { + InitializeComponent(); + + } + + private void button1_Click(object sender, EventArgs e) + { + } + } +} diff --git a/Net461DllTest/View/TeseFormView.resx b/Net461DllTest/View/TestFormView.resx similarity index 100% rename from Net461DllTest/View/TeseFormView.resx rename to Net461DllTest/View/TestFormView.resx diff --git a/Net461DllTest/ViewModel/FromWorkBenchViewModel.cs b/Net461DllTest/ViewModel/FromWorkBenchViewModel.cs index 337ea80..31c1652 100644 --- a/Net461DllTest/ViewModel/FromWorkBenchViewModel.cs +++ b/Net461DllTest/ViewModel/FromWorkBenchViewModel.cs @@ -12,22 +12,21 @@ namespace Net461DllTest.ViewModel public class FromWorkBenchViewModel { [AutoInjection] - public PlcDevice Device { get; set; } + public SiemensPlcDevice Device { get; set; } public string Name { get; set; } public string GetDeviceInfo() { - if(Device is null) - { - return string.Empty; - } - return "PLC ID:" + Device.PlcId + " - " + Device.MyData.Count.ToString(); + return Device?.ToString(); } - public void Trigger(OrderSignal signal) + public void Trigger(OrderSignal signal,string spcaeNumber) { - Device.TriggerSignal(signal, 0); + _ = Task.Run(() => + { + Device.TriggerSignal(signal, spcaeNumber); + }); } diff --git a/Net461DllTest/Web/ApiController.cs b/Net461DllTest/Web/ApiController.cs index bf92417..658af8c 100644 --- a/Net461DllTest/Web/ApiController.cs +++ b/Net461DllTest/Web/ApiController.cs @@ -14,7 +14,7 @@ namespace Net461DllTest.Web public class ApiController : ControllerBase { [AutoInjection] - public PlcDevice PlcDevice { get; set; } + public SiemensPlcDevice PlcDevice { get; set; } [WebApi(API.POST)] public dynamic Trigger([Url] string type, int value) diff --git a/Net461DllTest/app.config b/Net461DllTest/app.config new file mode 100644 index 0000000..dd1ad41 --- /dev/null +++ b/Net461DllTest/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Net461DllTest/packages.config b/Net461DllTest/packages.config index 142ece2..cadbf4f 100644 --- a/Net461DllTest/packages.config +++ b/Net461DllTest/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file diff --git a/NodeFlow/Base/NodeModelBaseFunc.cs b/NodeFlow/Base/NodeModelBaseFunc.cs index 4335ad6..db835e7 100644 --- a/NodeFlow/Base/NodeModelBaseFunc.cs +++ b/NodeFlow/Base/NodeModelBaseFunc.cs @@ -223,6 +223,7 @@ namespace Serein.NodeFlow.Base } catch (Exception ex) { + await Console.Out.WriteLineAsync(ex.ToString()); NextOrientation = ConnectionType.IsError; RuningException = ex; return null; @@ -292,7 +293,23 @@ namespace Serein.NodeFlow.Base inputParameter = flowData; // 使用上一节点的对象 } - + // 存在转换器 + if (ed.Convertor is not null) + { + if (Enum.TryParse(ed.ExplicitType, ed.DataValue, out var resultEnum)) + { + var value = ed.Convertor(resultEnum); + if (value is not null) + { + parameters[i] = value; + continue; + } + else + { + throw new InvalidOperationException("转换器调用失败"); + } + } + } //var attribute = ed.DataType.GetCustomAttribute(); //if (attribute is not null && attribute.EnumType.IsEnum) // 获取枚举转换器中记录的枚举 @@ -312,6 +329,8 @@ namespace Serein.NodeFlow.Base } } } + + try diff --git a/NodeFlow/FlowEnvironment.cs b/NodeFlow/FlowEnvironment.cs index 24b6215..a02dbf7 100644 --- a/NodeFlow/FlowEnvironment.cs +++ b/NodeFlow/FlowEnvironment.cs @@ -311,11 +311,11 @@ namespace Serein.NodeFlow foreach (var dll in dllPaths) { var dllFilePath = System.IO.Path.GetFullPath(System.IO.Path.Combine(filePath, dll)); - (var assembly, var list) = LoadAssembly(dllFilePath); - if (assembly is not null && list.Count > 0) + (var assembly, var registerTypes, var mdlist) = LoadAssembly(dllFilePath); + if (assembly is not null && mdlist.Count > 0) { - MethodDetailss.AddRange(list); // 暂存方法描述 - OnDllLoad?.Invoke(new LoadDLLEventArgs(assembly, list)); // 通知UI创建dll面板显示 + MethodDetailss.AddRange(mdlist); // 暂存方法描述 + OnDllLoad?.Invoke(new LoadDLLEventArgs(assembly, mdlist)); // 通知UI创建dll面板显示 } } // 方法加载完成,缓存到运行环境中。 @@ -435,6 +435,7 @@ namespace Serein.NodeFlow OnProjectLoaded?.Invoke(new ProjectLoadedEventArgs()); } + /// /// 保存项目为项目文件 /// @@ -457,17 +458,20 @@ namespace Serein.NodeFlow /// public void LoadDll(string dllPath) { - (var assembly, var list) = LoadAssembly(dllPath); + (var assembly, _, var list) = LoadAssembly(dllPath); if (assembly is not null && list.Count > 0) { MethodDetailss.AddRange(list); OnDllLoad?.Invoke(new LoadDLLEventArgs(assembly, list)); } } + /// /// 运行时创建节点 /// - /// + /// + /// + /// public void CreateNode(NodeControlType nodeControlType, Position position, MethodDetails? methodDetails = null) { var nodeModel = CreateNode(nodeControlType, methodDetails); @@ -477,8 +481,7 @@ namespace Serein.NodeFlow && nodeControlType == NodeControlType.Flipflop && nodeModel is SingleFlipflopNode flipflopNode) { - // 当前添加节点属于触发器,且当前正在运行,则加载到运行环境中 - flowStarter?.AddFlipflopInRuning(flipflopNode, this); + _ = flowStarter?.RunGlobalFlipflopAsync(this, flipflopNode); // 当前添加节点属于触发器,且当前正在运行,则加载到运行环境中 } // 通知UI更改 @@ -504,6 +507,11 @@ namespace Serein.NodeFlow { return; } + if (remoteNode is SingleFlipflopNode flipflopNode) + { + flowStarter?.TerminateGlobalFlipflopRuning(flipflopNode); // 假设被移除的是全局触发器,尝试从启动器移除 + } + // 遍历所有父节点,从那些父节点中的子节点集合移除该节点 foreach (var pnc in remoteNode.PreviousNodes) @@ -512,7 +520,6 @@ namespace Serein.NodeFlow for (int i = 0; i < pnc.Value.Count; i++) { NodeModelBase? pNode = pnc.Value[i]; - //pNode.SuccessorNodes[pCType].RemoveAt(i); pNode.SuccessorNodes[pCType].Remove(pNode); OnNodeConnectChange?.Invoke(new NodeConnectChangeEventArgs(pNode.Guid, @@ -588,13 +595,13 @@ namespace Serein.NodeFlow { fromNode.SuccessorNodes[connectionType].Remove(toNode); toNode.PreviousNodes[connectionType].Remove(fromNode); - if (toNode is SingleFlipflopNode flipflopNode) + + if (toNode is SingleFlipflopNode flipflopNode) // 子节点为触发器 { - if (flowStarter?.FlowState != RunState.Completion - && flipflopNode.NotExitPreviousNode()) + if (flowStarter?.FlowState != RunState.Completion + && flipflopNode.NotExitPreviousNode()) // 正在运行,且该触发器没有上游节点 { - // 被父节点移除连接关系的子节点若为触发器,且无上级节点,则当前流程正在运行,则加载到运行环境中 - flowStarter?.AddFlipflopInRuning(flipflopNode, this); + flowStarter?.RunGlobalFlipflopAsync(this, flipflopNode); // 被父节点移除连接关系的子节点若为触发器,且无上级节点,则当前流程正在运行,则加载到运行环境中 } } @@ -844,17 +851,19 @@ namespace Serein.NodeFlow /// 加载指定路径的DLL文件 /// /// - private (Assembly?, List) LoadAssembly(string dllPath) + private (Assembly?, List ,List) LoadAssembly(string dllPath) { try { Assembly assembly = Assembly.LoadFrom(dllPath); // 加载DLL文件 Type[] types = assembly.GetTypes(); // 获取程序集中的所有类型 + List autoRegisterTypes = assembly.GetTypes().Where(t => t.GetCustomAttribute() is not null).ToList(); + List scanTypes = assembly.GetTypes().Where(t => t.GetCustomAttribute()?.Scan == true).ToList(); if (scanTypes.Count == 0) { - return (null, []); + return (null, [], []); } List methodDetails = new List(); @@ -874,14 +883,15 @@ namespace Serein.NodeFlow } LoadedAssemblies.Add(assembly); // 将加载的程序集添加到列表中 LoadedAssemblyPaths.Add(dllPath); // 记录加载的DLL路径 - return (assembly, methodDetails); + return (assembly, autoRegisterTypes , methodDetails); } catch (Exception ex) { Console.WriteLine(ex.ToString()); - return (null, []); + return (null, [],[]); } } + /// /// 运行环节加载了项目文件,需要创建节点控件 /// @@ -985,6 +995,11 @@ namespace Serein.NodeFlow ConnectionType.IsFail, ConnectionType.IsError, ConnectionType.Upstream]; + + if (toNode is SingleFlipflopNode flipflopNode) + { + flowStarter?.TerminateGlobalFlipflopRuning(flipflopNode); // 假设被连接的是全局触发器,尝试移除 + } foreach (ConnectionType ctType in ct) { var FToTo = fromNode.SuccessorNodes[ctType].Where(it => it.Guid.Equals(toNode.Guid)).ToArray(); diff --git a/NodeFlow/FlowStarter.cs b/NodeFlow/FlowStarter.cs index e3c3ed9..d6721b6 100644 --- a/NodeFlow/FlowStarter.cs +++ b/NodeFlow/FlowStarter.cs @@ -6,6 +6,7 @@ using Serein.Library.Utils; using Serein.Library.Web; using Serein.NodeFlow.Base; using Serein.NodeFlow.Model; +using System.Collections.Concurrent; using System.ComponentModel.Design; using System.Runtime.CompilerServices; using System.Xml.Linq; @@ -238,6 +239,8 @@ namespace Serein.NodeFlow ((Action)md.MethodDelegate).Invoke(md.ActingInstance, [Context]); } + TerminateAllGlobalFlipflop(); + if (_flipFlopCts != null && !_flipFlopCts.IsCancellationRequested) { _flipFlopCts?.Cancel(); @@ -245,6 +248,7 @@ namespace Serein.NodeFlow } FlowState = RunState.Completion; FlipFlopState = RunState.Completion; + }; #endregion @@ -263,7 +267,7 @@ namespace Serein.NodeFlow // 使用 TaskCompletionSource 创建未启动的触发器任务 var tasks = flipflopNodes.Select(async node => { - await FlipflopExecute(env,node); + await RunGlobalFlipflopAsync(env,node); }).ToArray(); _ = Task.WhenAll(tasks); } @@ -288,31 +292,68 @@ namespace Serein.NodeFlow #endregion } - public void AddFlipflopInRuning(SingleFlipflopNode singleFlipFlopNode, IFlowEnvironment env) + private ConcurrentDictionary dictGlobalFlipflop = []; + + /// + /// 尝试添加全局触发器 + /// + /// + /// + public async Task RunGlobalFlipflopAsync(IFlowEnvironment env, SingleFlipflopNode singleFlipFlopNode) { - _ = Task.Run(async () => + if (dictGlobalFlipflop.TryAdd(singleFlipFlopNode, new CancellationTokenSource())) { - // 设置对象 - singleFlipFlopNode.MethodDetails.ActingInstance = env.IOC.GetOrRegisterInstantiate(singleFlipFlopNode.MethodDetails.ActingInstanceType); - await FlipflopExecute(env,singleFlipFlopNode); // 启动触发器 - }); + singleFlipFlopNode.MethodDetails.ActingInstance ??= env.IOC.GetOrRegisterInstantiate(singleFlipFlopNode.MethodDetails.ActingInstanceType); + await FlipflopExecuteAsync(env, singleFlipFlopNode, dictGlobalFlipflop[singleFlipFlopNode]); + } } + /// + /// 尝试移除全局触发器 + /// + /// + public void TerminateGlobalFlipflopRuning(SingleFlipflopNode singleFlipFlopNode) + { + if (dictGlobalFlipflop.TryRemove(singleFlipFlopNode, out var cts)) + { + if (!cts.IsCancellationRequested) + { + cts.Cancel(); + } + cts.Dispose(); + } + } + + /// + /// 总结所有全局触发器 + /// + private void TerminateAllGlobalFlipflop() + { + foreach ((var node, var cts) in dictGlobalFlipflop) + { + if (!cts.IsCancellationRequested) + { + cts.Cancel(); + } + cts.Dispose(); + } + dictGlobalFlipflop.Clear(); + } /// /// 启动全局触发器 /// /// 流程运行全局环境 /// 需要全局监听信号的触发器 /// - private async Task FlipflopExecute(IFlowEnvironment env,SingleFlipflopNode singleFlipFlopNode) + private async Task FlipflopExecuteAsync(IFlowEnvironment env, SingleFlipflopNode singleFlipFlopNode, CancellationTokenSource cts) { - var context = new DynamicContext(env); // 启动全局触发器时新建上下文 - while (!_flipFlopCts.IsCancellationRequested) + while (!_flipFlopCts.IsCancellationRequested && !cts.IsCancellationRequested) { try { - var newFlowData = await singleFlipFlopNode.ExecutingAsync(context); // 获取触发器等待Task + var waitTask = singleFlipFlopNode.ExecutingAsync(context); // 获取触发器等待Task + var newFlowData = await waitTask; await NodeModelBase.RefreshFlowDataAndExpInterrupt(context, singleFlipFlopNode, newFlowData); // 全局触发器触发后刷新该触发器的节点数据 if (singleFlipFlopNode.NextOrientation != ConnectionType.None) { @@ -339,32 +380,6 @@ namespace Serein.NodeFlow } } - //MethodDetails md = singleFlipFlopNode.MethodDetails; - //var del = md.MethodDelegate; - //object?[]? parameters = singleFlipFlopNode.GetParameters(context, singleFlipFlopNode.MethodDetails); // 启动全局触发器时获取入参参数 - //// 设置委托对象 - //var func = md.ExplicitDatas.Length == 0 ? - // (Func>)del : - // (Func>)del; - - //if(t) - //{ - // IFlipflopContext flipflopContext = await ((Func>)del.Clone()).Invoke(md.ActingInstance);// 开始等待全局触发器的触发 - // var connectionType = flipflopContext.State.ToContentType(); - // if (connectionType != ConnectionType.None) - // { - // await GlobalFlipflopExecute(context, singleFlipFlopNode, connectionType, cts); - // } - //} - //else - //{ - // IFlipflopContext flipflopContext = await ((Func>)del.Clone()).Invoke(md.ActingInstance, parameters);// 开始等待全局触发器的触发 - // var connectionType = flipflopContext.State.ToContentType(); - // if (connectionType != ConnectionType.None) - // { - // await GlobalFlipflopExecute(context, singleFlipFlopNode, connectionType, cts); - // } - //} } diff --git a/NodeFlow/Model/SingleFlipflopNode.cs b/NodeFlow/Model/SingleFlipflopNode.cs index dc2a4b2..3161a1b 100644 --- a/NodeFlow/Model/SingleFlipflopNode.cs +++ b/NodeFlow/Model/SingleFlipflopNode.cs @@ -19,6 +19,7 @@ namespace Serein.NodeFlow.Model //} + public override async Task ExecutingAsync(IDynamicContext context) { #region 执行前中断 @@ -26,11 +27,6 @@ namespace Serein.NodeFlow.Model { string guid = this.Guid.ToString(); var cancelType = await this.DebugSetting.GetInterruptTask(); - //if (cancelType == CancelType.Discard) - //{ - // this.NextOrientation = ConnectionType.None; - // return null; - //} await Console.Out.WriteLineAsync($"[{this.MethodDetails.MethodName}]中断已{cancelType},开始执行后继分支"); } #endregion @@ -42,11 +38,21 @@ namespace Serein.NodeFlow.Model try { // 调用委托并获取结果 - Task flipflopTask = md.ExplicitDatas.Length switch + //Task flipflopTask = md.ExplicitDatas.Length switch + //{ + // 0 => ((Func>)del).Invoke(md.ActingInstance), + // _ => ((Func>)del).Invoke(md.ActingInstance, GetParameters(context, this, md)), // 执行流程中的触发器方法时获取入参参数 + //}; + Task flipflopTask; + if (md.ExplicitDatas.Length == 0) { - 0 => ((Func>)del).Invoke(md.ActingInstance), - _ => ((Func>)del).Invoke(md.ActingInstance, GetParameters(context, this, md)), // 执行流程中的触发器方法时获取入参参数 - }; + flipflopTask = ((Func>)del).Invoke(md.ActingInstance); + } + else + { + var parameters = GetParameters(context, this, md); + flipflopTask = ((Func>)del).Invoke(md.ActingInstance, parameters); + } IFlipflopContext flipflopContext = (await flipflopTask) ?? throw new FlipflopException("没有返回上下文"); NextOrientation = flipflopContext.State.ToContentType(); @@ -58,12 +64,14 @@ namespace Serein.NodeFlow.Model } catch (FlipflopException ex) { + await Console.Out.WriteLineAsync(ex.ToString()); NextOrientation = ConnectionType.None; RuningException = ex; return null; } catch (Exception ex) { + await Console.Out.WriteLineAsync(ex.ToString()); NextOrientation = ConnectionType.IsError; RuningException = ex; return null; diff --git a/NodeFlow/Tool/MethodDetailsHelper.cs b/NodeFlow/Tool/MethodDetailsHelper.cs index f304788..d5cb962 100644 --- a/NodeFlow/Tool/MethodDetailsHelper.cs +++ b/NodeFlow/Tool/MethodDetailsHelper.cs @@ -4,6 +4,7 @@ using Serein.Library.Core.NodeFlow; using Serein.Library.Entity; using System; using System.Collections.Concurrent; +using System.ComponentModel; using System.Reflection; namespace Serein.NodeFlow.Tool; @@ -89,6 +90,9 @@ public static class MethodDetailsHelperTmp } + + private static ConcurrentDictionary ConvertorInstance =[]; + /// /// 获取参数信息 /// @@ -100,36 +104,90 @@ public static class MethodDetailsHelperTmp return parameters.Select((it, index) => { Type paremType; - var attribute = it.GetCustomAttribute(); - if (attribute is not null) + + if (it.GetCustomAttribute() is EnumTypeConvertorAttribute attribute1 && attribute1 is not null) { - // 存在选择器 - paremType = attribute.EnumType; + // 存在类型选择器 + paremType = attribute1.EnumType; + return GetExplicitDataOfParameter(it, index, paremType, true); + } + else if (it.GetCustomAttribute() is BindConvertorAttribute attribute2 && attribute2 is not null) + { + paremType = attribute2.EnumType; + + string key = typeof(IEnumConvertor<,>).FullName + attribute2.EnumType.FullName + attribute2.ConvertorType.FullName; + + if (!ConvertorInstance.ContainsKey(key)) + { + Type enumConvertorType = typeof(IEnumConvertor<,>); + // 定义具体类型 + Type specificType = enumConvertorType.MakeGenericType(attribute2.EnumType, it.ParameterType); + // 获取实现类的类型 + Type implementorType = attribute2.ConvertorType; + // 创建实现类的实例 + object instance = Activator.CreateInstance(implementorType); + // 调用 Convert 方法 + MethodInfo convertMethod = implementorType.GetMethod("Convertor"); + ConvertorInstance[key] = (instance, convertMethod); + } + + Func func = (enumValue) => + { + (var obj,var methodInfo) = ConvertorInstance[key]; + return methodInfo?.Invoke(obj, [enumValue]); + }; + // 确保实例实现了所需接口 + ExplicitData ed = GetExplicitDataOfParameter(it, index, paremType, true, func); + + return ed; } else { - paremType = it.ParameterType; + return GetExplicitDataOfParameter(it, index, it.ParameterType, it.HasDefaultValue); } - string explicitTypeName = GetExplicitTypeName(paremType); - var items = GetExplicitItems(paremType, explicitTypeName); - if ("Bool".Equals(explicitTypeName)) explicitTypeName = "Select"; // 布尔值 转为 可选类型 - return new ExplicitData - { - IsExplicitData = attribute is null ? it.HasDefaultValue: true, - Index = index, - ExplicitTypeName = explicitTypeName, - ExplicitType = paremType, - DataType = it.ParameterType, - ParameterName = it.Name, - DataValue = it.HasDefaultValue ? it.DefaultValue.ToString() : "", - Items = items.ToArray(), - }; - - - + //string explicitTypeName = GetExplicitTypeName(paremType); + //var items = GetExplicitItems(paremType, explicitTypeName); + //if ("Bool".Equals(explicitTypeName)) explicitTypeName = "Select"; // 布尔值 转为 可选类型 + //return new ExplicitData + //{ + // IsExplicitData = attribute is null ? it.HasDefaultValue: true, + // Index = index, + // ExplicitTypeName = explicitTypeName, + // ExplicitType = paremType, + // DataType = it.ParameterType, + // ParameterName = it.Name, + // DataValue = it.HasDefaultValue ? it?.DefaultValue?.ToString() : "", + // Items = items.ToArray(), + //}; }).ToArray(); } + private static ExplicitData GetExplicitDataOfParameter(ParameterInfo parameterInfo, + int index, + Type paremType, + bool isExplicitData, + Func func = null) + { + + string explicitTypeName = GetExplicitTypeName(paremType); + var items = GetExplicitItems(paremType, explicitTypeName); + if ("Bool".Equals(explicitTypeName)) explicitTypeName = "Select"; // 布尔值 转为 可选类型 + return new ExplicitData + { + IsExplicitData = isExplicitData, //attribute is null ? parameterInfo.HasDefaultValue : true, + Index = index, + ExplicitTypeName = explicitTypeName, + ExplicitType = paremType, + Convertor = func, + DataType = parameterInfo.ParameterType, + ParameterName = parameterInfo.Name, + DataValue = parameterInfo.HasDefaultValue ? parameterInfo?.DefaultValue?.ToString() : "", + Items = items.ToArray(), + }; + } + + + /// /// 判断使用输入器还是选择器 /// diff --git a/WorkBench/MainWindow.xaml.cs b/WorkBench/MainWindow.xaml.cs index bfd0d44..c41dbfd 100644 --- a/WorkBench/MainWindow.xaml.cs +++ b/WorkBench/MainWindow.xaml.cs @@ -213,7 +213,7 @@ namespace Serein.WorkBench private LogWindow InitConsoleOut() { var logWindow = new LogWindow(); - logWindow.Show(); + //logWindow.Show(); // 重定向 Console 输出 var logTextWriter = new LogTextWriter(msg => logWindow.AppendText(msg), () => logWindow.Clear()); ; Console.SetOut(logTextWriter); diff --git a/packages/IoTClient.1.0.40/.signature.p7s b/packages/IoTClient.1.0.40/.signature.p7s new file mode 100644 index 0000000..e87f6b8 Binary files /dev/null and b/packages/IoTClient.1.0.40/.signature.p7s differ diff --git a/packages/IoTClient.1.0.40/IoTClient.1.0.40.nupkg b/packages/IoTClient.1.0.40/IoTClient.1.0.40.nupkg new file mode 100644 index 0000000..6db375b Binary files /dev/null and b/packages/IoTClient.1.0.40/IoTClient.1.0.40.nupkg differ diff --git a/packages/IoTClient.1.0.40/lib/netstandard2.0/IoTClient.xml b/packages/IoTClient.1.0.40/lib/netstandard2.0/IoTClient.xml new file mode 100644 index 0000000..8c9ec10 --- /dev/null +++ b/packages/IoTClient.1.0.40/lib/netstandard2.0/IoTClient.xml @@ -0,0 +1,4113 @@ + + + + IoTClient + + + + + 是否是连接的 + + + + + 警告日志委托 + + + + + 构造函数 + + COM端口名称 + 波特率 + 数据位 + 停止位 + 奇偶校验 + 超时时间(毫秒) + 大小端设置 + PLC地址 + + + + 发送报文,并获取响应报文 + + + + + + + 读取数据 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + + + + + 读取Int16 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + 读取UInt16 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + 读取Int32 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt32 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Int64 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt64 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Float + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Double + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取线圈 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取离散 + + + + + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 分批读取(批量读取,内部进行批量计算读取) + + + + + + + 分批读取 + + + 如果读取异常,重试次数 + + + + + 线圈写入 + + + + + + + + + 写入 + + + + + + + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 获取读取命令 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + + + + + 获取写入命令 + + 寄存器地址 + + 站号 + 功能码 + + + + + 获取线圈写入命令 + + 寄存器地址 + + 站号 + 功能码 + + + + + + + + + + 警告日志委托 + 为了可用性,会对异常网络进行重试。此类日志通过委托接口给出去。 + + + + + 是否是连接的 + + + + + 打开连接 + + + + + + 关闭连接 + + + + + + 发送报文,并获取响应报文 + + + + + + + 读取数据 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + 设置构造函数中的大小端 + + + + + 读取Int16 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取UInt16 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + 读取Int32 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取UInt32 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取Int64 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取UInt64 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取Float + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取Double + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取线圈 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 读取离散 + + + + + + + + + 从批量读取的数据字节提取对应的地址数据 + + + + + + + + + 分批读取(批量读取,内部进行批量计算读取) + + + 如果读取异常,重试次数 + + + + + 线圈写入 + + + + + + + + + 写入 + + + + + + + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + ModbusAscii + + + + + 构造函数 + + COM端口名称 + 波特率 + 数据位 + 停止位 + 奇偶校验 + 超时时间(毫秒) + 大小端设置 + PLC地址 + + + + 读取数据 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + + + + + 线圈写入 + + + + + + + + + 写入 + + + + + + + + + + ModbusRtu协议客户端 + + + + + 构造函数 + + COM端口名称 + 波特率 + 数据位 + 停止位 + 奇偶校验 + 超时时间(毫秒) + 大小端设置 + PLC地址 + + + + 读取数据 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + + + + + + 线圈写入 + + + + + + + + + 写入 + + + + + + + + + + Tcp的方式发送ModbusRtu协议报文 - 客户端 + + + + + 是否是连接的 + + + + + 构造函数 + + ip地址 + 端口 + 超时时间(毫秒) + 大小端设置 + PLC地址 + + + + 构造函数 + + ip地址和端口 + 超时时间(毫秒) + 大小端设置 + + + + 发送报文,并获取响应报文 + + + + + + + + 读取数据 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + + + + + + 读取Int16 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + 读取UInt16 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + 读取Int32 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt32 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Int64 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt64 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Float + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Double + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取线圈 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取离散 + + + + + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 分批读取(批量读取,内部进行批量计算读取) + + + + + + + 分批读取 + + + 如果读取异常,重试次数 + + + + + 线圈写入 + + + + + + + + + 写入 + + + + + + + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 获取读取命令 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + + + + + 获取写入命令 + + 寄存器地址 + + 站号 + 功能码 + + + + + 获取线圈写入命令 + + 寄存器地址 + + 站号 + 功能码 + + + + + ModbusTcp协议客户端 + + + + + 是否是连接的 + + + + + + + + 超时时间(毫秒) + 大小端设置 + PLC地址 + PLC地址 + + + + + + + + 超时时间(毫秒) + 大小端设置 + PLC地址 + + + + 连接 + + + + + + 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次) + + + + + + + 读取数据 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + 大小端转换 + + + + + 读取Int16类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + + 读取UInt16类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 按位的方式读取 + + 寄存器地址:如1.00 ... 1.14、1.15 + 站号 + 功能码 + 按位取值从左边开始取 + + + + + 读取UInt16类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Int32类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Int32类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt32类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt32类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Int64类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Int64类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt64类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取UInt64类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Float类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Float类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Double类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取Double类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取字符串 + + 地址 + 站号 + 功能码 + 编码 + 读取长度 + + + + + 读取线圈类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取线圈类型数据 + + 寄存器起始地址 + 站号 + 功能码 + + + + + 读取离散类型数据 + + 读取地址 + 站号 + 功能码 + + + + + 读取离散类型数据 + + 读取地址 + 站号 + 功能码 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 从批量读取的数据字节提取对应的地址数据 + + 批量读取的起始地址 + 读取地址 + 批量读取的值 + + + + + 分批读取(批量读取,内部进行批量计算读取) + + + + + + + 分批读取 + + + 如果读取异常,重试次数 + + + + + 线圈写入 + + 写入地址 + + 站号 + 功能码 + + + + 写入 + + 写入地址 + 写入字节数组 + 站号 + 功能码 + 大小端设置 + + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写入 + + 寄存器地址 + 写入的值 + 站号 + 功能码 + + + + 写字符串 + + 地址 + 字符串值 + 站号 + 功能码 + 编码 + + + + + 获取随机校验头 + + + + + + 获取读取命令 + + 寄存器起始地址 + 站号 + 功能码 + 读取长度 + + + + + 获取写入命令 + + 寄存器地址 + 批量读取的值 + 站号 + 功能码 + + + + + 获取线圈写入命令 + + 寄存器地址 + + 站号 + 功能码 + + + + + (AB)罗克韦尔客户端 Beta + https://blog.csdn.net/lishiming0308/article/details/85243041 + + + + + 连接地址 + + + + + 是否是连接的 + + + + + 超时时间 + + + + + 插槽 + + + + + 会话句柄(由AB PLC生成) + + + + + 注册命令 + + + + + 打开连接(如果已经是连接状态会先关闭再打开) + + + + + + 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次) + + + + + + + 读取Boolean + + 地址 + + + + + 读取byte + + + + + + + 读取Int16 + + + + + + + 读取UInt16 + + 地址 + + + + + 读取Int32 + + 地址 + + + + + 读取UInt32 + + 地址 + + + + + 读取Int64 + + 地址 + + + + + 读取UInt64 + + 地址 + + + + + 读取Float + + 地址 + + + + + 读取Double + + 地址 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + 数据类型 + + + + + 地址信息解析 + + + + + + + + 获取Read命令 + + + + + + + + + 获取Write命令 + + + + + + + + + + 后面内容长度 + + + + + + + 三菱plc客户端 + + + + + 版本 + + + + + 连接地址 + + + + + 是否是连接的 + + + + + 构造函数 + + 三菱型号版本 + ip地址 + 端口 + 超时时间 + + + + 打开连接(如果已经是连接状态会先关闭再打开) + + + + + + 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次) + + + + + + + 发送报文,并获取响应报文 + + + + + + + + 读取数据 + + 地址 + + + + + + + 读取Boolean + + 地址 + + + + + 读取Boolean + + + + + + + + 读取Int16 + + 地址 + + + + + 读取Int16 + + + + + + + + 读取UInt16 + + 地址 + + + + + 读取Int32 + + 地址 + + + + + 读取UInt32 + + 地址 + + + + + 读取Int64 + + 地址 + + + + + 读取UInt64 + + 地址 + + + + + 读取Float + + 地址 + + + + + 读取Double + + 地址 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + + + + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + 数据类型 + + + + + 获取Qna_3E读取命令 + + + + + + + + + + 获取A_1E读取命令 + + + + + + + + + + 获取Qna_3E写入命令 + + + + + + + + + + 获取A_1E写入命令 + + + + + + + + + + Qna_3E地址解析 + + + + + + + + A_1E地址解析 + + + + + + + + Omron解析后的地址信息 + + + + + 开始地址 + + + + + 类型的代号 + + + + + 位操作 + + + + + 字操作 + + + + + 位操作 解析地址 + + + + + 是否是bit + + + + + + + + + + 欧姆龙PLC 客户端 + https://flat2010.github.io/2020/02/23/Omron-Fins%E5%8D%8F%E8%AE%AE/ + + + + + 基础命令 + + + + + 版本 + + + + + 连接地址 + + + + + 是否是连接的 + + + + + DA2(即Destination unit address,目标单元地址) + 0x00:PC(CPU) + 0xFE: SYSMAC NET Link Unit or SYSMAC LINK Unit connected to network; + 0x10~0x1F:CPU总线单元 ,其值等于10 + 单元号(前端面板中配置的单元号) + + + + + SA1 客户端节点编号 + + + + + DA1 服务器节点编号 + + + + + + + + + + + + + + 打开连接(如果已经是连接状态会先关闭再打开) + + + + + + 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次) + + + + + + + 读取数据 + + 地址 + + + 返回值是否设置大小端 + + + + + 读取Boolean + + 地址 + + + + + 读取byte + + + + + + + 读取Int16 + + + + + + + 读取UInt16 + + 地址 + + + + + 读取Int32 + + 地址 + + + + + 读取UInt32 + + 地址 + + + + + 读取Int64 + + 地址 + + + + + 读取UInt64 + + 地址 + + + + + 读取Float + + 地址 + + + + + 读取Double + + 地址 + + + + + 写入数据 + + 地址 + 值 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + 数据类型 + + + + + 地址信息解析 + + + + + + + + + 获取Read命令 + + + + + + + + 获取Write命令 + + + + + + + + 批量读取 + + + 此参数设置无实际效果 + + + + + 西门子客户端 + http://www.360doc.cn/mip/763580999.html + + + + + CPU版本 + + + + + 超时时间 + + + + + 是否是连接的 + + + + + 版本 + + + + + 连接地址 + + + + + 插槽号 + + + + + 机架号 + + + + + 构造函数 + + CPU版本 + IP地址和端口号 + 超时时间 + PLC的插槽号 + PLC的机架号 + + + + 构造函数 + + CPU版本 + IP地址 + 端口号 + PLC的槽号 + PLC的机架号 + 超时时间 + + + + 打开连接(如果已经是连接状态会先关闭再打开) + + + + + + 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次) + + + + + + + 读取字节数组 + + 地址 + 读取长度 + 是否Bit类型 + + + + + 分批读取,默认按19个地址打包读取 + + 地址集合 + 批量读取数量 + + + + + 最多只能批量读取19个数据? + + + + + + + 读取Boolean + + 地址 + + + + + 读取Boolean + + 地址 + 读取数量 + + + + + + + + + + + + 读取Int16 + + 地址 + 读取数量 + + + + + 读取Int16 + + 地址 + + + + + 定时读取,回调更新 + + + + + + + 读取Int16 + + 地址 + 读取数量 + + + + + 读取UInt16 + + 地址 + + + + + 读取UInt16 + + 地址 + 读取数量 + + + + + 读取Int32 + + 地址 + + + + + 读取Int32 + + 地址 + 读取数量 + + + + + 读取UInt32 + + 地址 + + + + + 读取Int32 + + 地址 + 读取数量 + + + + + 读取Int64 + + 地址 + + + + + 读取Int32 + + 地址 + 读取数量 + + + + + 读取UInt64 + + 地址 + + + + + 读取Int32 + + 地址 + 读取数量 + + + + + 读取Float + + 地址 + + + + + 读取Float + + 地址 + 读取数量 + + + + + 读取Double + + 地址 + + + + + 读取Double + + 地址 + 读取数量 + + + + + 读取String + + 地址 + + + + + 读取字符串 + + 地址 + 读取长度 + + + + + 批量写入 + TODO 可以重构后面的Write 都走BatchWrite + + + + + + + 分批写入,默认按10个地址打包读取 + + 地址集合 + 批量读取数量 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + 数据类型 + + + + + 获取区域类型代码 + + + + + + + 转换成写入需要的通讯信息 + + + + + + + + 获取读指令 + + + + + + 获取读指令 + + + + + + + 获取写指令 + + + + + + + 获取写指令 + + + + + + + 获取需要读取的长度 + + + + + + + 获取读取PLC地址的开始位置 + + + + + + + 地址 + + + + + 数据类型 + + + + + 站号 + + + + + 功能码 + + + + + 地址 + + + + + 站号 + + + + + 功能码 + + + + + 三菱解析后的地址信息 + + + + + 开始地址 + + + + + 类型的代号 + + + + + 类型的代号 + + + + + 数据的类型,0代表按字,1代表按位 + + + + + 指示地址是10进制,还是16进制的 + + + + + 数据类型 + + + + + 西门子[写]解析后的地址信息 + + + + + 要写入的数据 + + + + + 赋值 + + + + + Siemens命令常量 + + + + + Head头读取长度 + + + + + 第一次初始化指令交互报文 + + + + + 第二次初始化指令交互报文 + + + + + 第一次初始化指令交互报文 + + + + + 第二次初始化指令交互报文 + + + + + 第一次初始化指令交互报文 + + + + + 第二次初始化指令交互报文 + + + + + 西门子型号版本 + + + + + 未定义 + + + + + 西门子S7-200 【需要配置网络模块】 + + + + + 西门子S7-200Smar + + + + + 西门子S7-300 + + + + + 西门子S7-400 + + + + + 西门子S7-1200 + + + + + 西门子S7-1500 + + + + + CRC16验证 + + + + + 验证CRC16校验码 + + 校验数据 + 多项式码 + 校验码初始值 + + + + + 计算CRC16校验码 + + 校验数据 + 多项式码 + 校验码初始值 + + + + + 数据转换 + + + + + 字节数组转16进制字符 + + + + + + + 16进制字符串转字节数组 + + + 严格模式(严格按两个字母间隔一个空格) + + + + + Asciis字符串数组字符串装字节数组 + + + + + + + + Asciis数组字符串装字节数组 + 如:30 31 =》 00 01 + + + + + + + 字节数组转换成Ascii字节数组 + 如:00 01 => 30 31 + + + + + + + Int转二进制 + + + 补0长度 + + + + + 二进制转Int + + + + + + + 大小端转换 + + + + + 字节格式转换 + + + + 是否经过了反转 + + + + + 字节格式转换 + + + + 是否经过了反转 + + + + + + + + + + 去重 + + + + + + + + + + LRC验证 + + + + + + + + + + + + + + + + + + + 帮助类 + + + + + 是否为异常功能码 + + + + + + + + 异常码描述 + https://www.likecs.com/show-204655077.html?sc=5546 + + + + + + + + + + + 安全关闭 + + + + + + 三菱型号版本 + + + + + 未定义 + + + + + 三菱 MC A-1E帧 + + + + + 三菱 MC Qna-3E帧 + + + + + 数据类型 + + + + + 未定义 + + + + + Bool + + + + + Byte + + + + + Int16 + + + + + UInt16 + + + + + Int32 + + + + + UInt32 + + + + + Int64 + + + + + UInt64 + + + + + Float + + + + + Double + + + + + String + + + + + 字节格式 + https://cloud.tencent.com/developer/article/1601823 + + + + + Big-Endian + 大端序 ABCD + + + + + Big-endian byte swap(大端Byte swap) + 中端序 BADC, PDP-11 风格 + + + + + Little-endian byte swap(小端Byte swap) + 中端序 CDAB, Honeywell 316 风格 + + + + + Little-Endian + 小端序 DCBA + + + + + 西门子解析后的地址信息 + + + + + 原地址 + + + + + 数据类型 + + + + + 区域类型 + + + + + DB块编号 + + + + + 开始地址(西门子plc地址为8个位的长度,这里展开实际的开始地址。) + + + + + 读取或写入长度 + + + + + 是否读取或写入bit类型 + + + + + 以太网形式 + + + + + IPEndPoint + + + + + IIoTClient 接口 + + + + + 版本 + + + + + 是否是连接的 + + + + + 警告日志委托 + 为了可用性,会对异常网络进行重试。此类日志通过委托接口给出去。 + + + + + 打开连接(如果已经是连接状态会先关闭再打开) + + + + + + 关闭连接 + + + + + + 发送报文,并获取响应报文 + + 发送命令 + + + + + 分批读取 + + 地址集合 + 批量读取数量 + + + + + 读取Byte + + + + + + + 读取Boolean + + 地址 + + + + + 读取UInt16 + + 地址 + + + + + 读取Int16 + + 地址 + + + + + 读取UInt32 + + 地址 + + + + + 读取Int32 + + 地址 + + + + + 读取UInt64 + + 地址 + + + + + 读取Int64 + + 地址 + + + + + 读取Float + + 地址 + + + + + 读取Double + + 地址 + + + + + 读取String + + 地址 + + + + + 分批写入 + + 地址集合 + 批量读取数量 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + + + + + 写入数据 + + 地址 + 值 + 数据类型 + + + + + 请求结果 + + + + + 是否成功 + + + + + 异常消息 + + + + + 异常Code + 408 连接失败 + + + + + 详细异常 + + + + + 异常集合 + + + + + 请求报文 + + + + + 响应报文 + + + + + 请求报文2 + + + + + 响应报文2 + + + + + 耗时(毫秒) + + + + + 结束时间统计 + + + + + 开始时间 + + + + + 设置异常信息和Succeed状态 + + + + + + + 添加异常到异常集合 + + + + + 请求结果 + + + + + 数据结果 + + + + + 结束时间统计 + + + + + 赋值 + + + + + 设置异常信息和Succeed状态 + + + + + + + SerialPort基类 + + + + + 串行端口对象 + + + + + 是否自动打开关闭 + + + + + 获取设备上的COM端口集合 + + + + + + 连接 + + + + + + 打开连接 + + + + + + 关闭连接 + + + + + + 关闭连接 + + + + + + 读取 + + + + + + + 日记记录委托定义 + + + + + + + Socket基类 + + + + + 警告日志委托 + 为了可用性,会对异常网络进行重试。此类日志通过委托接口给出去。 + + + + + 分批缓冲区大小 + + + + + Socket实例 + + + + + 是否自动打开关闭 + + + + + 连接(如果已经是连接状态会先关闭再打开) + + + + + + 打开连接(如果已经是连接状态会先关闭再打开) + + + + + + 关闭连接 + + + + + + 关闭连接 + + + + + + Socket读取 + + socket + 读取长度 + + + + + 发送报文,并获取响应报文(建议使用SendPackageReliable,如果异常会自动重试一次) + + 发送命令 + + + + + 发送报文,并获取响应报文(如果网络异常,会自动进行一次重试) + TODO 重试机制应改成用户主动设置 + + + + + + diff --git a/packages/System.IO.Ports.4.6.0/.signature.p7s b/packages/System.IO.Ports.4.6.0/.signature.p7s new file mode 100644 index 0000000..bc68875 Binary files /dev/null and b/packages/System.IO.Ports.4.6.0/.signature.p7s differ diff --git a/packages/System.IO.Ports.4.6.0/LICENSE.TXT b/packages/System.IO.Ports.4.6.0/LICENSE.TXT new file mode 100644 index 0000000..984713a --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/LICENSE.TXT @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/System.IO.Ports.4.6.0/System.IO.Ports.4.6.0.nupkg b/packages/System.IO.Ports.4.6.0/System.IO.Ports.4.6.0.nupkg new file mode 100644 index 0000000..1e88703 Binary files /dev/null and b/packages/System.IO.Ports.4.6.0/System.IO.Ports.4.6.0.nupkg differ diff --git a/packages/System.IO.Ports.4.6.0/THIRD-PARTY-NOTICES.TXT b/packages/System.IO.Ports.4.6.0/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 0000000..77a243e --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,375 @@ +.NET Core uses third-party libraries or other resources that may be +distributed under licenses different than the .NET Core software. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +License notice for ASP.NET +------------------------------- + +Copyright (c) .NET Foundation. All rights reserved. +Licensed under the Apache License, Version 2.0. + +Available at +https://github.com/aspnet/AspNetCore/blob/master/LICENSE.txt + +License notice for Slicing-by-8 +------------------------------- + +http://sourceforge.net/projects/slicing-by-8/ + +Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + + +This software program is licensed subject to the BSD License, available at +http://www.opensource.org/licenses/bsd-license.html. + + +License notice for Unicode data +------------------------------- + +http://www.unicode.org/copyright.html#License + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +License notice for Zlib +----------------------- + +https://github.com/madler/zlib +http://zlib.net/zlib_license.html + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +*/ + +License notice for Mono +------------------------------- + +http://www.mono-project.com/docs/about-mono/ + +Copyright (c) .NET Foundation Contributors + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the Software), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +License notice for International Organization for Standardization +----------------------------------------------------------------- + +Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. + +License notice for Intel +------------------------ + +"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License notice for Xamarin and Novell +------------------------------------- + +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +Copyright (c) 2011 Novell, Inc (http://www.novell.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +Third party notice for W3C +-------------------------- + +"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE +Status: This license takes effect 13 May, 2015. +This work is being provided by the copyright holders under the following license. +License +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: +The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." + +License notice for Bit Twiddling Hacks +-------------------------------------- + +Bit Twiddling Hacks + +By Sean Eron Anderson +seander@cs.stanford.edu + +Individually, the code snippets here are in the public domain (unless otherwise +noted) — feel free to use them however you please. The aggregate collection and +descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are +distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and +without even the implied warranty of merchantability or fitness for a particular +purpose. + +License notice for Brotli +-------------------------------------- + +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +compress_fragment.c: +Copyright (c) 2011, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +decode_fuzzer.c: +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + +License notice for Json.NET +------------------------------- + +https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md + +The MIT License (MIT) + +Copyright (c) 2007 James Newton-King + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +License notice for vectorized base64 encoding / decoding +-------------------------------------------------------- + +Copyright (c) 2005-2007, Nick Galbreath +Copyright (c) 2013-2017, Alfred Klomp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2016-2017, Matthieu Darbois +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/System.IO.Ports.4.6.0/lib/net461/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/lib/net461/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/lib/net461/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/lib/netstandard2.0/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/lib/netstandard2.0/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/lib/netstandard2.0/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/lib/uap10.0.16299/_._ b/packages/System.IO.Ports.4.6.0/lib/uap10.0.16299/_._ new file mode 100644 index 0000000..e69de29 diff --git a/packages/System.IO.Ports.4.6.0/ref/net461/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/ref/net461/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/ref/net461/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/ref/netstandard2.0/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/ref/netstandard2.0/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/ref/netstandard2.0/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/ref/uap10.0.16299/_._ b/packages/System.IO.Ports.4.6.0/ref/uap10.0.16299/_._ new file mode 100644 index 0000000..e69de29 diff --git a/packages/System.IO.Ports.4.6.0/runtimes/linux/lib/netstandard2.0/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/runtimes/linux/lib/netstandard2.0/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/runtimes/linux/lib/netstandard2.0/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/runtimes/osx/lib/netstandard2.0/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/runtimes/osx/lib/netstandard2.0/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/runtimes/osx/lib/netstandard2.0/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/runtimes/win/lib/net461/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/runtimes/win/lib/net461/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/runtimes/win/lib/net461/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/runtimes/win/lib/netstandard2.0/System.IO.Ports.xml b/packages/System.IO.Ports.4.6.0/runtimes/win/lib/netstandard2.0/System.IO.Ports.xml new file mode 100644 index 0000000..8d34fc2 --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/runtimes/win/lib/netstandard2.0/System.IO.Ports.xml @@ -0,0 +1,541 @@ + + + + System.IO.Ports + + + + Specifies the control protocol used in establishing a serial port communication for a object. + + + No control is used for the handshake. + + + Request-to-Send (RTS) hardware flow control is used. RTS signals that data is available for transmission. If the input buffer becomes full, the RTS line will be set to . The RTS line will be set to when more room becomes available in the input buffer. + + + Both the Request-to-Send (RTS) hardware control and the XON/XOFF software controls are used. + + + The XON/XOFF software control protocol is used. The XOFF control is sent to stop the transmission of data. The XON control is sent to resume the transmission. These software controls are used instead of Request to Send (RTS) and Clear to Send (CTS) hardware controls. + + + Specifies the parity bit for a object. + + + Sets the parity bit so that the count of bits set is an even number. + + + Leaves the parity bit set to 1. + + + No parity check occurs. + + + Sets the parity bit so that the count of bits set is an odd number. + + + Leaves the parity bit set to 0. + + + Specifies the type of character that was received on the serial port of the object. + + + A character was received and placed in the input buffer. + + + The end of file character was received and placed in the input buffer. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies errors that occur on the object. + + + The hardware detected a framing error. + + + A character-buffer overrun has occurred. The next character is lost. + + + An input buffer overflow has occurred. There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character. + + + The hardware detected a parity error. + + + The application tried to transmit a character, but the output buffer was full. + + + Prepares data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The sender of the event, which is the object. + A object that contains the event data. + + + Specifies the type of change that occurred on the object. + + + A break was detected on input. + + + The Carrier Detect (CD) signal changed state. This signal is used to indicate whether a modem is connected to a working phone line and a data carrier signal is detected. + + + The Clear to Send (CTS) signal changed state. This signal is used to indicate whether data can be sent over the serial port. + + + The Data Set Ready (DSR) signal changed state. This signal is used to indicate whether the device on the serial port is ready to operate. + + + A ring indicator was detected. + + + Provides data for the event. + + + Gets or sets the event type. + One of the values. + + + Represents the method that will handle the event of a object. + The source of the event, which is the object. + A object that contains the event data. + + + Represents a serial port resource. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified object. + An interface to a container. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name. + The port to use (for example, COM1). + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name and baud rate. + The port to use (for example, COM1). + The baud rate. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, and parity bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, and data bits. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + The specified port could not be found or opened. + + + Initializes a new instance of the class using the specified port name, baud rate, parity bit, data bits, and stop bit. + The port to use (for example, COM1). + The baud rate. + One of the values. + The data bits value. + One of the values. + The specified port could not be found or opened. + + + Gets the underlying object for a object. + A object. + The stream is closed. This can occur because the method has not been called or the method has been called. + The stream is in a .NET Compact Framework application and one of the following methods was called: + + + The .NET Compact Framework does not support the asynchronous model with base streams. + + + Gets or sets the serial baud rate. + The baud rate. + The baud rate specified is less than or equal to zero, or is greater than the maximum allowable baud rate for the device. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the break signal state. + + if the port is in a break state; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the number of bytes of data in the receive buffer. + The number of bytes of data in the receive buffer. + The port is not open. + + + Gets the number of bytes of data in the send buffer. + The number of bytes of data in the send buffer. + The port is in an invalid state. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets the state of the Carrier Detect line for the port. + + if the carrier is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Closes the port connection, sets the property to , and disposes of the internal object. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Clear-to-Send line. + + if the Clear-to-Send line is detected; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets the standard length of data bits per byte. + The data bits length. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The data bits value is less than 5 or more than 8. + + + Indicates that data has been received through a port represented by the object. + + + Discards data from the serial driver's receive buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value indicating whether null bytes are ignored when transmitted between the port and the receive buffer. + + if null bytes are ignored; otherwise . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Discards data from the serial driver's transmit buffer. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + to release both managed and unmanaged resources; to release only unmanaged resources. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets the state of the Data Set Ready (DSR) signal. + + if a Data Set Ready signal has been sent to the port; otherwise, . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The stream is closed. This can occur because the method has not been called or the method has been called. + + + Gets or sets a value that enables the Data Terminal Ready (DTR) signal during serial communication. + + to enable Data Terminal Ready (DTR); otherwise, . The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the byte encoding for pre- and post-transmission conversion of text. + An object. The default is . + The property was set to . + The property was set to an encoding that is not , , , , one of the Windows single byte encodings, or one of the Windows double byte encodings. + + + Indicates that an error has occurred with a port represented by a object. + + + Gets an array of serial port names for the current computer. + An array of serial port names for the current computer. + The serial port names could not be queried. + + + Gets or sets the handshaking protocol for serial port transmission of data using a value from . + One of the values. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Indicates that no time-out should occur. + + + Gets a value indicating the open or closed status of the object. + + if the serial port is open; otherwise, . The default is . + The value passed is . + The value passed is an empty string (""). + + + Gets or sets the value used to interpret the end of a call to the and methods. + A value that represents the end of a line. The default is a line feed ("\n" in C# or in Visual Basic). + The property value is empty. + The property value is . + + + Opens a new serial port connection. + Access is denied to the port. +-or- + The current process, or another process on the system, already has the specified COM port open either by a instance or in unmanaged code. + One or more of the properties for this instance are invalid. For example, the , , or properties are not valid values; the is less than or equal to zero; the or property is less than zero and is not . + The port name does not begin with "COM". +-or- + The file type of the port is not supported. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The specified port on the current instance of the is already open. + + + Gets or sets the parity-checking protocol. + One of the enumeration values that represents the parity-checking protocol. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value passed is not a valid value in the enumeration. + + + Gets or sets the byte that replaces invalid bytes in a data stream when a parity error occurs. + A byte that replaces invalid bytes. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Indicates that a non-data signal event has occurred on the port represented by the object. + + + Gets or sets the port for communications, including but not limited to all available COM ports. + The communications port. The default is COM1. + The property was set to a value with a length of zero. + -or- + The property was set to a value that starts with "\\". + -or- + The port name was not valid. + The property was set to . + The specified port is open. + + + Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset. + The byte array to write the input to. + The offset in at which to write the bytes. + The maximum number of bytes to read. Fewer bytes are read if is greater than the number of bytes in the input buffer. + The number of bytes read. + The buffer passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + No bytes were available to read. + + + Reads a number of characters from the input buffer and writes them into an array of characters at a given offset. + The character array to write the input to. + The offset in at which to write the characters. + The maximum number of characters to read. Fewer characters are read if is greater than the number of characters in the input buffer. + The number of characters read. + + plus is greater than the length of the buffer. +-or- + is 1 and there is a surrogate character in the buffer. + The passed is . + The or parameters are outside a valid region of the being passed. Either or is less than zero. + The specified port is not open. + No characters were available to read. + + + Gets or sets the size of the input buffer. + The buffer size, in bytes. The default value is 4096; the maximum value is that of a positive int, or 2147483647. + The value set is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Synchronously reads one byte from the input buffer. + The byte, cast to an , or -1 if the end of the stream has been read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No byte was read. + + + Synchronously reads one character from the input buffer. + The character that was read. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No character was available in the allotted time-out period. + + + Reads all immediately available bytes, based on the encoding, in both the stream and the input buffer of the object. + The contents of the stream and the input buffer of the object. + The specified port is not open. + + + Reads up to the value in the input buffer. + The contents of the input buffer up to the first occurrence of a value. + The specified port is not open. + The operation did not complete before the time-out period ended. +-or- + No bytes were read. + + + Gets or sets the number of milliseconds before a time-out occurs when a read operation does not finish. + The number of milliseconds before a time-out occurs when a read operation does not finish. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The read time-out value is less than zero and not equal to . + + + Reads a string up to the specified in the input buffer. + A value that indicates where the read operation stops. + The contents of the input buffer up to the specified . + The length of the parameter is 0. + The parameter is . + The specified port is not open. + The operation did not complete before the time-out period ended. + + + Gets or sets the number of bytes in the internal input buffer before a event occurs. + The number of bytes in the internal input buffer before a event is fired. The default is 1. + The value is less than or equal to zero. + + + Gets or sets a value indicating whether the Request to Send (RTS) signal is enabled during serial communication. + + to enable Request to Transmit (RTS); otherwise, . The default is . + The value of the property was set or retrieved while the property is set to the value or the value. + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Gets or sets the standard number of stopbits per byte. + One of the values. + The value is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + + + Writes a specified number of bytes to the serial port using data from a buffer. + The byte array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of bytes to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes a specified number of characters to the serial port using data from a buffer. + The character array that contains the data to write to the port. + The zero-based byte offset in the parameter at which to begin copying bytes to the port. + The number of characters to write. + The passed is . + The specified port is not open. + The or parameters are outside a valid region of the being passed. Either or is less than zero. + + plus is greater than the length of the . + The operation did not complete before the time-out period ended. + + + Writes the specified string to the serial port. + The string for output. + The specified port is not open. + + is . + The operation did not complete before the time-out period ended. + + + Gets or sets the size of the serial port output buffer. + The size of the output buffer. The default is 2048. + The value is less than or equal to zero. + The property was set while the stream was open. + The property was set to an odd integer value. + + + Writes the specified string and the value to the output buffer. + The string to write to the output buffer. + The parameter is . + The specified port is not open. + The method could not write to the stream. + + + Gets or sets the number of milliseconds before a time-out occurs when a write operation does not finish. + The number of milliseconds before a time-out occurs. The default is . + The port is in an invalid state. +-or- + An attempt to set the state of the underlying port failed. For example, the parameters passed from this object were invalid. + The value is less than zero and not equal to . + + + Specifies the number of stop bits used on the object. + + + No stop bits are used. This value is not supported by the property. + + + One stop bit is used. + + + 1.5 stop bits are used. + + + Two stop bits are used. + + + \ No newline at end of file diff --git a/packages/System.IO.Ports.4.6.0/runtimes/win/lib/uap10.0.16299/_._ b/packages/System.IO.Ports.4.6.0/runtimes/win/lib/uap10.0.16299/_._ new file mode 100644 index 0000000..e69de29 diff --git a/packages/System.IO.Ports.4.6.0/useSharedDesignerContext.txt b/packages/System.IO.Ports.4.6.0/useSharedDesignerContext.txt new file mode 100644 index 0000000..e69de29 diff --git a/packages/System.IO.Ports.4.6.0/version.txt b/packages/System.IO.Ports.4.6.0/version.txt new file mode 100644 index 0000000..7de67ed --- /dev/null +++ b/packages/System.IO.Ports.4.6.0/version.txt @@ -0,0 +1 @@ +4ac4c0367003fe3973a3648eb0715ddb0e3bbcea