public void Connect(string port) { serial = SerialControl.Create(port); serial.AddThread(SerialProcessor, ThreadPriority.Highest); serial.AddThread(KeepAlive); Logger.Log("Connecting on " + port); serial.Open(); }
/// <summary> /// 打开 /// </summary> public void Open() { if (SerialControl.IsOpen) { Close(); } SerialControl.Parity = Parity; SerialControl.BaudRate = BandRoate; SerialControl.StopBits = StopBit; SerialControl.PortName = PortName; SerialControl.DataBits = DataP; SerialControl.Head = 0xee; SerialControl.End = 0xff; SerialControl.Open(); }