12 #ifndef INCLUDED_CYBERRADIO_VITA_IQ_SOURCE_2_IMPL_H 13 #define INCLUDED_CYBERRADIO_VITA_IQ_SOURCE_2_IMPL_H 16 #include <LibCyberRadio/Common/Vita49Packet.h> 17 #include <boost/asio.hpp> 18 #include <boost/format.hpp> 19 #include <boost/thread.hpp> 22 #include <sys/types.h> 29 namespace CyberRadio {
34 size_t vitaTailSize,
bool byteSwapped,
bool iqSwapped,
35 const std::string &host,
int port,
bool debug,
36 bool tagOutput,
bool coherent);
39 void connect(
const std::string &host,
int port);
48 int work(
int noutput_items, gr_vector_const_void_star &input_items,
49 gr_vector_void_star &output_items);
53 int debug(
const char *format, ...);
58 size_t d_vitaHeaderSize;
59 size_t d_vitaTailSize;
74 unsigned short d_port;
78 boost::asio::ip::udp::socket *d_socket;
79 boost::asio::ip::udp::endpoint d_endpoint;
80 boost::asio::ip::udp::endpoint d_endpoint_rcvd;
81 boost::asio::io_service d_io_service;
86 uint32_t d_frame_count;
90 gr::thread::condition_variable d_cond_wait;
91 gr::thread::mutex d_udp_mutex;
92 gr::thread::thread d_udp_thread;
95 void handle_read(
const boost::system::error_code &error,
96 size_t bytes_transferred);
97 void run_io_service() { d_io_service.run(); }
99 int _read_socket_data(
int noutput_items,
char *output_buffer);
100 int _parse_vita_and_tag(
char *output_buffer,
int number_of_packets);
void set_receive_buffer_size(int size)
Change the size of the UDP receive buffer.
vita_iq_source_2_impl(int vitaType, size_t payloadSize, size_t vitaHeaderSize, size_t vitaTailSize, bool byteSwapped, bool iqSwapped, const std::string &host, int port, bool debug, bool tagOutput, bool coherent)
void disconnect()
Cut the connection if we have one set up.
Creates a VITA 49 and/or I/Q radio data source block for GNU Radio.
Definition: vita_iq_source_2.h:55
void set_scale_factor(int)
Set the scale factor used when converting from short to float. Default is 32767.
Provides GNU Radio blocks.
Definition: NDR651_duc_sink_mk2.h:21
int get_receive_buffer_size(void)
Get the size of the UDP receive buffer.
int get_scale_factor()
Get the scale factor used when converting from short to float.
LibCyberRadio::Vita49Packet Vita49Packet
Definition: vita_iq_source_2_impl.h:26
Definition: vita_iq_source_2_impl.h:31
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
void connect(const std::string &host, int port)
Change the connection to a new destination.