Example #1
0
        public bool SetCurrentPortName(string portName)
        {
            var pName = AllowedPortNames.First(x => x == portName);

            CurrentPortName = pName;
            SerialPort?.Dispose();
            return(InitSerialPortSender(pName, dataReceived));
        }
Example #2
0
 public HardwareService(SerialDataReceivedEventHandler dataReceived)
 {
     this.dataReceived = dataReceived;
     CurrentPortName   = AllowedPortNames.First(x => x == "COM6");
     InitSerialPortSender(CurrentPortName, this.dataReceived);
 }