bool ISerialDriver.Uninitialize(int serialPortNum) { ComPort serial = GetComPort(serialPortNum); if (!(serial is ISerialPortToStream)) { return(false); } return(((ISerialPortToStream)serial).Uninitialize() && serial.DeviceUninitialize()); }
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(); } }