public void PulseRtsLow() { if (serialPort == null && this.ActivePrinter != null) { serialPort = FrostedSerialPortFactory.GetAppropriateFactory(ActivePrinterProfile.Instance.ActivePrinter.DriverType).Create(this.ActivePrinter.ComPort); serialPort.BaudRate = this.BaudRate; // Set the read/write timeouts serialPort.ReadTimeout = 500; serialPort.WriteTimeout = 500; serialPort.Open(); serialPort.RtsEnable = true; serialPort.RtsEnable = false; try { Thread.Sleep(100); } catch(Exception e) { // Let's track this issue if possible. MatterControlApplication.Instance.ReportException(e, this.GetType().Name, MethodBase.GetCurrentMethod().Name); } serialPort.RtsEnable = true; serialPort.Close(); } }
public void Close() { port.Close(); }
public void PulseRtsLow() { if (serialPort == null && this.ActivePrinter != null) { serialPort = FrostedSerialPort.Create(this.ActivePrinter.ComPort); serialPort.BaudRate = this.BaudRate; if (PrinterConnectionAndCommunication.Instance.DtrEnableOnConnect) { serialPort.DtrEnable = true; } // Set the read/write timeouts serialPort.ReadTimeout = 500; serialPort.WriteTimeout = 500; serialPort.Open(); serialPort.RtsEnable = true; serialPort.RtsEnable = false; try { Thread.Sleep(1); } catch { } serialPort.RtsEnable = true; serialPort.Close(); } }