12 #ifndef INCLUDED_LIBCYBERRADIO_NDR651_DUC_SINK_H 13 #define INCLUDED_LIBCYBERRADIO_NDR651_DUC_SINK_H 15 #include "LibCyberRadio/Common/Debuggable.h" 16 #include "LibCyberRadio/NDR651/TransmitPacketizer.h" 19 #include <sys/types.h> 74 const std::string& name =
"DUCSink",
76 const std::string& radio_host_name =
"",
77 unsigned int radio_tcp_port = 8617,
78 unsigned int tengig_iface_index = 1,
79 float iq_scale_factor = 1.0,
81 unsigned int duc_channel = 1,
82 const std::string& duc_iface_string =
"eth0",
83 unsigned int duc_rate_index = 0,
84 long duc_frequency = 0,
85 float duc_attenuation = 0,
86 unsigned int duc_tx_channels = 0,
87 double duc_tx_frequency = 900,
88 unsigned int duc_tx_attenuation = 0,
89 unsigned int duc_stream_id = 40001,
90 bool config_tx =
false,
92 unsigned int fc_update_rate = 20,
94 bool use_ring_buffer =
false,
95 unsigned int duchsPfThresh = 25,
96 unsigned int duchsPeThresh = 24,
97 unsigned int duchsPeriod = 10,
98 bool updatePE =
false,
127 const std::vector<std::string>& tengig_iface_list);
260 void set_duchs_pf_threshold(
unsigned int duchsPfThresh);
261 void set_duchs_pe_threshold(
unsigned int duchsPeThresh);
262 void set_duchs_period(
unsigned int duchsPeriod);
263 void set_duchs_update_pe(
bool updatePE);
282 std::complex<float>* input_items);
287 void set_duc_iface_index_from_string();
291 std::string d_radio_host_name;
292 unsigned int d_radio_tcp_port;
293 std::vector<std::string> d_tengig_iface_list;
294 float d_iq_scale_factor;
295 unsigned int d_duc_channel;
296 std::string d_duc_iface_string;
297 unsigned int d_duc_iface_index;
298 unsigned int d_duc_rate_index;
299 long d_duc_frequency;
300 float d_duc_attenuation;
301 unsigned int d_duc_tx_channels;
302 double d_duc_tx_frequency;
303 unsigned int d_duc_tx_attenuation;
304 unsigned int d_duc_stream_id;
305 int d_duc_txinv_mode;
307 unsigned int d_fc_update_rate;
309 bool d_use_ring_buffer;
311 short d_sample_buffer[SAMPLES_PER_FRAME * 2];
312 unsigned int d_duchsPfThresh, d_duchsPeThresh, d_duchsPeriod;
float get_iq_scale_factor() const
Gets the I/Q scale factor used for the radio.
~DUCSink()
Destroys a DUCSink object.
void set_duc_tx_frequency(double duc_tx_frequency)
Sets the transmit center frequency (in MHz) for the DUC in use.
void set_iq_scale_factor(float iq_scale_factor)
Sets the I/Q scale factor used for the radio.
void set_duc_attenuation(float duc_attenuation)
Sets the attenuation for the DUC in use.
void set_duc_tx_attenuation(unsigned int duc_tx_attenuation)
Sets the transmit attenuation (in dB) for the DUC in use.
void set_duc_frequency(long duc_frequency)
Sets the frequency offset for the DUC in use.
unsigned int get_duc_tx_attenuation() const
Gets the transmit attenuation (in dB) for the DUC in use.
Transmit packetizer class.
DUCSink(const std::string &name="DUCSink", const std::string &radio_host_name="", unsigned int radio_tcp_port=8617, unsigned int tengig_iface_index=1, float iq_scale_factor=1.0, unsigned int duc_channel=1, const std::string &duc_iface_string="eth0", unsigned int duc_rate_index=0, long duc_frequency=0, float duc_attenuation=0, unsigned int duc_tx_channels=0, double duc_tx_frequency=900, unsigned int duc_tx_attenuation=0, unsigned int duc_stream_id=40001, bool config_tx=false, bool debug=false, unsigned int fc_update_rate=20, bool use_udp=false, bool use_ring_buffer=false, unsigned int duchsPfThresh=25, unsigned int duchsPeThresh=24, unsigned int duchsPeriod=10, bool updatePE=false, int txinv_mode=0)
Creates a DUCSink object.
Class that supports debug output.
void set_duc_tx_channels(unsigned int duc_tx_channels)
Sets the transmit channel mask for the DUC in use.
int get_duc_rate_index() const
Gets the rate index (zero-based) for the DUC in use.
int get_duc_iface_index() const
Gets the interface index (one-based) for the DUC in use.
unsigned int get_duc_stream_id() const
Gets the VITA stream ID for the DUC.
void set_duc_txinv_mode(int duc_txinv_mode)
Sets the TX inversion mode for the DUC in use.
std::vector< std::string > get_tengig_iface_list() const
Gets the 10GigE interface list for the radio.
virtual int debug(const char *format,...)
Outputs debug information.
unsigned int get_duc_tx_channels() const
Gets the transmit channel mask for the DUC in use.
void set_duc_channel(int duc_channel)
Sets the channel number for the DUC in use.
int get_duc_channel() const
Gets the channel number for the DUC in use.
Defines functionality for LibCyberRadio applications.
float get_duc_attenuation() const
Gets the attenuation for the DUC in use.
std::string get_duc_iface_string() const
Gets the interface name for the DUC in use.
std::string get_radio_host_name() const
Gets the radio host name.
int sendFrames(int noutput_items, std::complex< float > *input_items)
Sends a number of VITA 49 frames.
void set_radio_params(const std::string &radio_host_name, int radio_tcp_port, const std::vector< std::string > &tengig_iface_list)
Sets the radio parameters.
long get_duc_sample_rate() const
Gets the sample rate (in Hz) for the DUC in use, based on the rate index.
bool stop()
Stops the sink.
void set_duc_iface_string(const std::string &duc_iface_string)
Sets the interface name for the DUC in use.
void set_duc_stream_id(unsigned int duc_stream_id)
Sets the VITA stream ID for the DUC.
long get_duc_frequency() const
Gets the frequency offset for the DUC in use.
double get_duc_tx_frequency() const
Gets the transmit center frequency (in MHz) for the DUC in use.
int get_radio_tcp_port() const
Gets the radio TCP port.
bool start()
Starts the sink.
void set_duc_rate_index(int duc_rate_index)
Sets the rate index (zero-based) for the DUC in use.