示例#1
0
 public PacketListener()
 {
     _baseLink = new BaseLink("COM4");
     _parser = new Parser();
     _baseLink.PacketReceived += _parser.HandleData;
     _parser.EventReceived += OnEvent;
     _parser.SliceReceived += OnSlice;
 }
示例#2
0
        public void Connect(string comPort)
        {
            _baseLink = new BaseLink(comPort);
            _parser = new Parser();
            _baseLink.PacketReceived += _parser.HandleData;

            _worker = new Thread(_baseLink.StartReading);
            _worker.Start();
        }