public void ConnectToCOMPort(string port) { Disconnect(); _comPort = new COMPort(port); _comPort.MessageReceived += COMMessageReceived; _comPort.StartListening(); COMConnected(port); }
public void Disconnect() { if (_comPort == null) { return; } var name = _comPort.PortName; _comPort.Dispose(); _comPort = null; COMDisconnected(name); }