Exemplo n.º 1
0
        public void CreatePort(SerialPortSettings settings)
        {
            try
            {
                _serialPort = new SerialPort(settings.Name);

                _serialPort.DataReceived += SerialPortOnDataReceived;
                _serialPort.PinChanged   += SerialPortOnPinChanged;

                _serialPort.Open();
            }
            catch (Exception e)
            {
                // todo: log exception please.
            }
        }
Exemplo n.º 2
0
 public SerialPortByteSource(SerialPortSettings settings)
 {
     CreatePort(settings);
 }