Пример #1
0
 private void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
 {
     try
     {
         for (int c = 0; c != _port.BytesToRead; c++)
         {
             _buffer[_pointer] = _port.ReadByte();
             _pointer++;
         }
     }
     catch (TimeoutException x)
     {
         var cid = new CometData(_buffer);
         ProcessPhoneNumber(cid.getCIDNumber());
         _buffer  = new int[255];
         _pointer = 0;
     }
 }
Пример #2
0
        private void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            try
            {
                for (int c = 0; c != _port.BytesToRead; c++)
                {
                    _buffer[_pointer] = _port.ReadByte();
                    _pointer++;
                }
            }
            catch (TimeoutException x)
            {

                var cid = new CometData(_buffer);
                ProcessPhoneNumber(cid.getCIDNumber());
                _buffer = new int[255];
                _pointer = 0;
            }
        }