A class to capture data on the SDRplay RspDuo.
More...
#include <RspDuo.h>
|
| void | validate () |
| | Check parameters for valid for capture device. More...
|
| |
| void | open_api () |
| | Start API functions. More...
|
| |
| void | get_device () |
| | Device selection function. More...
|
| |
| void | set_device_parameters () |
| | Set device parameters. More...
|
| |
| void | stream_a_callback (short *xi, short *xq, sdrplay_api_StreamCbParamsT *params, unsigned int numSamples, unsigned int reset, void *cbContext) |
| | Tuner a callback as defined in SDRplay API. More...
|
| |
| void | stream_b_callback (short *xi, short *xq, sdrplay_api_StreamCbParamsT *params, unsigned int numSamples, unsigned int reset, void *cbContext) |
| | Tuner b callback as defined in SDRplay API. More...
|
| |
| void | event_callback (sdrplay_api_EventT eventId, sdrplay_api_TunerSelectT tuner, sdrplay_api_EventParamsT *params, void *cbContext) |
| | Event callback function as defined in SDRplay API. More...
|
| |
| void | initialise_device () |
| | Start running capture callback function. More...
|
| |
| void | uninitialise_device () |
| | Stop running capture callback function. More...
|
| |
| void | finish () |
| | Internal method to gracefully stop capture.. More...
|
| |
|
| static void | _stream_a_callback (short *xi, short *xq, sdrplay_api_StreamCbParamsT *params, unsigned int numSamples, unsigned int reset, void *cbContext) |
| | Wrapper for C style callback function for stream_a_callback(). More...
|
| |
| static void | _stream_b_callback (short *xi, short *xq, sdrplay_api_StreamCbParamsT *params, unsigned int numSamples, unsigned int reset, void *cbContext) |
| | Wrapper for C style callback function for stream_b_callback(). More...
|
| |
| static void | _event_callback (sdrplay_api_EventT eventId, sdrplay_api_TunerSelectT tuner, sdrplay_api_EventParamsT *params, void *cbContext) |
| | Wrapper for C style callback function for event_callback(). More...
|
| |
A class to capture data on the SDRplay RspDuo.
Loosely based upon the sdrplay_api_sample_app.c and sdr_play.c examples provided in the SDRplay API V3 documentation. This should be read in conjuction with that documentation
For coherent operation the use of sdrplay_api_Tuner_Both is most important This clue was provided by Gustaw Mazurek of WUT https://github.com/fventuri/gr-sdrplay/issues/2 https://github.com/g4eev/RSPduoEME/blob/main/rspduointerface.cpp
Reference for using C style callback API with a C++ wrapper: https://stackoverflow.com/questions/63768893/pointer-problem-using-functions-from-non-object-api-in-objects?rq=1
- Author
- 30hours
-
Michael P
- Todo:
- Remove max time.
◆ RspDuo()
| RspDuo::RspDuo |
( |
uint32_t |
fc, |
|
|
std::string |
path |
|
) |
| |
Constructor.
- Parameters
-
| fc | Center frequency (Hz). |
| path | Path to save IQ data. |
- Returns
- The object.
◆ _event_callback()
| static void RspDuo::_event_callback |
( |
sdrplay_api_EventT |
eventId, |
|
|
sdrplay_api_TunerSelectT |
tuner, |
|
|
sdrplay_api_EventParamsT * |
params, |
|
|
void * |
cbContext |
|
) |
| |
|
inlinestaticprivate |
Wrapper for C style callback function for event_callback().
- Parameters
-
| eventId | As defined in SDRplay API. |
| tuner | As defined in SDRplay API. |
| params | As defined in SDRplay API. |
| cbContext | As defined in SDRplay API. |
- Returns
- Void.
◆ _stream_a_callback()
| static void RspDuo::_stream_a_callback |
( |
short * |
xi, |
|
|
short * |
xq, |
|
|
sdrplay_api_StreamCbParamsT * |
params, |
|
|
unsigned int |
numSamples, |
|
|
unsigned int |
reset, |
|
|
void * |
cbContext |
|
) |
| |
|
inlinestaticprivate |
Wrapper for C style callback function for stream_a_callback().
- Parameters
-
| xi | Pointer to real part of sample. |
| xq | Pointer to imag part of sample. |
| params | As defined in SDRplay API. |
| numSamples | Number of samples in block. |
| reset | As defined in SDRplay API. |
| cbContext | As defined in SDRplay API. |
- Returns
- Void.
◆ _stream_b_callback()
| static void RspDuo::_stream_b_callback |
( |
short * |
xi, |
|
|
short * |
xq, |
|
|
sdrplay_api_StreamCbParamsT * |
params, |
|
|
unsigned int |
numSamples, |
|
|
unsigned int |
reset, |
|
|
void * |
cbContext |
|
) |
| |
|
inlinestaticprivate |
Wrapper for C style callback function for stream_b_callback().
- Parameters
-
| xi | Pointer to real part of sample. |
| xq | Pointer to imag part of sample. |
| params | As defined in SDRplay API. |
| numSamples | Number of samples in block. |
| reset | As defined in SDRplay API. |
| cbContext | As defined in SDRplay API. |
- Returns
- Void.
◆ close_file()
| void RspDuo::close_file |
( |
| ) |
|
Close IQ file gracefully.
- Returns
- Void.
◆ event_callback()
| void RspDuo::event_callback |
( |
sdrplay_api_EventT |
eventId, |
|
|
sdrplay_api_TunerSelectT |
tuner, |
|
|
sdrplay_api_EventParamsT * |
params, |
|
|
void * |
cbContext |
|
) |
| |
|
private |
Event callback function as defined in SDRplay API.
- Parameters
-
| eventId | As defined in SDRplay API. |
| tuner | As defined in SDRplay API. |
| params | As defined in SDRplay API. |
| cbContext | As defined in SDRplay API. |
- Returns
- Void.
◆ finish()
Internal method to gracefully stop capture..
- Returns
- Void.
◆ get_capture()
| bool RspDuo::get_capture |
( |
| ) |
|
Getter for capture.
- Returns
- True if capture is true.
◆ get_device()
| void RspDuo::get_device |
( |
| ) |
|
|
private |
Device selection function.
- Returns
- The object.
◆ initialise_device()
| void RspDuo::initialise_device |
( |
| ) |
|
|
private |
Start running capture callback function.
- Returns
- Void.
◆ open_api()
| void RspDuo::open_api |
( |
| ) |
|
|
private |
Start API functions.
- Returns
- The object.
◆ open_file()
| void RspDuo::open_file |
( |
| ) |
|
Open a new file to record IQ.
- Returns
- Void.
◆ process()
Implement capture function on RSPduo.
- Parameters
-
| buffer1 | Pointer to reference buffer. |
| buffer2 | Pointer to surveillance buffer. |
- Returns
- Void.
◆ replay()
| void RspDuo::replay |
( |
IqData * |
buffer1, |
|
|
IqData * |
buffer2, |
|
|
std::string |
file, |
|
|
bool |
loop |
|
) |
| |
Implement replay function on RSPduo.
- Parameters
-
| buffer1 | Pointer to reference buffer. |
| buffer2 | Pointer to surveillance buffer. |
| file | Path to file to replay data from. |
| loop | True if samples should loop at EOF. |
- Returns
- Void.
◆ set_capture()
| void RspDuo::set_capture |
( |
bool |
capture | ) |
|
Setter for capture.
- Parameters
-
| capture | True if capture is enabled. |
- Returns
- Void.
◆ set_device_parameters()
| void RspDuo::set_device_parameters |
( |
| ) |
|
|
private |
Set device parameters.
- Returns
- The object.
◆ set_file()
| std::string RspDuo::set_file |
( |
std::string |
path | ) |
|
Get file name from path.
- Returns
- String of file name based on current time.
◆ start()
Call methods to start capture.
- Returns
- Void.
◆ stop()
Call methods to gracefully stop capture.
- Returns
- Void.
◆ stream_a_callback()
| void RspDuo::stream_a_callback |
( |
short * |
xi, |
|
|
short * |
xq, |
|
|
sdrplay_api_StreamCbParamsT * |
params, |
|
|
unsigned int |
numSamples, |
|
|
unsigned int |
reset, |
|
|
void * |
cbContext |
|
) |
| |
|
private |
Tuner a callback as defined in SDRplay API.
- Parameters
-
| xi | Pointer to real part of sample. |
| xq | Pointer to imag part of sample. |
| params | As defined in SDRplay API. |
| numSamples | Number of samples in block. |
| reset | As defined in SDRplay API. |
| cbContext | As defined in SDRplay API. |
- Returns
- Void.
◆ stream_b_callback()
| void RspDuo::stream_b_callback |
( |
short * |
xi, |
|
|
short * |
xq, |
|
|
sdrplay_api_StreamCbParamsT * |
params, |
|
|
unsigned int |
numSamples, |
|
|
unsigned int |
reset, |
|
|
void * |
cbContext |
|
) |
| |
|
private |
Tuner b callback as defined in SDRplay API.
- Parameters
-
| xi | Pointer to real part of sample. |
| xq | Pointer to imag part of sample. |
| params | As defined in SDRplay API. |
| numSamples | Number of samples in block. |
| reset | As defined in SDRplay API. |
| cbContext | As defined in SDRplay API. |
- Returns
- Void.
◆ uninitialise_device()
| void RspDuo::uninitialise_device |
( |
| ) |
|
|
private |
Stop running capture callback function.
- Returns
- Void.
◆ validate()
| void RspDuo::validate |
( |
| ) |
|
|
private |
Check parameters for valid for capture device.
- Returns
- The object.
◆ agc_bandwidth_nr
| int RspDuo::agc_bandwidth_nr |
|
private |
◆ agc_set_point_nr
| int RspDuo::agc_set_point_nr |
|
private |
◆ capture
True if capture is enabled.
◆ chunk_time_nr
| int RspDuo::chunk_time_nr |
|
private |
chunk time of recording (s)
◆ dab_notch_fg
| bool RspDuo::dab_notch_fg |
|
private |
◆ DEF_AGC_BANDWIDTH_NR
| const int RspDuo::DEF_AGC_BANDWIDTH_NR = 50 |
|
staticprivate |
◆ DEF_AGC_SET_POINT_NR
| const int RspDuo::DEF_AGC_SET_POINT_NR = -60 |
|
staticprivate |
◆ DEF_CHUNK_TIME_NR
| const int RspDuo::DEF_CHUNK_TIME_NR = 0 |
|
staticprivate |
Default chunk time of recording.
◆ DEF_DECIMATION_NR
| const uint8_t RspDuo::DEF_DECIMATION_NR = 1 |
|
staticprivate |
◆ DEF_GAIN_REDUCTION_NR
| const int RspDuo::DEF_GAIN_REDUCTION_NR = 40 |
|
staticprivate |
◆ DEF_LNA_STATE_NR
| const int RspDuo::DEF_LNA_STATE_NR = 4 |
|
staticprivate |
◆ DEF_SAMPLE_FREQUENCY_NR
| const int RspDuo::DEF_SAMPLE_FREQUENCY_NR = 6000000 |
|
staticprivate |
Default sample frequency.
◆ DEF_SAMPLE_RATE_NR
| const int RspDuo::DEF_SAMPLE_RATE_NR = 2000000 |
|
staticprivate |
◆ DEF_WAIT_TIME_NR
| const int RspDuo::DEF_WAIT_TIME_NR = 0 |
|
staticprivate |
Default wait time before recording.
◆ fc
◆ gain_reduction_nr
| int RspDuo::gain_reduction_nr |
|
private |
◆ lna_state_nr
◆ MAX_FREQUENCY_NR
| const double RspDuo::MAX_FREQUENCY_NR = 2000000000 |
|
staticprivate |
◆ MAX_GAIN_REDUCTION_NR
| const int RspDuo::MAX_GAIN_REDUCTION_NR = 60 |
|
staticprivate |
◆ MAX_LNA_STATE_NR
| const int RspDuo::MAX_LNA_STATE_NR = 9 |
|
staticprivate |
◆ MAX_RUN_TIME_NR
| const int RspDuo::MAX_RUN_TIME_NR = 86400 |
|
staticprivate |
Maximum run time of recording.
◆ MIN_AGC_SET_POINT_NR
| const int RspDuo::MIN_AGC_SET_POINT_NR = -72 |
|
staticprivate |
◆ MIN_GAIN_REDUCTION_NR
| const int RspDuo::MIN_GAIN_REDUCTION_NR = 20 |
|
staticprivate |
◆ more_verbose_fg
| bool RspDuo::more_verbose_fg |
|
private |
◆ nDecimation
Decimation factor (integer).
◆ path
◆ rf_notch_fg
◆ small_verbose_fg
| bool RspDuo::small_verbose_fg |
|
private |
◆ usb_bulk_fg
The documentation for this class was generated from the following files: