/// <summary> /// Open serial connection to the LCD device as configured when constructed. /// </summary> public void Connect() { if (Connected) { Disconnect(); } _deviceConnection = new Cfa533Rs232Connection(_serialPortName, _baudRate); _deviceConnection.Connect(); _deviceConnection.KeypadActivity += KeyboardActivityProxy; }
/// <summary> /// Close serial connection to LCD device. /// </summary> public void Disconnect() { if (_deviceConnection == null) { return; } _deviceConnection.KeypadActivity -= KeyboardActivityProxy; _deviceConnection.Disconnect(); _deviceConnection.Dispose(); _deviceConnection = null; }