1 #ifndef __SDR_RTLSOURCE_HH__
2 #define __SDR_RTLSOURCE_HH__
55 inline double gain()
const {
return rtlsdr_get_tuner_gain(
_device); }
97 #endif // __SDR_RTLSOURCE_HH__
double frequency() const
Returns the tuner frequency.
Definition: rtlsource.hh:34
std::vector< double > _gains
A vector of gain factors supported by the device.
Definition: rtlsource.hh:85
static size_t numDevices()
Returns the number of compatible devices found.
Definition: rtlsource.cc:123
double _sample_rate
The current sample rate.
Definition: rtlsource.hh:81
double gain() const
Returns the tuner gain.
Definition: rtlsource.hh:55
void enableAGC(bool enable)
Enable/Disable AGC.
Definition: rtlsource.cc:92
Definition: autocast.hh:8
double _frequency
The current tuner frequency.
Definition: rtlsource.hh:79
void start()
Starts the reception.
Definition: rtlsource.cc:107
Implements a uint_8 I/Q source for RTL2832 based TV dongles.
Definition: rtlsource.hh:16
Generic source class.
Definition: node.hh:213
void stop()
Stops the reception.
Definition: rtlsource.cc:112
void setFrequency(double frequency)
(Re-) Sets the tuner frequency.
Definition: rtlsource.cc:66
void setGain(double gain)
(Re-) Sets the tuner gain.
Definition: rtlsource.cc:99
pthread_t _thread
The thread object.
Definition: rtlsource.hh:91
static std::string deviceName(size_t idx)
Returns the name of the specified device.
Definition: rtlsource.cc:128
double freqCorrection() const
Returns the frequency correction in parts per million (ppm).
Definition: rtlsource.hh:39
static void * __rtl_sdr_parallel_main(void *ctx)
Parallel routine to receive some data from the device.
Definition: rtlsource.cc:134
static void __rtl_sdr_callback(unsigned char *buffer, uint32_t len, void *ctx)
Callback to process received data.
Definition: rtlsource.cc:142
void setFreqCorrection(double ppm)
(Re-) Sets the frequency correction in ppm.
Definition: rtlsource.cc:73
const std::vector< double > & gainFactors() const
Retunrs a vector of supported gain factors.
Definition: rtlsource.hh:59
void setSampleRate(double sample_rate)
(Re-) sets the sample rate.
Definition: rtlsource.cc:78
rtlsdr_dev_t * _device
The RTL2832 device object.
Definition: rtlsource.hh:89
double sampleRate() const
Returns the sample rate.
Definition: rtlsource.hh:44
RTLSource(double frequency, double sample_rate=1e6, size_t device_idx=0)
Constructor.
Definition: rtlsource.cc:7
virtual ~RTLSource()
Destructor.
Definition: rtlsource.cc:60
bool agcEnabled() const
Returns true if AGC is enabled.
Definition: rtlsource.hh:50
size_t _buffer_size
The buffer size.
Definition: rtlsource.hh:87
bool _agc_enabled
If true, the AGC is enabled.
Definition: rtlsource.hh:83