Exemple #1
0
        public void CloseConnnection()
        {
            if (_utecConn != null)
            {
                _utecConn.DataReceived  -= _utecConn_DataReceived;
                _utecConn.ErrorReceived -= SerialConnection_ErrorReceived;
                _utecConn.Stop();
                _utecConn.Dispose();
                _utecConn = null;
            }

            if (_externalWB != null)
            {
                _externalWB.ErrorReceived -= SerialConnection_ErrorReceived;
                _externalWB.Stop();
                _externalWB.Dispose();
                _externalWB = null;
            }
        }