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

#include <IFRecorder.hxx>

Inheritance diagram for SoDa::IFRecorder:
SoDa::Thread SoDa::Base SoDa::Debug

Public Member Functions

void subscribeToMailBoxes (const std::vector< MailBoxBasePtr > &mailboxes)
 implement the subscription method
void run ()
 the run method – does the work of the audio receiver 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 IFRecorderPtr make (ParamsPtr params)
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

 IFRecorder (ParamsPtr params)
 the constructor
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 Member Functions

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 openOutStream (char *ofile_name)
 open an output stream to receive the RF samples
void closeOutStream ()
 close the current output stream

Private Attributes

unsigned int rf_buffer_size
 size of input RF buffer chunk
double rf_sample_rate
 sample rate of RF input from USRP – assumed 625KHz
double current_rx_center_freq
CDatMBoxPtr rx_stream
 mailbox producing rx sample stream from USRP
CmdMBoxPtr cmd_stream
 mailbox producing command stream from user
CDatMBox::Subscription rx_subs
 mailbox subscription ID for rx data stream
CmdMBox::Subscription cmd_subs
 mailbox subscription ID for command stream
std::ofstream ostr
 raw (binary) output stream.
bool write_stream_on
 when true, write each incoming buffer to the output stream.

Additional Inherited Members

Static Public Attributes inherited from SoDa::Debug
static std::mutex debug_msg_mutex
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

Definition at line 71 of file IFRecorder.hxx.

Constructor & Destructor Documentation

◆ IFRecorder()

SoDa::IFRecorder::IFRecorder ( ParamsPtr params)
protected

the constructor

Parameters
paramscommand line parameter object

Referenced by make().

Member Function Documentation

◆ closeOutStream()

void SoDa::IFRecorder::closeOutStream ( )
private

close the current output stream

◆ execGetCommand()

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

execute GET commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ execRepCommand()

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

handle Report commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ execSetCommand()

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

handle SET commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ make()

IFRecorderPtr SoDa::IFRecorder::make ( ParamsPtr params)
inlinestatic

Definition at line 81 of file IFRecorder.hxx.

References IFRecorder().

◆ openOutStream()

void SoDa::IFRecorder::openOutStream ( char * ofile_name)
private

open an output stream to receive the RF samples

Parameters
ofile_namename of the output file to be created.

◆ run()

void SoDa::IFRecorder::run ( )
virtual

the run method – does the work of the audio receiver process

Reimplemented from SoDa::Thread.

◆ subscribeToMailBoxes()

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

implement the subscription method

Implements SoDa::Thread.

Member Data Documentation

◆ cmd_stream

CmdMBoxPtr SoDa::IFRecorder::cmd_stream
private

mailbox producing command stream from user

Definition at line 130 of file IFRecorder.hxx.

◆ cmd_subs

CmdMBox::Subscription SoDa::IFRecorder::cmd_subs
private

mailbox subscription ID for command stream

Definition at line 132 of file IFRecorder.hxx.

◆ current_rx_center_freq

double SoDa::IFRecorder::current_rx_center_freq
private

Definition at line 127 of file IFRecorder.hxx.

◆ ostr

std::ofstream SoDa::IFRecorder::ostr
private

raw (binary) output stream.

Definition at line 134 of file IFRecorder.hxx.

◆ rf_buffer_size

unsigned int SoDa::IFRecorder::rf_buffer_size
private

size of input RF buffer chunk

Definition at line 124 of file IFRecorder.hxx.

◆ rf_sample_rate

double SoDa::IFRecorder::rf_sample_rate
private

sample rate of RF input from USRP – assumed 625KHz

Definition at line 125 of file IFRecorder.hxx.

◆ rx_stream

CDatMBoxPtr SoDa::IFRecorder::rx_stream
private

mailbox producing rx sample stream from USRP

Definition at line 129 of file IFRecorder.hxx.

◆ rx_subs

CDatMBox::Subscription SoDa::IFRecorder::rx_subs
private

mailbox subscription ID for rx data stream

Definition at line 131 of file IFRecorder.hxx.

◆ write_stream_on

bool SoDa::IFRecorder::write_stream_on
private

when true, write each incoming buffer to the output stream.

Definition at line 135 of file IFRecorder.hxx.


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