24 #ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H 25 #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H 29 #include <boost/array.hpp> 30 #include <boost/asio.hpp> 31 #include <boost/circular_buffer.hpp> 32 #include <boost/thread/condition.hpp> 33 #include <boost/thread/mutex.hpp> 34 #include <gnuradio/sync_block.h> 48 using rtl_tcp_signal_source_c_sptr = gnss_shared_ptr<rtl_tcp_signal_source_c>;
50 #if USE_BOOST_ASIO_IO_CONTEXT 51 using b_io_context = boost::asio::io_context;
53 using b_io_context = boost::asio::io_service;
56 rtl_tcp_signal_source_c_sptr
57 rtl_tcp_make_signal_source_c(
const std::string &address,
59 bool flip_iq =
false);
70 int work(
int noutput_items,
71 gr_vector_const_void_star &input_items,
72 gr_vector_void_star &output_items);
74 void set_frequency(
int frequency);
75 void set_sample_rate(
int sample_rate);
76 void set_agc_mode(
bool agc);
77 void set_gain(
int gain);
78 void set_if_gain(
int gain);
81 friend rtl_tcp_signal_source_c_sptr
82 rtl_tcp_make_signal_source_c(
const std::string &address,
91 void handle_read(
const boost::system::error_code &ec,
92 size_t bytes_transferred);
94 inline bool not_full()
const 96 return unread_ < buffer_.capacity();
99 inline bool not_empty()
const 101 return unread_ > 0 || io_context_.stopped();
104 boost::circular_buffer_space_optimized<float> buffer_;
107 boost::condition not_full_;
108 boost::condition not_empty_;
111 boost::array<float, 0xff> lookup_{};
114 b_io_context io_context_;
115 boost::asio::ip::tcp::socket socket_;
116 std::vector<unsigned char> data_;
126 #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 interface represents a GNSS block.
This class reads interleaved I/Q samples from an rtl_tcp server and outputs complex types...