예제 #1
0
        bool IComDriver.Uninitialize(int ComHandle)
        {
            ComPort port   = GetComPort(ComHandle);
            bool    retVal = true;

            if (port is ISerialPortToStream)
            {
                retVal = ((ISerialPortToStream)port).Uninitialize();
            }

            return(port.DeviceUninitialize() && retVal);
        }
예제 #2
0
        bool IComDriver.Initialize(int ComHandle)
        {
            ComPort port   = GetComPort(ComHandle);
            bool    retVal = true;

            if (port is ISerialPortToStream)
            {
                retVal = ((ISerialPortToStream)port).Initialize(115200, 0, 8, 1, 0);
            }

            return(port.DeviceInitialize() && retVal);
        }
예제 #3
0
        internal override void UnregisterInternal(EmulatorComponent ec)
        {
            VerifyAccess();

            ComPort comPort = ec as ComPort;

            if (comPort != null)
            {
                if (_ports[comPort.ComPortHandle] == comPort)
                {
                    _ports.Remove(comPort.ComPortHandle);
                    _validPorts.Remove(comPort);

                    base.UnregisterInternal(ec);
                }
            }
        }