SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDa::RadioTX Class Referenceabstract

#include <RadioTX.hxx>

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

Public Member Functions

 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 ()

Protected Member Functions

virtual bool transmitSwitch (bool tx_on)=0
 most transmit chains will require multiple stages to enable the transmitter.
virtual bool put (CBufPtr buf)=0
 The TX hardware unit doesn't do much at all.
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)
virtual RadioTXPtr getSelfPtr ()=0
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 ()

Protected Attributes

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

Private Member Functions

void run ()
 RadioTX run loop: handle commands, and modulate the tx carrier.
virtual void subscribeToMailBoxes (const std::vector< MailBoxBasePtr > &mailboxes) final
 SoDa Threads must subscribe to at least the control mailbox.
virtual void init ()
 Some initialization must occurr after all the components are created.
void execGetCommand (CommandPtr cmd)
 execute GET commands from the command channel
void execSetCommand (CommandPtr cmd)
 handle SET commands from the command channel
void execRepCommand (CommandPtr cmd)
 handle Report commands from the command channel
void setCWFreq (bool usb, double freq)
 set the CW tone frequency to generate an IQ stream
void doCW (CBufPtr out, FBufPtr envelope)
 given a keying envelope, impose it on the CW tone

Private Attributes

CDatMBox::Subscription tx_subs
 subscription handle for transmit audio stream (from BaseBandTX)
CmdMBox::Subscription cmd_subs
 subscription handle for command stream
FDatMBox::Subscription cw_subs
 subscription handle for cw envelope stream (from CW unit)
CDatMBoxPtr tx_stream
 transmit audio stream
FDatMBoxPtr cw_env_stream
 envelope stream from text-to-CW converter (CW unit)
CmdMBoxPtr cmd_stream
 command stream
double CW_tone_freq
QuadratureOscillator CW_osc
 CW tone IQ oscillator.
FBufPtr beacon_env
 steady constant amplitude envelope
FBufPtr zero_env
 zero amplitude envelope
CBufPtr cw_buf
 working buffer for CW output
bool beacon_mode
 if true, we're transmitting a steady carrier
Command::ModulationType tx_modulation
 current modulation mode
double tx_sample_rate
 sample rate for buffer going to USRP (UHD)
unsigned int tx_buffer_size
 size of buffer going to USRP
float cw_env_amplitude
 used to set CW output envelope, constant at 0.7
bool waiting_to_run_dry
 When set, we should send out a report when we run out of CW buffer.

Additional Inherited Members

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 ()
Static Public Attributes inherited from SoDa::Debug
static std::mutex debug_msg_mutex
Static Protected Attributes inherited from SoDa::Debug
static unsigned int default_debug_level
static unsigned int global_debug_level

Detailed Description

Definition at line 59 of file RadioTX.hxx.

Constructor & Destructor Documentation

◆ RadioTX()

SoDa::RadioTX::RadioTX ( ParamsPtr params,
const std::string & name )

Constructor for RF Transmit/modulator process.

Parameters
paramsblock describing intial setup of the radio
namethe name of this TX block (typcally indicates radio type)

Referenced by SoDa::RTLSDRTX::RTLSDRTX().

Member Function Documentation

◆ doCW()

void SoDa::RadioTX::doCW ( CBufPtr out,
FBufPtr envelope )
private

given a keying envelope, impose it on the CW tone

Parameters
outthe output IQ buffer, CW_osc amplitude modulated by the envelope parameter
envelopefloat array of keyed waveform amplitudes

◆ execGetCommand()

void SoDa::RadioTX::execGetCommand ( CommandPtr cmd)
privatevirtual

execute GET commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ execRepCommand()

void SoDa::RadioTX::execRepCommand ( CommandPtr cmd)
privatevirtual

handle Report commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ execSetCommand()

void SoDa::RadioTX::execSetCommand ( CommandPtr cmd)
privatevirtual

handle SET commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ getSelfPtr()

virtual RadioTXPtr SoDa::RadioTX::getSelfPtr ( )
protectedpure virtual

Implemented in SoDa::PlutoTX, SoDa::RTLSDRTX, and SoDa::USRPTX.

◆ init()

virtual void SoDa::RadioTX::init ( )
inlineprivatevirtual

Some initialization must occurr after all the components are created.

Units may optionally implement this method to do that.

Reimplemented in SoDa::PlutoTX, SoDa::RTLSDRTX, and SoDa::USRPTX.

Definition at line 89 of file RadioTX.hxx.

◆ put()

virtual bool SoDa::RadioTX::put ( CBufPtr buf)
protectedpure virtual

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

Get bits, Put bits. This is (or may be) a blocking call.

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

Implemented in SoDa::PlutoTX, SoDa::RTLSDRTX, and SoDa::USRPTX.

◆ run()

void SoDa::RadioTX::run ( )
privatevirtual

RadioTX run loop: handle commands, and modulate the tx carrier.

Reimplemented from SoDa::Thread.

◆ setCWFreq()

void SoDa::RadioTX::setCWFreq ( bool usb,
double freq )
private

set the CW tone frequency to generate an IQ stream

Parameters
usbif true, put the tone above the nominal carrier
freqfrequency of the CW tone (offset from zero beat)

◆ subExecCommand()

virtual void SoDa::RadioTX::subExecCommand ( CommandPtr cmd)
inlineprotectedvirtual

Some hardware radio modules might want to watch or publish to the command mailbox.

They may, but shouldn't;

Definition at line 123 of file RadioTX.hxx.

◆ subExecGetCommand()

virtual void SoDa::RadioTX::subExecGetCommand ( CommandPtr cmd)
inlineprotectedvirtual

Definition at line 124 of file RadioTX.hxx.

◆ subExecRepCommand()

virtual void SoDa::RadioTX::subExecRepCommand ( CommandPtr cmd)
inlineprotectedvirtual

Definition at line 126 of file RadioTX.hxx.

◆ subExecSetCommand()

virtual void SoDa::RadioTX::subExecSetCommand ( CommandPtr cmd)
inlineprotectedvirtual

Definition at line 125 of file RadioTX.hxx.

◆ subscribeToMailBoxes()

virtual void SoDa::RadioTX::subscribeToMailBoxes ( const std::vector< MailBoxBasePtr > & mailboxes)
finalprivatevirtual

SoDa Threads must subscribe to at least the control mailbox.

Parameters
mailboxesa list of all defined mailboxes. Choose your subscriptions.

Implements SoDa::Thread.

◆ transmitSwitch()

virtual bool SoDa::RadioTX::transmitSwitch ( bool tx_on)
protectedpure 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.

Implemented in SoDa::PlutoTX, SoDa::RTLSDRTX, and SoDa::USRPTX.

Member Data Documentation

◆ beacon_env

FBufPtr SoDa::RadioTX::beacon_env
private

steady constant amplitude envelope

Definition at line 182 of file RadioTX.hxx.

◆ beacon_mode

bool SoDa::RadioTX::beacon_mode
private

if true, we're transmitting a steady carrier

Definition at line 185 of file RadioTX.hxx.

◆ cmd_stream

CmdMBoxPtr SoDa::RadioTX::cmd_stream
private

command stream

Definition at line 176 of file RadioTX.hxx.

◆ cmd_subs

CmdMBox::Subscription SoDa::RadioTX::cmd_subs
private

subscription handle for command stream

Definition at line 171 of file RadioTX.hxx.

◆ cw_buf

CBufPtr SoDa::RadioTX::cw_buf
private

working buffer for CW output

Definition at line 184 of file RadioTX.hxx.

◆ cw_env_amplitude

float SoDa::RadioTX::cw_env_amplitude
private

used to set CW output envelope, constant at 0.7

Definition at line 191 of file RadioTX.hxx.

◆ cw_env_stream

FDatMBoxPtr SoDa::RadioTX::cw_env_stream
private

envelope stream from text-to-CW converter (CW unit)

Definition at line 175 of file RadioTX.hxx.

◆ CW_osc

QuadratureOscillator SoDa::RadioTX::CW_osc
private

CW tone IQ oscillator.

Definition at line 180 of file RadioTX.hxx.

◆ cw_subs

FDatMBox::Subscription SoDa::RadioTX::cw_subs
private

subscription handle for cw envelope stream (from CW unit)

Definition at line 172 of file RadioTX.hxx.

◆ CW_tone_freq

double SoDa::RadioTX::CW_tone_freq
private

Definition at line 179 of file RadioTX.hxx.

◆ tx_buffer_size

unsigned int SoDa::RadioTX::tx_buffer_size
private

size of buffer going to USRP

Definition at line 190 of file RadioTX.hxx.

◆ tx_enabled

bool SoDa::RadioTX::tx_enabled
protected

if true, we're transmitting.

Definition at line 130 of file RadioTX.hxx.

◆ tx_modulation

Command::ModulationType SoDa::RadioTX::tx_modulation
private

current modulation mode

Definition at line 187 of file RadioTX.hxx.

◆ tx_sample_rate

double SoDa::RadioTX::tx_sample_rate
private

sample rate for buffer going to USRP (UHD)

Definition at line 189 of file RadioTX.hxx.

◆ tx_stream

CDatMBoxPtr SoDa::RadioTX::tx_stream
private

transmit audio stream

Definition at line 174 of file RadioTX.hxx.

◆ tx_subs

CDatMBox::Subscription SoDa::RadioTX::tx_subs
private

subscription handle for transmit audio stream (from BaseBandTX)

Definition at line 170 of file RadioTX.hxx.

◆ waiting_to_run_dry

bool SoDa::RadioTX::waiting_to_run_dry
private

When set, we should send out a report when we run out of CW buffer.

Definition at line 193 of file RadioTX.hxx.

◆ zero_buf

CBufPtr SoDa::RadioTX::zero_buf
protected

envelope for dead silence.

Definition at line 132 of file RadioTX.hxx.

◆ zero_env

FBufPtr SoDa::RadioTX::zero_env
private

zero amplitude envelope

Definition at line 183 of file RadioTX.hxx.


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