Example #1
0
 public SerialChannel(SerialConfig config)
 {
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config), $"{nameof(config)}不能为空");
     }
     if (config.Port <= 0)
     {
         throw new ArgumentNullException(nameof(config), $"串口号必须设置。");
     }
     _config = config;
 }
Example #2
0
 protected bool Equals(SerialConfig other)
 {
     return(Port == other.Port);
 }