20 #ifndef INCLUDED_OSMOSDR_SRC_C_H 21 #define INCLUDED_OSMOSDR_SRC_C_H 23 #include <gnuradio/sync_block.h> 25 #include <gnuradio/thread/thread.h> 26 #include <boost/thread/mutex.hpp> 27 #include <boost/thread/condition_variable.hpp> 45 typedef boost::shared_ptr<osmosdr_src_c> osmosdr_src_c_sptr;
63 public gr::sync_block,
80 int work(
int noutput_items,
81 gr_vector_const_void_star &input_items,
82 gr_vector_void_star &output_items );
103 double set_gain(
double gain,
size_t chan = 0 );
104 double set_gain(
double gain,
const std::string & name,
size_t chan = 0 );
106 double get_gain(
const std::string & name,
size_t chan = 0 );
108 double set_if_gain(
double gain,
size_t chan = 0 );
110 std::vector< std::string >
get_antennas(
size_t chan = 0 );
111 std::string
set_antenna(
const std::string & antenna,
size_t chan = 0 );
115 static void _osmosdr_callback(
unsigned char *buf, uint32_t len,
void *ctx);
116 void osmosdr_callback(
unsigned char *buf, uint32_t len);
121 gr::thread::thread _thread;
122 unsigned short **_buf;
123 unsigned int _buf_num;
124 unsigned int _buf_len;
125 unsigned int _buf_head;
126 unsigned int _buf_used;
127 boost::mutex _buf_mutex;
128 boost::condition_variable _buf_cond;
131 unsigned int _buf_offset;
136 unsigned int _skipped;
double set_sample_rate(double rate)
double set_gain(double gain, size_t chan=0)
osmosdr_src_c_sptr osmosdr_make_src_c(const std::string &args="")
Return a shared_ptr to a new instance of osmosdr_src_c.
double set_if_gain(double gain, size_t chan=0)
Definition: source_iface.h:31
size_t get_num_channels(void)
double get_center_freq(size_t chan=0)
double get_freq_corr(size_t chan=0)
std::vector< std::string > get_gain_names(size_t chan=0)
double get_gain(size_t chan=0)
osmosdr::freq_range_t get_freq_range(size_t chan=0)
struct osmosdr_dev osmosdr_dev_t
Definition: osmosdr_src_c.h:32
double get_sample_rate(void)
bool get_gain_mode(size_t chan=0)
static std::vector< std::string > get_devices()
bool set_gain_mode(bool automatic, size_t chan=0)
double set_freq_corr(double ppm, size_t chan=0)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Provides a stream of complex samples.
Definition: osmosdr_src_c.h:62
double set_center_freq(double freq, size_t chan=0)
osmosdr::gain_range_t get_gain_range(size_t chan=0)
std::string get_antenna(size_t chan=0)
osmosdr::meta_range_t get_sample_rates(void)
friend osmosdr_src_c_sptr osmosdr_make_src_c(const std::string &args)
Return a shared_ptr to a new instance of osmosdr_src_c.
std::vector< std::string > get_antennas(size_t chan=0)
std::string set_antenna(const std::string &antenna, size_t chan=0)