libcyberradio  22.01.24
DUCSink Class Reference

DUC sink class. More...

#include <DUCSink.h>

Inheritance diagram for DUCSink:
Debuggable

Public Member Functions

 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. More...
 
 ~DUCSink ()
 Destroys a DUCSink object.
 
std::string get_radio_host_name () const
 Gets the radio host name. More...
 
int get_radio_tcp_port () const
 Gets the radio TCP port. More...
 
std::vector< std::string > get_tengig_iface_list () const
 Gets the 10GigE interface list for the radio. More...
 
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. More...
 
float get_iq_scale_factor () const
 Gets the I/Q scale factor used for the radio. More...
 
void set_iq_scale_factor (float iq_scale_factor)
 Sets the I/Q scale factor used for the radio. More...
 
int get_duc_channel () const
 Gets the channel number for the DUC in use. More...
 
void set_duc_channel (int duc_channel)
 Sets the channel number for the DUC in use. More...
 
std::string get_duc_iface_string () const
 Gets the interface name for the DUC in use. More...
 
int get_duc_iface_index () const
 Gets the interface index (one-based) for the DUC in use. More...
 
void set_duc_iface_string (const std::string &duc_iface_string)
 Sets the interface name for the DUC in use. More...
 
int get_duc_rate_index () const
 Gets the rate index (zero-based) for the DUC in use. More...
 
void set_duc_rate_index (int duc_rate_index)
 Sets the rate index (zero-based) for the DUC in use. More...
 
long get_duc_frequency () const
 Gets the frequency offset for the DUC in use. More...
 
void set_duc_frequency (long duc_frequency)
 Sets the frequency offset for the DUC in use. More...
 
void set_duc_txinv_mode (int duc_txinv_mode)
 Sets the TX inversion mode for the DUC in use. More...
 
float get_duc_attenuation () const
 Gets the attenuation for the DUC in use. More...
 
void set_duc_attenuation (float duc_attenuation)
 Sets the attenuation for the DUC in use. More...
 
unsigned int get_duc_tx_channels () const
 Gets the transmit channel mask for the DUC in use. More...
 
void set_duc_tx_channels (unsigned int duc_tx_channels)
 Sets the transmit channel mask for the DUC in use. More...
 
double get_duc_tx_frequency () const
 Gets the transmit center frequency (in MHz) for the DUC in use. More...
 
void set_duc_tx_frequency (double duc_tx_frequency)
 Sets the transmit center frequency (in MHz) for the DUC in use. More...
 
unsigned int get_duc_tx_attenuation () const
 Gets the transmit attenuation (in dB) for the DUC in use. More...
 
void set_duc_tx_attenuation (unsigned int duc_tx_attenuation)
 Sets the transmit attenuation (in dB) for the DUC in use. More...
 
unsigned int get_duc_stream_id () const
 Gets the VITA stream ID for the DUC. More...
 
void set_duc_stream_id (unsigned int duc_stream_id)
 Sets the VITA stream ID for the DUC. More...
 
long get_duc_sample_rate () const
 Gets the sample rate (in Hz) for the DUC in use, based on the rate index. More...
 
bool start ()
 Starts the sink.
 
bool stop ()
 Stops the sink.
 
int sendFrames (int noutput_items, std::complex< float > *input_items)
 Sends a number of VITA 49 frames. More...
 
virtual void setDebugName (const std::string &debug_name)
 Sets the debug name for this object. More...
 
virtual void setDebugFile (FILE *debug_fp)
 Sets the debug file pointer for this object. More...
 
virtual void setDebugTimeFormat (const std::string &debug_timefmt)
 Sets the debug time format for this object. More...
 
virtual int debug (const char *format,...)
 Outputs debug information. More...
 
virtual const char * debugBool (bool x)
 Gets a debug output string for a Boolean value. More...
 
virtual bool isDebug () const
 Gets whether this object produces debug output. More...
 
virtual std::string getDebugName () const
 Gets the debug name for this object. More...
 
virtual std::string rawString (const std::string &data)
 Gets a "raw" string representation of a given data string. More...
 

Detailed Description

DUC sink class.

Definition at line 39 of file DUCSink.h.

Constructor & Destructor Documentation

◆ DUCSink()

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.

Parameters
nameName to give to this object for debug purposes.
radio_host_nameThe radio host name. If this is an empty string, then the block will not connect to a radio.
radio_tcp_portThe radio TCP port.
tengig_iface_indexThe 10GigE interface index.
iq_scale_factorScale factor for converting I/Q data from complex input to native sample format.
duc_channelThe channel number for the DUC in use.
duc_iface_stringThe interface string for the DUC in use.
duc_rate_indexThe rate index for the DUC in use.
duc_frequencyThe frequency offset for the DUC in use.
duc_attenuationThe attenuation for the DUC in use.
duc_tx_channelsThe transmit channel mask for the DUC in use.
duc_tx_frequencyThe transmit center frequency for the DUC in use.
duc_tx_attenuationThe transmit attenuation for the DUC in use.
duc_stream_idThe stream ID/UDP port for the DUC in use.
config_txWhether or not to configure the transmitter.
debugWhether the block should produce debug output. Defaults to False.
fc_update_rateNumber of updates to make per second.
use_udpWhether or not to use UDP.
use_ring_bufferWhether or not to use a ring buffer.
duchsPfThresh
duchsPeThresh
duchsPeriod
updatePE
txinv_mode

Definition at line 27 of file DUCSink.cpp.

Member Function Documentation

◆ debug()

int debug ( const char *  format,
  ... 
)
virtualinherited

Outputs debug information.

This method follows the same semantics as printf(). Output is preceded by a timestamp and the name of the object, if provided.

Parameters
formatThe printf()-style format string.
...Comma-separated list of arguments to print. Note that these need to be arguments that can be supported natively through printf().
Returns
The number of characters outputted.

Definition at line 95 of file Debuggable.cpp.

◆ debugBool()

const char * debugBool ( bool  x)
virtualinherited

Gets a debug output string for a Boolean value.

Parameters
xBoolean value
Returns
A constant string, either "true" or "false".

Definition at line 126 of file Debuggable.cpp.

◆ get_duc_attenuation()

float get_duc_attenuation ( ) const

Gets the attenuation for the DUC in use.

Returns
The attenuation.

Definition at line 190 of file DUCSink.cpp.

◆ get_duc_channel()

int get_duc_channel ( ) const

Gets the channel number for the DUC in use.

Returns
The channel number.

Definition at line 129 of file DUCSink.cpp.

◆ get_duc_frequency()

long get_duc_frequency ( ) const

Gets the frequency offset for the DUC in use.

Returns
The frequency offset.

Definition at line 171 of file DUCSink.cpp.

◆ get_duc_iface_index()

int get_duc_iface_index ( ) const

Gets the interface index (one-based) for the DUC in use.

Returns
The interface index.

Definition at line 146 of file DUCSink.cpp.

◆ get_duc_iface_string()

std::string get_duc_iface_string ( ) const

Gets the interface name for the DUC in use.

Returns
The interface name.

Definition at line 141 of file DUCSink.cpp.

◆ get_duc_rate_index()

int get_duc_rate_index ( ) const

Gets the rate index (zero-based) for the DUC in use.

Returns
The rate index.

Definition at line 159 of file DUCSink.cpp.

◆ get_duc_sample_rate()

long get_duc_sample_rate ( ) const

Gets the sample rate (in Hz) for the DUC in use, based on the rate index.

Returns
The sample rate.

Definition at line 250 of file DUCSink.cpp.

◆ get_duc_stream_id()

unsigned int get_duc_stream_id ( ) const

Gets the VITA stream ID for the DUC.

Returns
The stream ID.

Definition at line 238 of file DUCSink.cpp.

◆ get_duc_tx_attenuation()

unsigned int get_duc_tx_attenuation ( ) const

Gets the transmit attenuation (in dB) for the DUC in use.

Returns
The transmit attenuation.

Definition at line 226 of file DUCSink.cpp.

◆ get_duc_tx_channels()

unsigned int get_duc_tx_channels ( ) const

Gets the transmit channel mask for the DUC in use.

Returns
The transmit channel mask.

Definition at line 202 of file DUCSink.cpp.

◆ get_duc_tx_frequency()

double get_duc_tx_frequency ( ) const

Gets the transmit center frequency (in MHz) for the DUC in use.

Returns
The transmit center frequency.

Definition at line 214 of file DUCSink.cpp.

◆ get_iq_scale_factor()

float get_iq_scale_factor ( ) const

Gets the I/Q scale factor used for the radio.

Returns
The scale factor.

Definition at line 119 of file DUCSink.cpp.

◆ get_radio_host_name()

std::string get_radio_host_name ( ) const

Gets the radio host name.

Returns
The radio host name.

Definition at line 104 of file DUCSink.cpp.

◆ get_radio_tcp_port()

int get_radio_tcp_port ( ) const

Gets the radio TCP port.

Returns
The port number.

Definition at line 109 of file DUCSink.cpp.

◆ get_tengig_iface_list()

std::vector< std::string > get_tengig_iface_list ( ) const

Gets the 10GigE interface list for the radio.

Returns
The interface list.

Definition at line 114 of file DUCSink.cpp.

◆ getDebugName()

std::string getDebugName ( ) const
virtualinherited

Gets the debug name for this object.

Returns
The debug name, as a string.

Definition at line 138 of file Debuggable.cpp.

◆ isDebug()

bool isDebug ( ) const
virtualinherited

Gets whether this object produces debug output.

Returns
True if producing debug, false otherwise.

Definition at line 133 of file Debuggable.cpp.

◆ rawString()

std::string rawString ( const std::string &  data)
virtualinherited

Gets a "raw" string representation of a given data string.

"Raw" string representations mimic Python string representations. Whitespace characters are denoted by backslash representations ("\\r", "\\n", "\\t", "\\v", "\\f"), while other non-printable characters are represented with hex representation ("\\x00", etc.)

Parameters
dataData string
Returns
The data's "raw" representation.

Definition at line 143 of file Debuggable.cpp.

◆ sendFrames()

int sendFrames ( int  noutput_items,
std::complex< float > *  input_items 
)

Sends a number of VITA 49 frames.

Parameters
noutput_itemsNumber of VITA 49 frames to send.
input_itemsPointer to an array of complex samples. This buffer must have enough samples to fill the number of VITA frames requested.
Returns
The number of VITA frames actually sent.

Definition at line 298 of file DUCSink.cpp.

◆ set_duc_attenuation()

void set_duc_attenuation ( float  duc_attenuation)

Sets the attenuation for the DUC in use.

Parameters
duc_attenuationThe attenuation for the DUC in use.

Definition at line 195 of file DUCSink.cpp.

◆ set_duc_channel()

void set_duc_channel ( int  duc_channel)

Sets the channel number for the DUC in use.

Parameters
duc_channelThe channel number for the DUC in use.

Definition at line 134 of file DUCSink.cpp.

◆ set_duc_frequency()

void set_duc_frequency ( long  duc_frequency)

Sets the frequency offset for the DUC in use.

Parameters
duc_frequencyThe frequency offset for the DUC in use.

Definition at line 176 of file DUCSink.cpp.

◆ set_duc_iface_string()

void set_duc_iface_string ( const std::string &  duc_iface_string)

Sets the interface name for the DUC in use.

Parameters
duc_iface_stringThe interface string for the DUC in use.

Definition at line 151 of file DUCSink.cpp.

◆ set_duc_rate_index()

void set_duc_rate_index ( int  duc_rate_index)

Sets the rate index (zero-based) for the DUC in use.

Parameters
duc_rate_indexThe rate index for the DUC in use.

Definition at line 164 of file DUCSink.cpp.

◆ set_duc_stream_id()

void set_duc_stream_id ( unsigned int  duc_stream_id)

Sets the VITA stream ID for the DUC.

Parameters
duc_stream_idThe stream ID.

Definition at line 243 of file DUCSink.cpp.

◆ set_duc_tx_attenuation()

void set_duc_tx_attenuation ( unsigned int  duc_tx_attenuation)

Sets the transmit attenuation (in dB) for the DUC in use.

Parameters
duc_tx_attenuationThe transmit attenuation for the DUC in use.

Definition at line 231 of file DUCSink.cpp.

◆ set_duc_tx_channels()

void set_duc_tx_channels ( unsigned int  duc_tx_channels)

Sets the transmit channel mask for the DUC in use.

Parameters
duc_tx_channelsThe transmit channel mask for the DUC in use.

Definition at line 207 of file DUCSink.cpp.

◆ set_duc_tx_frequency()

void set_duc_tx_frequency ( double  duc_tx_frequency)

Sets the transmit center frequency (in MHz) for the DUC in use.

Parameters
duc_tx_frequencyThe transmit center frequency for the DUC in use.

Definition at line 219 of file DUCSink.cpp.

◆ set_duc_txinv_mode()

void set_duc_txinv_mode ( int  duc_txinv_mode)

Sets the TX inversion mode for the DUC in use.

Parameters
duc_txinv_mode1 to enable tx inversion, 0 to disable.

Definition at line 183 of file DUCSink.cpp.

◆ set_iq_scale_factor()

void set_iq_scale_factor ( float  iq_scale_factor)

Sets the I/Q scale factor used for the radio.

Parameters
iq_scale_factorThe scale factor.

Definition at line 124 of file DUCSink.cpp.

◆ set_radio_params()

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.

Parameters
radio_host_nameThe radio host name.
radio_tcp_portThe port number.
tengig_iface_listThe 10GigE interface list.

Definition at line 342 of file DUCSink.cpp.

◆ setDebugFile()

void setDebugFile ( FILE *  debug_fp)
virtualinherited

Sets the debug file pointer for this object.

Parameters
debug_fpFile to send debug output to.

Definition at line 81 of file Debuggable.cpp.

◆ setDebugName()

void setDebugName ( const std::string &  debug_name)
virtualinherited

Sets the debug name for this object.

Use this method to set unique debug names for objects of the same class for easy differentiation.

Parameters
debug_nameName for identifying this object in debug output.

Definition at line 74 of file Debuggable.cpp.

◆ setDebugTimeFormat()

void setDebugTimeFormat ( const std::string &  debug_timefmt)
virtualinherited

Sets the debug time format for this object.

Parameters
debug_timefmtFormat string for displaying timestamp, as compatible with strftime(). If this is an empty string, don't display a timestamp.

Definition at line 88 of file Debuggable.cpp.


The documentation for this class was generated from the following files: