private unsafe static void SdrIqSamplesAvailable(short *buf, uint len, IntPtr ctx) { GCHandle gCHandle = GCHandle.FromIntPtr(ctx); if (gCHandle.IsAllocated) { SdrIqDevice sdrIqDevice = (SdrIqDevice)gCHandle.Target; int num = (int)len / 2; if (sdrIqDevice._iqBuffer == null || sdrIqDevice._iqBuffer.Length != num) { sdrIqDevice._iqBuffer = UnsafeBuffer.Create(num, sizeof(Complex)); sdrIqDevice._iqPtr = (Complex *)(void *)sdrIqDevice._iqBuffer; } Complex *ptr = sdrIqDevice._iqPtr; for (int i = 0; i < num; i++) { Complex *intPtr = ptr; float * lut = SdrIqDevice._lut16; short * intPtr2 = buf; buf = intPtr2 + 1; intPtr->Imag = lut[*intPtr2 + 32768]; Complex *intPtr3 = ptr; float * lut2 = SdrIqDevice._lut16; short * intPtr4 = buf; buf = intPtr4 + 1; intPtr3->Real = lut2[*intPtr4 + 32768]; ptr++; } sdrIqDevice.ComplexSamplesAvailable(sdrIqDevice._iqPtr, sdrIqDevice._iqBuffer.Length); } }
public void SelectDevice(uint index) { Close(); _device = new SdrIqDevice(index); _device.SamplesAvailable += sdriqDevice_SamplesAvailable; _device.Frequency = _frequency; _gui.ConfigureGUI(); _gui.ConfigureDevice(); }
public void SelectDevice(uint index) { this.Close(); this._device = new SdrIqDevice(index); this._device.SamplesAvailable += this.sdriqDevice_SamplesAvailable; this._device.Frequency = this._frequency; this._gui.ConfigureGUI(); this._gui.ConfigureDevice(); }
public void Close() { if (_device != null) { _device.Stop(); _device.SamplesAvailable -= sdriqDevice_SamplesAvailable; _device.Dispose(); _device = null; } }
public void Close() { if (this._device != null) { this._device.Stop(); this._device.SamplesAvailable -= this.sdriqDevice_SamplesAvailable; this._device.Dispose(); this._device = null; } }
public void SelectDevice(uint index) { this.Close(); this._device = new SdrIqDevice(index); this._device.SamplesAvailable += new SamplesAvailableDelegate(this.sdriqDevice_SamplesAvailable); this._device.Frequency = this._frequency; this._gui.ConfigureGUI(); this._gui.ConfigureDevice(); }
public void Close() { if (this._device == null) return; this._device.Stop(); this._device.SamplesAvailable -= new SamplesAvailableDelegate(this.sdriqDevice_SamplesAvailable); this._device.Dispose(); this._device = (SdrIqDevice) null; }