SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDa::USRPTX Class Reference

The Transmit RF Path. More...

#include <USRPTX.hxx>

Inheritance diagram for SoDa::USRPTX:
SoDa::RadioTX SoDa::Thread SoDa::Base SoDa::Debug

Public Member Functions

bool transmitSwitch (bool tx_on)
 most transmit chains will require multiple stages to enable the transmitter.
void init ()
 Some initialization must occurr after all the components are created.
bool put (CBufPtr buf)
 The TX hardware unit doesn't do much at all.
RadioTXPtr getSelfPtr ()
 used for exception processing and such.
Public Member Functions inherited from SoDa::RadioTX
 RadioTX (ParamsPtr params, const std::string &name)
 Constructor for RF Transmit/modulator process.
Public Member Functions inherited from SoDa::Thread
void registerThread (SoDa::ThreadPtr me)
void operator() ()
void start ()
 Execute the thread's run loop.
void join ()
 more properly "Wait for this thread to exit its run loop".
void execCommand (CommandPtr cmd)
 Execute (dispatch) a message removed from the command stream to one of the basic Command handler functions.
virtual void shutDown ()
 optional method that performs cleanup – may not delete.
void sleep_ms (unsigned int milliseconds)
void sleep_us (unsigned int microseconds)
uint32_t getID ()
 Get the process/thread ID for this thread – helps with figuring out who caused a segfault.
Public Member Functions inherited from SoDa::Base
 Base (const std::string &oname)
 The constructor – pass a name for the object.
void registerSelf (BasePtr ptr)
std::string & getObjName ()
 get the name of this object
BasePtr findSoDaObject (const std::string &oname)
 find a SoDa Object by name.
double getTime ()
 Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS).
BasePtr getSelfPtr ()
 get a pointer to myself.
Public Member Functions inherited from SoDa::Debug
 Debug (std::string _unit_name=std::string("UNKNOWN"))
 Debug (const char *_unit_name_cstr)
 Debug (unsigned int _debug_level, std::string _unit_name=std::string("UNKNOWN"))
 Debug (unsigned int _debug_level, const char *_unit_name_cstr)
void debugMsg (const std::string &msg, unsigned int threshold=1)
void debugMsg (const SoDa::Format &fmt, unsigned int threshold=1)
void debugMsg (const char *msg, unsigned int threshold=1)
void setDebugLevel (unsigned int v)
unsigned int getDebugLevel ()

Static Public Member Functions

static USRPTXPtr make (ParamsPtr params, uhd::usrp::multi_usrp::sptr _usrp)
Static Public Member Functions inherited from SoDa::Debug
static void setDefaultLevel (unsigned int v)
static unsigned int getDefaultLevel ()
static void setGlobalLevel (unsigned int v)
static unsigned int getGlobalLevel ()

Protected Member Functions

 USRPTX (ParamsPtr params, uhd::usrp::multi_usrp::sptr _usrp)
 Constructor for RF Transmit/modulator process.
Protected Member Functions inherited from SoDa::RadioTX
virtual void subExecCommand (CommandPtr cmd)
 Some hardware radio modules might want to watch or publish to the command mailbox.
virtual void subExecGetCommand (CommandPtr cmd)
virtual void subExecSetCommand (CommandPtr cmd)
virtual void subExecRepCommand (CommandPtr cmd)
Protected Member Functions inherited from SoDa::Thread
 Thread (const std::string &oname, const std::string &version=std::string("12.2.0"))
 make the thread object.
Protected Member Functions inherited from SoDa::Debug
std::string curDateTime ()

Private Attributes

uhd::usrp::multi_usrp::sptr usrp
 the radio.
uhd::stream_args_t * stream_args
uhd::tx_streamer::sptr tx_bits
 USRP (UHD) transmit stream handle.
uhd::tx_metadata_t tx_md
 metadata describing USRP transmit buffer
std::weak_ptr< USRPTXself
bool needs_resample
SoDa::ReSamplerPtr hw_resampler
std::vector< std::complex< float > > accu
 accumulator for 625 kS/s input
std::vector< std::complex< float > > rs_in
 one resampler input block
std::vector< std::complex< float > > hw_cf
 resampler output at 2.5 MS/s
unsigned int rs_in_size
 resampler input block size (625 kS/s)
unsigned int hw_buf_size
 resampler output / UHD send size (2.5 MS/s)

Additional Inherited Members

Static Public Attributes inherited from SoDa::Debug
static std::mutex debug_msg_mutex
Protected Attributes inherited from SoDa::RadioTX
bool tx_enabled
 if true, we're transmitting.
CBufPtr zero_buf
 envelope for dead silence.
Protected Attributes inherited from SoDa::Thread
std::weak_ptr< Threadself
 A pointer to ourself.
Protected Attributes inherited from SoDa::Debug
std::string unit_name
 the name of the unit reporting status
unsigned int debug_level
 the debug level (threshold) for messages
Static Protected Attributes inherited from SoDa::Debug
static unsigned int default_debug_level
static unsigned int global_debug_level

Detailed Description

The Transmit RF Path.

In SSB/AM/FM modes, the USRPTX unit accepts an I/Q audio stream from the BaseBandTX unit and forwards it to the USRP. In CW mode, the USRPTX unit impresses a CW envelope (received from the CW unit) onto a carrier and passes this to the USRP.

Definition at line 58 of file USRPTX.hxx.

Constructor & Destructor Documentation

◆ USRPTX()

SoDa::USRPTX::USRPTX ( ParamsPtr params,
uhd::usrp::multi_usrp::sptr _usrp )
protected

Constructor for RF Transmit/modulator process.

Parameters
paramsblock describing intial setup of the radio
_usrplibuhd handle for the USRP radio

Referenced by make().

Member Function Documentation

◆ getSelfPtr()

RadioTXPtr SoDa::USRPTX::getSelfPtr ( )
inlinevirtual

used for exception processing and such.

Returns
a pointer to myself.

Implements SoDa::RadioTX.

Definition at line 113 of file USRPTX.hxx.

References self.

◆ init()

void SoDa::USRPTX::init ( )
inlinevirtual

Some initialization must occurr after all the components are created.

Units may optionally implement this method to do that.

Reimplemented from SoDa::RadioTX.

Definition at line 97 of file USRPTX.hxx.

◆ make()

USRPTXPtr SoDa::USRPTX::make ( ParamsPtr params,
uhd::usrp::multi_usrp::sptr _usrp )
inlinestatic

Definition at line 70 of file USRPTX.hxx.

References USRPTX().

◆ put()

bool SoDa::USRPTX::put ( CBufPtr buf)
virtual

The TX hardware unit doesn't do much at all.

Get bits, Put bits.

Parameters
bufa shared pointer to a buffer of complex samples. These may be enqueued or sent directly to the hardware. But put must not block.
Returns
true if the buffer was sent directly to the hardware.

Implements SoDa::RadioTX.

◆ transmitSwitch()

bool SoDa::USRPTX::transmitSwitch ( bool tx_on)
virtual

most transmit chains will require multiple stages to enable the transmitter.

– switch the antenna, turn on the power amplifier, start the modulator. Actual control of the antenna is left to the control unit. The transmitter need only provide a "transmitEnable" function that will be called after the antenna switch has flipped.

Parameters
tx_onif true, enable the transmit chain. Disable the transmitter if false.
Returns
true if the unit was in Trasnmit mode, false otherwise.

Implements SoDa::RadioTX.

Member Data Documentation

◆ accu

std::vector<std::complex<float> > SoDa::USRPTX::accu
private

accumulator for 625 kS/s input

Definition at line 127 of file USRPTX.hxx.

◆ hw_buf_size

unsigned int SoDa::USRPTX::hw_buf_size
private

resampler output / UHD send size (2.5 MS/s)

Definition at line 131 of file USRPTX.hxx.

◆ hw_cf

std::vector<std::complex<float> > SoDa::USRPTX::hw_cf
private

resampler output at 2.5 MS/s

Definition at line 129 of file USRPTX.hxx.

◆ hw_resampler

SoDa::ReSamplerPtr SoDa::USRPTX::hw_resampler
private

Definition at line 126 of file USRPTX.hxx.

◆ needs_resample

bool SoDa::USRPTX::needs_resample
private

Definition at line 125 of file USRPTX.hxx.

◆ rs_in

std::vector<std::complex<float> > SoDa::USRPTX::rs_in
private

one resampler input block

Definition at line 128 of file USRPTX.hxx.

◆ rs_in_size

unsigned int SoDa::USRPTX::rs_in_size
private

resampler input block size (625 kS/s)

Definition at line 130 of file USRPTX.hxx.

◆ self

std::weak_ptr<USRPTX> SoDa::USRPTX::self
private

Definition at line 122 of file USRPTX.hxx.

Referenced by getSelfPtr().

◆ stream_args

uhd::stream_args_t* SoDa::USRPTX::stream_args
private

Definition at line 118 of file USRPTX.hxx.

◆ tx_bits

uhd::tx_streamer::sptr SoDa::USRPTX::tx_bits
private

USRP (UHD) transmit stream handle.

Definition at line 119 of file USRPTX.hxx.

◆ tx_md

uhd::tx_metadata_t SoDa::USRPTX::tx_md
private

metadata describing USRP transmit buffer

Definition at line 120 of file USRPTX.hxx.

◆ usrp

uhd::usrp::multi_usrp::sptr SoDa::USRPTX::usrp
private

the radio.

Definition at line 116 of file USRPTX.hxx.


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