Exemple #1
0
        protected override void AddToBuffer(DataSource o, DataReceivedEventArgs e)
        {
            if (e.Data.Length + _buffer.Count >= 32)
            {
                _buffer.Clear();
            }

            _buffer.AddRange(e.Data);

            if (_buffer.Count == 32)
            {
                var msg = new IntergasResponseFrame();
                if (msg.Parse(e.Data.ToList()))
                {
                    OnLineReceived(msg);
                }
            }
        }
 public IntergasResponseFrameEventArgs(IntergasResponseFrame frame)
 {
     Frame = frame;
 }