|
libSDRForge
|
Acquire unsigned 8-bit interleaved IQ through librtlsdr. More...
Public Member Functions | |
| None | __init__ (self, int device_index=0, int block_bytes=DEFAULT_BLOCK_BYTES, Any|None library=None, str acquisition_mode="auto", int queue_blocks=32, int|None usb_fd=None) |
| Initialize the instance. | |
| None | open (self) |
| Load librtlsdr and open the selected RTL-SDR device. | |
| None | close (self) |
| Release the device even if asynchronous acquisition already failed. | |
| bool | is_connected (self) |
| Return whether the connected. | |
| SdrCapabilities | get_capabilities (self) |
| Return the capabilities. | |
| None | set_center_frequency (self, int frequency_hz) |
| Set the center frequency. | |
| int | get_center_frequency (self) |
| Return the center frequency. | |
| None | set_sample_rate (self, int sample_rate_hz) |
| Set the sample rate. | |
| int | get_sample_rate (self) |
| Return the sample rate. | |
| None | set_gain (self, float|None gain_db) |
| Set the gain. | |
| dict[str, int|float|None] | get_hardware_configuration (self) |
| Read librtlsdr's reported settings, independently of Python caches. | |
| None | set_rtl_agc (self, bool enabled) |
| Configure RTL2832 digital AGC independently of tuner gain. | |
| None | set_ppm_correction (self, int ppm) |
| Set RTL-SDR oscillator correction before acquisition. | |
| None | start (self) |
| Start the component. | |
| None | stop (self) |
| Stop the async worker; tolerate cancel failure after USB disconnect. | |
| dict[str, int|float] | get_acquisition_stats (self) |
| Return the acquisition stats. | |
| IqBlock | read_iq (self) |
| Read iq. | |
Static Public Attributes | |
| int | DEFAULT_SAMPLE_RATE_HZ = 2_400_000 |
| int | DEFAULT_BLOCK_BYTES = 262_144 |
| int | MIN_FREQUENCY_HZ = 24_000_000 |
| int | MAX_FREQUENCY_HZ = 1_766_000_000 |
Protected Member Functions | |
| bool | _use_async (self, Any library) |
| None | _on_iq (self, Any buffer, int length, ctypes.c_void_p _context) |
| None | _run_async (self) |
| tuple[ctypes.c_void_p, Any] | _require_device (self) |
Static Protected Member Functions | |
| None | _check (int result, str operation) |
| ctypes.CDLL | _load_library () |
| None | _configure_library (Any library) |
Protected Attributes | |
| str | _acquisition_mode = acquisition_mode |
| queue.Queue[IqBlock] | _queue = queue.Queue(maxsize=queue_blocks) |
| threading.Thread|None | _worker = None |
| Any | _callback = None |
| str|None | _worker_error = None |
| int | _dropped_blocks = 0 |
| int | _received_blocks = 0 |
| int|None | _first_callback_ns = None |
| int|None | _previous_callback_ns = None |
| int | _callback_gap_max_ns = 0 |
| int | _callback_gap_over_2x = 0 |
| int | _callback_gap_over_4x = 0 |
| int | _queue_high_water = 0 |
| int | _startup_gap_max_ns = 0 |
| int | _startup_gap_over_2x = 0 |
| _usb_fd = usb_fd | |
| _device_index = device_index | |
| _block_bytes = block_bytes | |
| _library = library | |
| _device = ctypes.c_void_p() | |
| int | _center_frequency_hz = 0 |
| int | _sample_rate_hz = self.DEFAULT_SAMPLE_RATE_HZ |
| float|None | _gain_db = None |
| bool | _rtl_agc_enabled = False |
| int | _ppm_correction = 0 |
| bool | _running = False |
Acquire unsigned 8-bit interleaved IQ through librtlsdr.
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.__init__ | ( | self, | |
| int | device_index = 0, | ||
| int | block_bytes = DEFAULT_BLOCK_BYTES, | ||
| Any | None | library = None, | ||
| str | acquisition_mode = "auto", | ||
| int | queue_blocks = 32, | ||
| int | None | usb_fd = None ) |
Initialize the instance.
| self | The current instance. |
| device_index | The device_index value. |
| block_bytes | The block_bytes value. |
| library | The library value. |
| acquisition_mode | The acquisition_mode value. |
| queue_blocks | The queue_blocks value. |
| usb_fd | The usb_fd value. |
|
staticprotected |
|
staticprotected |
Declare the librtlsdr ABI when using a real ctypes library.
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.close | ( | self | ) |
Release the device even if asynchronous acquisition already failed.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| dict[str, int | float] sdrforge.adapters.rtl_sdr.RtlSdrSource.get_acquisition_stats | ( | self | ) |
Return the acquisition stats.
| self | The current instance. |
| SdrCapabilities sdrforge.adapters.rtl_sdr.RtlSdrSource.get_capabilities | ( | self | ) |
Return the capabilities.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| int sdrforge.adapters.rtl_sdr.RtlSdrSource.get_center_frequency | ( | self | ) |
Return the center frequency.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| dict[str, int | float | None] sdrforge.adapters.rtl_sdr.RtlSdrSource.get_hardware_configuration | ( | self | ) |
Read librtlsdr's reported settings, independently of Python caches.
A successful readback confirms driver state, not physical tuner PLL lock. Missing optional librtlsdr symbols are reported as null.
| self | The current instance. |
| int sdrforge.adapters.rtl_sdr.RtlSdrSource.get_sample_rate | ( | self | ) |
Return the sample rate.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| bool sdrforge.adapters.rtl_sdr.RtlSdrSource.is_connected | ( | self | ) |
Return whether the connected.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.open | ( | self | ) |
Load librtlsdr and open the selected RTL-SDR device.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| IqBlock sdrforge.adapters.rtl_sdr.RtlSdrSource.read_iq | ( | self | ) |
Read iq.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.set_center_frequency | ( | self, | |
| int | frequency_hz ) |
Set the center frequency.
| self | The current instance. |
| frequency_hz | The frequency in hertz. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.set_gain | ( | self, | |
| float | None | gain_db ) |
Set the gain.
| self | The current instance. |
| gain_db | The tuner gain in decibels, or None for automatic gain. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.set_ppm_correction | ( | self, | |
| int | ppm ) |
Set RTL-SDR oscillator correction before acquisition.
| self | The current instance. |
| ppm | The ppm value. |
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.set_rtl_agc | ( | self, | |
| bool | enabled ) |
Configure RTL2832 digital AGC independently of tuner gain.
| self | The current instance. |
| enabled | The enabled value. |
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.set_sample_rate | ( | self, | |
| int | sample_rate_hz ) |
Set the sample rate.
| self | The current instance. |
| sample_rate_hz | The sample rate in hertz. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.start | ( | self | ) |
Start the component.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
| None sdrforge.adapters.rtl_sdr.RtlSdrSource.stop | ( | self | ) |
Stop the async worker; tolerate cancel failure after USB disconnect.
| self | The current instance. |
Reimplemented from sdrforge.interfaces.sdr_source_if.SdrSourceIf.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |