Beispiel #1
0
 //------------------------------------------------------------------------------------------------------------------------
 public void AddFrame(Image Frame)
 {
     if (!IsDisposed)
     {
         requestQueueConsumer.Enqueue(Frame);
     }
 }
Beispiel #2
0
        //------------------------------------------------------------------------------------------------------------------------

        public void AddPCMdata(byte[] data)
        {
            if (!IsDisposed)
            {
                requestQueueConsumer.Enqueue(data);
            }
        }
Beispiel #3
0
        //------------------------------------------------------------------------------------------------------------------------

        private void StartSerialPortReadThread()
        {
            _SerialPortReadThread = new Thread(() =>
            {
                string line;

                DebugEx.TraceLog($"Serial reading thread started in Port:{mySerial.PortName}, IsOpen:{mySerial.IsOpen}");

                while (_IsRunning)
                {
                    try
                    {
                        line = mySerial.ReadLine();

                        SendQueue.Enqueue(line);
                        DebugEx.TraceLog($"data read: \"{line}\"");
                    }
                    catch (TimeoutException tout_ex) { }
                    catch (InvalidOperationException inv_ex)
                    {
                        DebugEx.TraceErrorException(inv_ex, "InvalidOperationException");
                    }
                    catch (Exception ex)
                    {
                        DebugEx.TraceErrorException(ex, "GenericException");
                    }
                }
            });
            _SerialPortReadThread.IsBackground = true;
            _SerialPortReadThread.Start();
        }