コード例 #1
0
        bool ISerialDriver.Uninitialize(int serialPortNum)
        {
            ComPort serial = GetComPort(serialPortNum);

            if (!(serial is ISerialPortToStream))
            {
                return(false);
            }

            return(((ISerialPortToStream)serial).Uninitialize() && serial.DeviceUninitialize());
        }
コード例 #2
0
        private void UnregisterNamedPipePort(ComPort port)
        {
            VerifyAccess();

            int idx = FindConnectDataIndex(port.ComPortHandle);

            if (idx != -1)
            {
                NamedPipeConnectData connectData = _connectData[idx];

                Debug.Assert(connectData._isConnected);

                connectData._isRegistered = false;
                connectData._isConnected  = false;
                connectData._pipe.Dispose();

                //reset connectdata
                InitializeConnectData(connectData);

                port.DeviceUninitialize();

                _areClients.Set();
            }
        }
コード例 #3
0
        private void UnregisterNamedPipePort(ComPort port)
        {
            VerifyAccess();

            int idx = FindConnectDataIndex(port.ComPortHandle);

            if (idx != -1)
            {
                NamedPipeConnectData connectData = _connectData[idx];

                Debug.Assert(connectData._isConnected);

                connectData._isRegistered = false;
                connectData._isConnected = false;
                connectData._pipe.Dispose();

                //reset connectdata
                InitializeConnectData(connectData);

                port.DeviceUninitialize();

                _areClients.Set();
            }
        }