Пример #1
0
 public SerialPortByteStream(ISerialConfigurationProvider serialConfig)
 {
     _serial = new Lazy <SerialPort>(() =>
     {
         var s         = new SerialPort(serialConfig.Port, 115200, Parity.None, 8, StopBits.One);
         s.ReadTimeout = 5000;
         s.Open();
         return(s);
     });
 }
 public NodeMessageReader(ISerialConfigurationProvider serialConfig, IEnumerable<IMessageEncoder> encoders)
 {
     _encoders = encoders.ToList();
     _parsers = new List<IMessageParser>
     {
         new CommentParser(),
         new NodeStartedParser(),
         new PulseReportParser(),
         new EnvironmentReportParser(),
         new NodeInfoReportParser(),
         new ParseAllParser(),
     };
     _serial = new SerialPort(serialConfig.Port, 115200, Parity.None, 8, StopBits.One);
 }