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> 28 #include <boost/thread/mutex.hpp> 29 #include <boost/thread/condition_variable.hpp> 47 typedef boost::shared_ptr<rtl_source_c> rtl_source_c_sptr;
64 public gr::sync_block,
81 int work(
int noutput_items,
82 gr_vector_const_void_star &input_items,
83 gr_vector_void_star &output_items );
104 double set_gain(
double gain,
size_t chan = 0 );
105 double set_gain(
double gain,
const std::string & name,
size_t chan = 0 );
107 double get_gain(
const std::string & name,
size_t chan = 0 );
109 double set_if_gain(
double gain,
size_t chan = 0 );
111 std::vector< std::string >
get_antennas(
size_t chan = 0 );
112 std::string
set_antenna(
const std::string & antenna,
size_t chan = 0 );
120 static void _rtlsdr_callback(
unsigned char *buf, uint32_t len,
void *ctx);
121 void rtlsdr_callback(
unsigned char *buf, uint32_t len);
125 std::vector<gr_complex> _lut;
128 gr::thread::thread _thread;
129 unsigned short **_buf;
130 unsigned int _buf_num;
131 unsigned int _buf_len;
132 unsigned int _buf_head;
133 unsigned int _buf_used;
134 boost::mutex _buf_mutex;
135 boost::condition_variable _buf_cond;
138 unsigned int _buf_offset;
144 unsigned int _skipped;
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition: source_iface.h:31
Provides a stream of complex samples.
Definition: rtl_source_c.h:63
double set_gain(double gain, size_t chan=0)
double set_sample_rate(double rate)
static std::vector< std::string > get_devices()
double set_center_freq(double freq, size_t chan=0)
std::vector< std::string > get_gain_names(size_t chan=0)
osmosdr::gain_range_t get_gain_range(size_t chan=0)
bool get_gain_mode(size_t chan=0)
bool set_gain_mode(bool automatic, size_t chan=0)
size_t get_num_channels(void)
double set_if_gain(double gain, size_t chan=0)
std::string set_antenna(const std::string &antenna, size_t chan=0)
std::vector< std::string > get_antennas(size_t chan=0)
double get_sample_rate(void)
double get_freq_corr(size_t chan=0)
rtl_source_c_sptr make_rtl_source_c(const std::string &args="")
Return a shared_ptr to a new instance of rtl_source_c.
osmosdr::meta_range_t get_sample_rates(void)
double set_freq_corr(double ppm, size_t chan=0)
std::string get_antenna(size_t chan=0)
double get_center_freq(size_t chan=0)
osmosdr::freq_range_t get_freq_range(size_t chan=0)
double get_gain(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.
struct rtlsdr_dev rtlsdr_dev_t
Definition: rtl_source_c.h:34