libcyberradio  22.01.24
TransmitPacketizer Class Reference

Transmit packetizer class. More...

#include <TransmitPacketizer.h>

Inheritance diagram for TransmitPacketizer:
Debuggable

Public Member Functions

 TransmitPacketizer (const std::string &radioHostName="", int radioTcpPort=8617, unsigned int ducChannel=1, const std::string &ifname="eth0", unsigned int tenGigIndex=1, int dipIndex=-1, unsigned int ducRate=0, unsigned int ducTxChannels=0, float ducFreq=900e6, float ducAtten=0, double txFreq=900, float txAtten=0, unsigned int streamId=40001, bool config_tx=false, bool debug=false)
 Constructs a TransmitPacketizer object. More...
 
virtual ~TransmitPacketizer ()
 Destroys a TransmitPacketizer object.
 
bool setRadioHostName (const std::string &radioHostName)
 Sets the radio host name. More...
 
bool setRadioTcpPort (int radioTcpPort)
 Sets the radio TCP port. More...
 
bool setDucChannel (unsigned int ducChannel)
 Sets the DUC channel number. More...
 
bool setDucInterface (const std::string &ifname, unsigned int tenGigIndex)
 Sets the DUC interface parameters. More...
 
bool setDucRate (unsigned int ducRate)
 Sets the DUC rate index. More...
 
bool setDucTxChannels (unsigned int ducTxChannels)
 Sets the DUC transmit channel bitmap. More...
 
bool setDucFreq (float ducFreq)
 Sets the DUC frequency. More...
 
bool setDucTxinvMode (unsigned int txinvMode)
 Sets the DUC TX Inversion Mode. More...
 
bool setDucAtten (float ducAtten)
 Sets the DUC attenuation. More...
 
bool setTxFreq (double txFreq)
 Sets the transmitter frequency. More...
 
bool setTxAtten (float txAtten)
 Sets the transmitter attenuation. More...
 
bool setStreamId (unsigned int streamId)
 Sets the stream ID. More...
 
bool setDebug (bool debug)
 Sets whether or not to produce debug output. More...
 
bool setRadioParameters (const std::string &radioHostName, int radioTcpPort)
 Sets the radio parameters. More...
 
bool setDucParameters (unsigned int tenGigIndex, unsigned int ducRate, unsigned int ducTxChannels, float ducFreq, float ducAtten, double txFreq, float txAtten, unsigned int streamId)
 Sets the DUC parameters. More...
 
void start ()
 Starts the packetizer.
 
void stop ()
 Stops the packetizer.
 
unsigned int sendFrame (short *samples)
 Sends a number of samples as a VITA 49 frame. More...
 
bool isConnected (void)
 Gets whether or not the packetizer is connected. More...
 
bool isReadyToReceive (void)
 Gets whether or not the packetizer is ready to receive data. 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

Transmit packetizer class.

Definition at line 37 of file TransmitPacketizer.h.

Constructor & Destructor Documentation

◆ TransmitPacketizer()

TransmitPacketizer ( const std::string &  radioHostName = "",
int  radioTcpPort = 8617,
unsigned int  ducChannel = 1,
const std::string &  ifname = "eth0",
unsigned int  tenGigIndex = 1,
int  dipIndex = -1,
unsigned int  ducRate = 0,
unsigned int  ducTxChannels = 0,
float  ducFreq = 900e6,
float  ducAtten = 0,
double  txFreq = 900,
float  txAtten = 0,
unsigned int  streamId = 40001,
bool  config_tx = false,
bool  debug = false 
)

Constructs a TransmitPacketizer object.

Parameters
radioHostNameRadio host name
radioTcpPortRadio TCP port number
ducChannelDUC channel number
ifnameEthernet interface name for the 10GigE interface to use
tenGigIndex10GigE interface index
dipIndex
ducRateDUC rate index
ducTxChannelsBitmap of transmitters the DUC will use
ducFreqDUC frequency (Hz)
ducAttenDUC attenuation (dB)
txFreqTransmitter frequency (Hz)
txAttenTransmitter attenuation (dB)
streamIdStream ID
config_txWhether or not to configure the transmitter
debugWhether or not to produce debug output

Definition at line 57 of file TransmitPacketizer.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.

◆ 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.

◆ isConnected()

bool isConnected ( void  )

Gets whether or not the packetizer is connected.

Returns
True if the packetizer is connected, false otherwise.

Definition at line 536 of file TransmitPacketizer.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.

◆ isReadyToReceive()

bool isReadyToReceive ( void  )

Gets whether or not the packetizer is ready to receive data.

Returns
True if the packetizer is ready, false otherwise.

Definition at line 542 of file TransmitPacketizer.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.

◆ sendFrame()

unsigned int sendFrame ( short *  samples)

Sends a number of samples as a VITA 49 frame.

Parameters
samplesBuffer of samples. This buffer must be twice the number of samples in a VITA 49 frame payload.
Returns
The number of samples actually sent.

Definition at line 501 of file TransmitPacketizer.cpp.

◆ setDebug()

bool setDebug ( bool  debug)

Sets whether or not to produce debug output.

Parameters
debugWhether or not to produce debug output
Returns
True if the action succeeds, false otherwise.

Definition at line 349 of file TransmitPacketizer.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.

◆ setDucAtten()

bool setDucAtten ( float  ducAtten)

Sets the DUC attenuation.

Parameters
ducAttenDUC attenuation (dB)
Returns
True if the action succeeds, false otherwise.

Definition at line 254 of file TransmitPacketizer.cpp.

◆ setDucChannel()

bool setDucChannel ( unsigned int  ducChannel)

Sets the DUC channel number.

Parameters
ducChannelDUC channel number
Returns
True if the action succeeds, false otherwise.

Definition at line 150 of file TransmitPacketizer.cpp.

◆ setDucFreq()

bool setDucFreq ( float  ducFreq)

Sets the DUC frequency.

Parameters
ducFreqDUC frequency (Hz)
Returns
True if the action succeeds, false otherwise.

Definition at line 228 of file TransmitPacketizer.cpp.

◆ setDucInterface()

bool setDucInterface ( const std::string &  ifname,
unsigned int  tenGigIndex 
)

Sets the DUC interface parameters.

Parameters
ifnameEthernet interface name for the 10GigE interface to use
tenGigIndex10GigE interface index
Returns
True if the action succeeds, false otherwise.

Definition at line 172 of file TransmitPacketizer.cpp.

◆ setDucParameters()

bool setDucParameters ( unsigned int  tenGigIndex,
unsigned int  ducRate,
unsigned int  ducTxChannels,
float  ducFreq,
float  ducAtten,
double  txFreq,
float  txAtten,
unsigned int  streamId 
)

Sets the DUC parameters.

Parameters
tenGigIndex10GigE interface index
ducRateDUC rate index
ducTxChannelsBitmap of transmitters the DUC will use
ducFreqDUC frequency (Hz)
ducAttenDUC attenuation (dB)
txFreqTransmitter frequency (Hz)
txAttenTransmitter attenuation (dB)
streamIdStream ID
Returns
True if the action succeeds, false otherwise.

Definition at line 403 of file TransmitPacketizer.cpp.

◆ setDucRate()

bool setDucRate ( unsigned int  ducRate)

Sets the DUC rate index.

Parameters
ducRateDUC rate index
Returns
True if the action succeeds, false otherwise.

Definition at line 202 of file TransmitPacketizer.cpp.

◆ setDucTxChannels()

bool setDucTxChannels ( unsigned int  ducTxChannels)

Sets the DUC transmit channel bitmap.

Parameters
ducTxChannelsBitmap of transmitters the DUC will use
Returns
True if the action succeeds, false otherwise.

Definition at line 215 of file TransmitPacketizer.cpp.

◆ setDucTxinvMode()

bool setDucTxinvMode ( unsigned int  txinvMode)

Sets the DUC TX Inversion Mode.

Parameters
txinvModeTX Inversion Mode (0=normal, 1=inverted)
Returns
True if the action succeeds, false otherwise.

Definition at line 241 of file TransmitPacketizer.cpp.

◆ setRadioHostName()

bool setRadioHostName ( const std::string &  radioHostName)

Sets the radio host name.

Parameters
radioHostNameRadio host name
Returns
True if the action succeeds, false otherwise.

Definition at line 140 of file TransmitPacketizer.cpp.

◆ setRadioParameters()

bool setRadioParameters ( const std::string &  radioHostName,
int  radioTcpPort 
)

Sets the radio parameters.

Parameters
radioHostNameRadio host name
radioTcpPortRadio TCP port number
Returns
True if the action succeeds, false otherwise.

Definition at line 355 of file TransmitPacketizer.cpp.

◆ setRadioTcpPort()

bool setRadioTcpPort ( int  radioTcpPort)

Sets the radio TCP port.

Parameters
radioTcpPortRadio TCP port number
Returns
True if the action succeeds, false otherwise.

Definition at line 145 of file TransmitPacketizer.cpp.

◆ setStreamId()

bool setStreamId ( unsigned int  streamId)

Sets the stream ID.

Parameters
streamIdStream ID
Returns
True if the action succeeds, false otherwise.

Definition at line 334 of file TransmitPacketizer.cpp.

◆ setTxAtten()

bool setTxAtten ( float  txAtten)

Sets the transmitter attenuation.

Parameters
txAttenTransmitter attenuation (dB)
Returns
True if the action succeeds, false otherwise.

Definition at line 321 of file TransmitPacketizer.cpp.

◆ setTxFreq()

bool setTxFreq ( double  txFreq)

Sets the transmitter frequency.

Parameters
txFreqTransmitter frequency (Hz)
Returns
True if the action succeeds, false otherwise.

Definition at line 299 of file TransmitPacketizer.cpp.


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