22 #ifndef INCLUDED_RTLSDR_SOURCE_C_H
23 #define INCLUDED_RTLSDR_SOURCE_C_H
25 #include <gnuradio/sync_block.h>
27 #include <gnuradio/thread/thread.h>
30 #include <condition_variable>
48 typedef std::shared_ptr<rtl_source_c> rtl_source_c_sptr;
65 public gr::sync_block,
82 int work(
int noutput_items,
83 gr_vector_const_void_star &input_items,
84 gr_vector_void_star &output_items );
106 double set_gain(
double gain,
const std::string & name,
size_t chan = 0 );
108 double get_gain(
const std::string & name,
size_t chan = 0 );
113 std::string
set_antenna(
const std::string & antenna,
size_t chan = 0 );
121 static void _rtlsdr_callback(
unsigned char *buf, uint32_t len,
void *ctx);
122 void rtlsdr_callback(
unsigned char *buf, uint32_t len);
126 std::vector<float> _lut;
129 gr::thread::thread _thread;
130 unsigned char **_buf;
131 unsigned int _buf_num;
132 unsigned int _buf_len;
133 unsigned int _buf_head;
134 unsigned int _buf_used;
135 std::mutex _buf_mutex;
136 std::condition_variable _buf_cond;
139 unsigned int _buf_offset;
145 unsigned int _skipped;
Provides a stream of complex samples.
Definition: rtl_source_c.h:67
osmosdr::freq_range_t get_freq_range(size_t chan=0)
static std::vector< std::string > get_devices()
double set_gain(double gain, size_t chan=0)
osmosdr::gain_range_t get_gain_range(size_t chan=0)
double get_center_freq(size_t chan=0)
osmosdr::meta_range_t get_sample_rates(void)
double set_gain(double gain, const std::string &name, size_t chan=0)
double get_sample_rate(void)
double get_gain(const std::string &name, size_t chan=0)
osmosdr::gain_range_t get_gain_range(const std::string &name, size_t chan=0)
bool set_gain_mode(bool automatic, size_t chan=0)
std::string get_antenna(size_t chan=0)
double get_gain(size_t chan=0)
double set_sample_rate(double rate)
double get_freq_corr(size_t chan=0)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
double set_if_gain(double gain, size_t chan=0)
double set_center_freq(double freq, size_t chan=0)
std::vector< std::string > get_gain_names(size_t chan=0)
friend rtl_source_c_sptr make_rtl_source_c(const std::string &args)
Return a shared_ptr to a new instance of rtl_source_c.
std::string set_antenna(const std::string &antenna, size_t chan=0)
std::vector< std::string > get_antennas(size_t chan=0)
bool get_gain_mode(size_t chan=0)
double set_freq_corr(double ppm, size_t chan=0)
size_t get_num_channels(void)
Definition: source_iface.h:33
struct rtlsdr_dev rtlsdr_dev_t
Definition: rtl_source_c.h:35
rtl_source_c_sptr make_rtl_source_c(const std::string &args="")
Return a shared_ptr to a new instance of rtl_source_c.