/// <summary> /// Set Parameters, it will initialize the connection /// </summary> /// <param name="cfg"></param> public void SetParameters(DeviceConfig cfg) { if (mCom != null) { mCom.Close(); } if (cfg.UsingComPort) { mCom = new ComPortWrapper(); } else { mCom = new TcpWrapper(); } mCom.SetParameters(cfg); mCom.OnConnectStatusChange += new UpdateMessageHandler(OnConnectionStatusChanged); }