![]() |
SoDaRadio-12.2.0-cut_dependencies:6c82803
|
#include <RTLSDRRX.hxx>
Public Member Functions | |
| ~RTLSDRRX ()=default | |
| void | init () override |
| perform initialization. | |
| void | setNCOFreq (double freq) override |
| Methods that ALL radios must implement. | |
| bool | downConvert () override |
| A receiver must accept input data from the rx_stream and beat it against its NCO to produce output on its if_stream. | |
| void | startStream () override |
| flush the input rx data stream and set the stream_processing flag to on. | |
| void | stopStream () override |
| flush the input rx data stream and set the stream_processing flag to off | |
| bool | streamEnabled () override |
| test the processing stream flag | |
| void | enableIFStreamer (bool enable) override |
| 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::RadioRX | |
| RadioRX (ParamsPtr params) | |
| Constructor Build a RadioRX thread. | |
| void | run () final |
| start the thread | |
| 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 RTLSDRRXPtr | make (RTLSDRDevPtr dev_in, 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 | |
| RTLSDRRX (RTLSDRDevPtr dev_in, ParamsPtr params) | |
| Protected Member Functions inherited from SoDa::RadioRX | |
| 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 () |
Private Member Functions | |
| void | doMixer (std::vector< std::complex< float > > &buf) |
Static Private Member Functions | |
| static void | asyncCallback (unsigned char *buf, uint32_t len, void *ctx) |
Private Attributes | |
| RTLSDRDevPtr | rtl |
| unsigned int | rs_in_size |
| exact resampler input size (at 2.048 MSPS) | |
| unsigned int | rs_out_size |
| resampler output size (at 625 kSPS) | |
| unsigned int | rf_buf_size |
| publish chunk size (30000 samples at 625 kSPS) | |
| double | rx_sample_rate |
| 625 kSPS — used for IF NCO phase increment | |
| std::atomic< bool > | streaming {false} |
| bool | if_streaming_enabled |
| std::atomic< unsigned int > | diag_reads {0} |
| async callback invocations | |
| unsigned int | diag_resamp_runs |
| total resampler invocations | |
| unsigned int | diag_published |
| total rf_buf_size blocks published | |
| SoDa::ReSamplerPtr | hw_resampler |
| 2.048 MSPS → 625 kSPS | |
| std::mutex | raw_accu_mutex |
| std::vector< std::complex< float > > | raw_accu |
| IQ accumulator filled by async callback. | |
| std::vector< std::complex< float > > | rs_in |
| exact-size input to resampler (rs_in_size) | |
| std::vector< std::complex< float > > | rs_out |
| resampler output (rs_out_size) | |
| std::vector< std::complex< float > > | accu |
| accumulates resampled IQ for rf_buf_size publish | |
| std::thread | async_rx_thread |
| QuadratureOscillator | IF_osc |
| std::weak_ptr< RTLSDRRX > | self |
Static Private Attributes | |
| static constexpr float | HW_RATE = 2048000.0f |
| static constexpr unsigned int | READ_BYTES = 16384 |
| static constexpr unsigned int | RAW_ACCU_MAX = 8 |
Additional Inherited Members | |
| Static Public Attributes inherited from SoDa::Debug | |
| static std::mutex | debug_msg_mutex |
| Protected Attributes inherited from SoDa::RadioRX | |
| 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< Thread > | self |
| 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 |
Definition at line 63 of file RTLSDRRX.hxx.
|
protected |
References SoDa::RadioRX::params.
Referenced by make().
|
default |
|
staticprivate |
|
private |
|
overridevirtual |
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.
Implements SoDa::RadioRX.
|
inlineoverridevirtual |
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.
| enable | if true, send RF sample buffer onto if_stream, otherwise, don't. |
Implements SoDa::RadioRX.
Definition at line 85 of file RTLSDRRX.hxx.
References if_streaming_enabled.
|
overridevirtual |
|
inlinestatic |
Definition at line 70 of file RTLSDRRX.hxx.
References RTLSDRRX(), and SoDa::RadioRX::params.
|
overridevirtual |
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.
| freq | LO3 frequency its front-end frequency so that it can adjust its own oscillator. |
Implements SoDa::RadioRX.
|
overridevirtual |
flush the input rx data stream and set the stream_processing flag to on.
Implements SoDa::RadioRX.
|
overridevirtual |
flush the input rx data stream and set the stream_processing flag to off
Implements SoDa::RadioRX.
|
inlineoverridevirtual |
test the processing stream flag
Implements SoDa::RadioRX.
Definition at line 84 of file RTLSDRRX.hxx.
References streaming.
|
private |
accumulates resampled IQ for rf_buf_size publish
Definition at line 116 of file RTLSDRRX.hxx.
|
private |
Definition at line 118 of file RTLSDRRX.hxx.
|
private |
total rf_buf_size blocks published
Definition at line 108 of file RTLSDRRX.hxx.
|
private |
async callback invocations
Definition at line 106 of file RTLSDRRX.hxx.
|
private |
total resampler invocations
Definition at line 107 of file RTLSDRRX.hxx.
|
staticconstexprprivate |
Definition at line 93 of file RTLSDRRX.hxx.
|
private |
2.048 MSPS → 625 kSPS
Definition at line 110 of file RTLSDRRX.hxx.
|
private |
Definition at line 120 of file RTLSDRRX.hxx.
|
private |
Definition at line 104 of file RTLSDRRX.hxx.
Referenced by enableIFStreamer().
|
private |
IQ accumulator filled by async callback.
Definition at line 113 of file RTLSDRRX.hxx.
|
staticconstexprprivate |
Definition at line 95 of file RTLSDRRX.hxx.
|
private |
Definition at line 112 of file RTLSDRRX.hxx.
|
staticconstexprprivate |
Definition at line 94 of file RTLSDRRX.hxx.
|
private |
publish chunk size (30000 samples at 625 kSPS)
Definition at line 99 of file RTLSDRRX.hxx.
|
private |
exact-size input to resampler (rs_in_size)
Definition at line 114 of file RTLSDRRX.hxx.
|
private |
exact resampler input size (at 2.048 MSPS)
Definition at line 97 of file RTLSDRRX.hxx.
|
private |
resampler output (rs_out_size)
Definition at line 115 of file RTLSDRRX.hxx.
|
private |
resampler output size (at 625 kSPS)
Definition at line 98 of file RTLSDRRX.hxx.
|
private |
Definition at line 91 of file RTLSDRRX.hxx.
|
private |
625 kSPS — used for IF NCO phase increment
Definition at line 101 of file RTLSDRRX.hxx.
|
private |
Definition at line 122 of file RTLSDRRX.hxx.
|
private |
Definition at line 103 of file RTLSDRRX.hxx.
Referenced by streamEnabled().