public unsafe void Start()
        {
            if (_isStreaming)
            {
                throw new ApplicationException("Start() Already running");
            }

            PlutoSDRControllerDialog gui = _plutoSDRIO.GUI;

            _gui.samplerateComboBox.Enabled = false;

            if (_dev == null)
            {
                createContext();
            }

            configureReceiver();

            Device lpc = _ctx.get_device("cf-ad9361-lpc");

            if (lpc == null)
            {
                throw new ApplicationException("Device cf-ad9361-lpc not found!");
            }

            _rx0_i = IIOHelper.FindChannel(lpc, "voltage0");
            _rx0_q = IIOHelper.FindChannel(lpc, "voltage1");

            _rx0_i.enable();
            _rx0_q.enable();

            if (_buf != null)
            {
                _buf.Dispose();
            }
            _buf = new IOBuffer(lpc, _readLength, false);
            if (_buf == null)
            {
                throw new ApplicationException("Could not initialize I/Q sample buffer");
            }

            // new sync interface
            _sampleThread          = new Thread(ReceiveSamples_sync);
            _sampleThread.Name     = "PlutoSDR_samples_rx";
            _sampleThread.Priority = ThreadPriority.Highest;
            _isStreaming           = true;
            _sampleThread.Start();
            bool ready = false;

            while (!ready)
            {
                lock (syncLock)
                {
                    ready = _RXConfigured;
                }
            }
        }
        public void Stop()
        {
            if (_isStreaming)
            {
                _isStreaming = false;
            }

            if (_sampleThread != null)
            {
                if (_sampleThread.ThreadState == ThreadState.Running)
                {
                    _sampleThread.Join();
                }

                _sampleThread = null;
            }

            PlutoSDRControllerDialog gui = _plutoSDRIO.GUI;

            _gui.samplerateComboBox.Enabled = true;
        }
Esempio n. 3
0
 public PlutoSDRIO()
 {
     _gui = new PlutoSDRControllerDialog(this);
 }
 public PlutoSDRDevice(PlutoSDRIO plutoSDRIO)
 {
     _plutoSDRIO = plutoSDRIO;
     _gui        = _plutoSDRIO.GUI;
 }