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

#include <RadioRX.hxx>

Inheritance diagram for SoDa::RadioRX:
SoDa::Thread SoDa::Base SoDa::Debug SoDa::PlutoRX SoDa::RTLSDRRX SoDa::USRPRX

Public Member Functions

 RadioRX (ParamsPtr params)
 Constructor Build a RadioRX thread.
void run () final
 start the thread
virtual void init ()
 perform initialization.
virtual void setNCOFreq (double freq)=0
 Methods that ALL radios must implement.
virtual bool downConvert ()=0
 A receiver must accept input data from the rx_stream and beat it against its NCO to produce output on its if_stream.
virtual void startStream ()=0
 flush the input rx data stream and set the stream_processing flag to on.
virtual void stopStream ()=0
 flush the input rx data stream and set the stream_processing flag to off
virtual bool streamEnabled ()=0
 test the processing stream flag
virtual void enableIFStreamer (bool enable)=0
 Enable IF streamer - This passes the incoming RF sample buffer onto the IF stream where it can be consumed by the periodogram widget or anybody else.
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 void execGetCommand (CommandPtr cmd) final
 Parse an incoming GET command and dispatch.
virtual void execSetCommand (CommandPtr cmd) final
 Parse an incoming SET command and dispatch.
virtual void execRepCommand (CommandPtr cmd) final
 Parse an incoming REPort command and dispatch.
double getTime ()
 get the number of seconds since the "Epoch"
virtual void subscribeToMailBoxes (const std::vector< MailBoxBasePtr > &mailboxes) final
 SoDa Threads must subscribe to at least the control mailbox.
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

ParamsPtr params
CDatMBoxPtr rx_stream
CDatMBoxPtr if_stream
CmdMBoxPtr cmd_stream
CmdMBox::Subscription cmd_subs
double current_IF_tuning
 current IF NCO frequency
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

virtual void subExecCommand (CommandPtr cmd)
 Methods that a radio MAY implement (see above)
virtual void subExecGetCommand (CommandPtr cmd)
virtual void subExecSetCommand (CommandPtr cmd)
virtual void subExecRepCommand (CommandPtr cmd)

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 67 of file RadioRX.hxx.

Constructor & Destructor Documentation

◆ RadioRX()

SoDa::RadioRX::RadioRX ( ParamsPtr params)

Constructor Build a RadioRX thread.

Parameters
paramsPointer to a parameter object with all the initial settings and identification for the attached USRP

References params.

Member Function Documentation

◆ downConvert()

virtual bool SoDa::RadioRX::downConvert ( )
pure virtual

A receiver must accept input data from the rx_stream and beat it against its NCO to produce output on its if_stream.

If the stream_processing flag is off, any rx_input data will be dumped.

Returns
true if the receiver had input data ready to convert, false otherwise.

Implemented in SoDa::PlutoRX, SoDa::RTLSDRRX, and SoDa::USRPRX.

◆ enableIFStreamer()

virtual void SoDa::RadioRX::enableIFStreamer ( bool enable)
pure virtual

Enable IF streamer - This passes the incoming RF sample buffer onto the IF stream where it can be consumed by the periodogram widget or anybody else.

Parameters
enableif true, send RF sample buffer onto if_stream, otherwise, don't.

Implemented in SoDa::PlutoRX, SoDa::RTLSDRRX, and SoDa::USRPRX.

◆ execGetCommand()

virtual void SoDa::RadioRX::execGetCommand ( CommandPtr cmd)
finalprotectedvirtual

Parse an incoming GET command and dispatch.

If a subclass needs to handle any command type, it should declare its own subExecCommand method.

Parameters
cmda command record

Reimplemented from SoDa::Thread.

◆ execRepCommand()

virtual void SoDa::RadioRX::execRepCommand ( CommandPtr cmd)
finalprotectedvirtual

Parse an incoming REPort command and dispatch.

If a subclass needs to handle any command type, it should declare its own subExecRepCommand method.

Parameters
cmda command record

Reimplemented from SoDa::Thread.

◆ execSetCommand()

virtual void SoDa::RadioRX::execSetCommand ( CommandPtr cmd)
finalprotectedvirtual

Parse an incoming SET command and dispatch.

If a subclass needs to handle any command type, it should declare its own subExecSetCommand method.

Parameters
cmda command record

Reimplemented from SoDa::Thread.

◆ getTime()

double SoDa::RadioRX::getTime ( )
protected

get the number of seconds since the "Epoch"

Returns
relative time in seconds

◆ init()

virtual void SoDa::RadioRX::init ( )
inlinevirtual

perform initialization.

Not all modules need to implement this.

Reimplemented in SoDa::RTLSDRRX.

Definition at line 88 of file RadioRX.hxx.

References init().

Referenced by init().

◆ run()

void SoDa::RadioRX::run ( )
finalvirtual

start the thread

If a subclass needs to perform its own work, it should declare an auxRun method.

Reimplemented from SoDa::Thread.

◆ setNCOFreq()

virtual void SoDa::RadioRX::setNCOFreq ( double freq)
pure virtual

Methods that ALL radios must implement.

Set the last LO (convert to baseband) frequency for the NCO.

This is called in response to a RX_NCO_FREQ message from the RadioControl thread.

Parameters
freqLO3 frequency its front-end frequency so that it can adjust its own oscillator.

Implemented in SoDa::PlutoRX, SoDa::RTLSDRRX, and SoDa::USRPRX.

◆ startStream()

virtual void SoDa::RadioRX::startStream ( )
pure virtual

flush the input rx data stream and set the stream_processing flag to on.

Implemented in SoDa::PlutoRX, SoDa::RTLSDRRX, and SoDa::USRPRX.

◆ stopStream()

virtual void SoDa::RadioRX::stopStream ( )
pure virtual

flush the input rx data stream and set the stream_processing flag to off

Implemented in SoDa::PlutoRX, SoDa::RTLSDRRX, and SoDa::USRPRX.

◆ streamEnabled()

virtual bool SoDa::RadioRX::streamEnabled ( )
pure virtual

test the processing stream flag

Returns
true if rx data should be down converted

Implemented in SoDa::PlutoRX, SoDa::RTLSDRRX, and SoDa::USRPRX.

◆ subExecCommand()

virtual void SoDa::RadioRX::subExecCommand ( CommandPtr cmd)
inlineprivatevirtual

Methods that a radio MAY implement (see above)

Definition at line 141 of file RadioRX.hxx.

◆ subExecGetCommand()

virtual void SoDa::RadioRX::subExecGetCommand ( CommandPtr cmd)
inlineprivatevirtual

Definition at line 142 of file RadioRX.hxx.

◆ subExecRepCommand()

virtual void SoDa::RadioRX::subExecRepCommand ( CommandPtr cmd)
inlineprivatevirtual

Definition at line 144 of file RadioRX.hxx.

◆ subExecSetCommand()

virtual void SoDa::RadioRX::subExecSetCommand ( CommandPtr cmd)
inlineprivatevirtual

Definition at line 143 of file RadioRX.hxx.

◆ subscribeToMailBoxes()

virtual void SoDa::RadioRX::subscribeToMailBoxes ( const std::vector< MailBoxBasePtr > & mailboxes)
finalprotectedvirtual

SoDa Threads must subscribe to at least the control mailbox.

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

Implements SoDa::Thread.

Member Data Documentation

◆ cmd_stream

CmdMBoxPtr SoDa::RadioRX::cmd_stream
protected

Definition at line 197 of file RadioRX.hxx.

◆ cmd_subs

CmdMBox::Subscription SoDa::RadioRX::cmd_subs
protected

Definition at line 198 of file RadioRX.hxx.

◆ current_IF_tuning

double SoDa::RadioRX::current_IF_tuning
protected

current IF NCO frequency

Definition at line 200 of file RadioRX.hxx.

◆ if_stream

CDatMBoxPtr SoDa::RadioRX::if_stream
protected

Definition at line 196 of file RadioRX.hxx.

◆ params

◆ rx_stream

CDatMBoxPtr SoDa::RadioRX::rx_stream
protected

Definition at line 195 of file RadioRX.hxx.


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