27 #ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H 28 #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H 31 #include <boost/array.hpp> 32 #include <boost/asio.hpp> 33 #include <boost/circular_buffer.hpp> 34 #include <boost/thread/condition.hpp> 35 #include <boost/thread/mutex.hpp> 36 #include <gnuradio/sync_block.h> 40 #if GNURADIO_USES_STD_POINTERS 43 #include <boost/shared_ptr.hpp> 48 #if GNURADIO_USES_STD_POINTERS 49 using rtl_tcp_signal_source_c_sptr = std::shared_ptr<rtl_tcp_signal_source_c>;
51 using rtl_tcp_signal_source_c_sptr = boost::shared_ptr<rtl_tcp_signal_source_c>;
54 #if USE_BOOST_ASIO_IO_CONTEXT 55 using b_io_context = boost::asio::io_context;
57 using b_io_context = boost::asio::io_service;
60 rtl_tcp_signal_source_c_sptr
61 rtl_tcp_make_signal_source_c(
const std::string &address,
63 bool flip_iq =
false);
74 int work(
int noutput_items,
75 gr_vector_const_void_star &input_items,
76 gr_vector_void_star &output_items);
78 void set_frequency(
int frequency);
79 void set_sample_rate(
int sample_rate);
80 void set_agc_mode(
bool agc);
81 void set_gain(
int gain);
82 void set_if_gain(
int gain);
85 friend rtl_tcp_signal_source_c_sptr
86 rtl_tcp_make_signal_source_c(
const std::string &address,
95 void handle_read(
const boost::system::error_code &ec,
96 size_t bytes_transferred);
98 inline bool not_full()
const 100 return unread_ < buffer_.capacity();
103 inline bool not_empty()
const 105 return unread_ > 0 || io_context_.stopped();
108 boost::circular_buffer_space_optimized<float> buffer_;
111 boost::condition not_full_;
112 boost::condition not_empty_;
115 boost::array<float, 0xff> lookup_{};
118 b_io_context io_context_;
119 boost::asio::ip::tcp::socket socket_;
120 std::vector<unsigned char> data_;
127 #endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H Interface for a structure sent by rtl_tcp defining the hardware.
This class represents the dongle information which is sent by rtl_tcp.
This class reads interleaved I/Q samples from an rtl_tcp server and outputs complex types...