public void Start(SDRSharp.Radio.SamplesAvailableDelegate callback) { if (_bladeRFDevice == null) throw new ApplicationException("No device selected"); _callback = callback; _bladeRFDevice.Start(); }
public void Start(SDRSharp.Radio.SamplesAvailableDelegate callback) { if (this._device == null) throw new ApplicationException("No device selected"); this._callback = callback; try { this._device.Start(); } catch { this.Open(); this._device.Start(); } }
public void Start(SDRSharp.Radio.SamplesAvailableDelegate callback) { _callback = callback; _hostName = _gui.Host; _port = _gui.Port; _is16Bit = _gui.Use16Bit; _lostPacketsCount = 0; _circularBufferHead = 0; _circularBufferTail = 0; _sampleCount = 0; _sampleBuffer = UnsafeBuffer.Create(256 * 2, sizeof(Complex)); _sampleBufferPtr = (Complex*)_sampleBuffer; _workingSamplePtr = _sampleBufferPtr; _client = new SdrIpClient(); _client.Connect(_hostName, _port); _client.Samplerate = _sampleRate; _client.Frequency = _frequency; _client.Use16Bit = _is16Bit; _udpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); _udpSocket.ReceiveBufferSize = 65535; var remoteIpEndPoint = new IPEndPoint(IPAddress.Any, _port); _udpSocket.Bind(remoteIpEndPoint); _udpThread = new Thread(UdpReceiverThread); _udpThread.Priority = ThreadPriority.Highest; _udpThreadRunning = true; _udpThread.Start(); _workerThread = new Thread(WorkerThread); _workerThreadRunning = true; _workerThread.Start(); _client.StartStreaming(); _tuneTimer.Start(); Utils.SaveSetting("SDRIPHost", _hostName); Utils.SaveSetting("SDRIPPort", _port); Utils.SaveSetting("SDRIPRateIndex", _gui.SamepleRateIndex); Utils.SaveSetting("SDRIPFormatIndex", _gui.SampleFormatIndex); }
public void Start(SDRSharp.Radio.SamplesAvailableDelegate callback) { this.Open(); this._callback = callback; try { this._airspyDevice.UsePacking = this.UsePacking; this._airspyDevice.Start(); } catch { this.Close(); this.Open(); this._airspyDevice.UsePacking = this.UsePacking; this._airspyDevice.Start(); } }