Exemplo n.º 1
0
        private void VirtualMachine_Stopped(object sender, EventArgs e)
        {
            vmRunning = false;
            OnUpdateControls();

            DebuggerWorker.CancelAsync();

            try
            {
                SerialStream.Close();
            }
            catch { }

            try
            {
                if (Gdb != null)
                {
                    Gdb.Dispose();
                }
            }
            finally
            {
                Gdb = null;
            }

            if (restartingVM)
            {
                return;
            }

            if (Bootstrap.Parameters.ContainsKey("start"))
            {
                Application.Exit();
            }
        }
Exemplo n.º 2
0
 public void Close()
 {
     if (_stream != null)
     {
         _stream.TelegramReceived -= TelegramReceived;
         _stream.Close();
     }
 }
Exemplo n.º 3
0
 public void Close()
 {
     if (!isOpen)
     {
         throw new InvalidOperationException("Serial Port - port already closed!");
     }
     if (internalSerialStream != null)
     {
         internalSerialStream.Close();
         internalSerialStream = null;
     }
     isOpen = false;
 }
Exemplo n.º 4
0
        private void SerialStream_Read(IAsyncResult asyncResult)
        {
            int count = SerialStream.EndRead(asyncResult);

            if (count != 1)
            {
                try
                {
                    SerialStream.Close();
                    Gdb.Dispose();
                }
                catch { }

                SerialStream = new NamedPipeServerStream("System", PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
                SerialStream.BeginWaitForConnection(SerialStream_WaitForConnection, null);

                return;
            }

            SerialStream_ReadByte(buffer[0]);

            SerialStream.BeginRead(buffer, 0, 1, SerialStream_Read, null);
        }
 public override void Disconnect()
 {
     _device.Close();
 }
Exemplo n.º 6
0
 public override void Close()
 {
     NativeStream.Close();
     NativeStream = null;
 }
Exemplo n.º 7
0
 void CloseAll()
 {
     stream.Close();
     stream = null;
 }