public void Connect(string ComPort) { GC.Collect(); // avoid open connections if (IsConnected) { throw new Exception($"Already connected to device {SerialD.PortName}"); } SerialD = ComPort == null?SerialDevice.getAvailable() : new SerialDevice(ComPort); PinCount = SerialD.RunCommand(SysExMsg.MSG_GET_PINCOUNT, CommandType.Get).Values[0]; LoadSettings(); }
public static IEnumerable <string> getPorts() { return(SerialDevice.GetPortNames()); }