22 #ifndef INCLUDED_RTLSDR_SOURCE_C_H
23 #define INCLUDED_RTLSDR_SOURCE_C_H
25 #include <gr_sync_block.h>
27 #include <gruel/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;
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 );
116 static void _rtlsdr_callback(
unsigned char *buf, uint32_t len,
void *ctx);
117 void rtlsdr_callback(
unsigned char *buf, uint32_t len);
121 std::vector<gr_complex> _lut;
124 gruel::thread _thread;
125 unsigned short **_buf;
126 unsigned int _buf_num;
127 unsigned int _buf_len;
128 unsigned int _buf_head;
129 unsigned int _buf_used;
130 boost::mutex _buf_mutex;
131 boost::condition_variable _buf_cond;
134 unsigned int _buf_offset;
140 unsigned int _skipped;