/// <summary> /// Connect to a serial port /// </summary> /// <param name="comPort">The COM port</param> public void SetSerial(string comPort) { try{ this.serial = new SerialCom(comPort, 19200, deleg); this.serialWorks = true; } catch (Exception e) { this.serialWorks = false; deleg("Failed to connect to serial port " + comPort); System.Diagnostics.Debug.Print(e.ToString()); } }
/// <summary> /// Disconnect the serial connection /// </summary> public void StopSerial() { serial.StopSerial(); this.serialWorks = false; this.serial = null; }