SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
|
#include <bladerf1input.h>
Classes | |
class | MsgConfigureBladerf1 |
class | MsgFileRecord |
class | MsgStartStop |
Public Member Functions | |
Bladerf1Input (DeviceAPI *deviceAPI) | |
virtual | ~Bladerf1Input () |
virtual void | destroy () |
virtual void | init () |
initializations to be done when all collaborating objects are created and possibly connected More... | |
virtual bool | start () |
virtual void | stop () |
virtual QByteArray | serialize () const |
virtual bool | deserialize (const QByteArray &data) |
virtual void | setMessageQueueToGUI (MessageQueue *queue) |
virtual const QString & | getDeviceDescription () const |
virtual int | getSampleRate () const |
Sample rate exposed by the source. More... | |
virtual void | setSampleRate (int sampleRate) |
For when the source sample rate is set externally. More... | |
virtual quint64 | getCenterFrequency () const |
Center frequency exposed by the source. More... | |
virtual void | setCenterFrequency (qint64 centerFrequency) |
virtual bool | handleMessage (const Message &message) |
virtual int | webapiSettingsGet (SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage) |
virtual int | webapiSettingsPutPatch (bool force, const QStringList &deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings &response, QString &errorMessage) |
virtual int | webapiRunGet (SWGSDRangel::SWGDeviceState &response, QString &errorMessage) |
virtual int | webapiRun (bool run, SWGSDRangel::SWGDeviceState &response, QString &errorMessage) |
Public Member Functions inherited from DeviceSampleSource | |
DeviceSampleSource () | |
virtual | ~DeviceSampleSource () |
virtual int | webapiReportGet (SWGSDRangel::SWGDeviceReport &response, QString &errorMessage) |
MessageQueue * | getInputMessageQueue () |
MessageQueue * | getMessageQueueToGUI () |
SampleSinkFifo * | getSampleFifo () |
Private Slots | |
void | networkManagerFinished (QNetworkReply *reply) |
Private Member Functions | |
bool | openDevice () |
void | closeDevice () |
bool | applySettings (const BladeRF1InputSettings &settings, bool force) |
bladerf_lna_gain | getLnaGain (int lnaGain) |
void | webapiFormatDeviceSettings (SWGSDRangel::SWGDeviceSettings &response, const BladeRF1InputSettings &settings) |
void | webapiReverseSendSettings (QList< QString > &deviceSettingsKeys, const BladeRF1InputSettings &settings, bool force) |
void | webapiReverseSendStartStop (bool start) |
Private Attributes | |
DeviceAPI * | m_deviceAPI |
QMutex | m_mutex |
BladeRF1InputSettings | m_settings |
struct bladerf * | m_dev |
Bladerf1InputThread * | m_bladerfThread |
QString | m_deviceDescription |
DeviceBladeRF1Params | m_sharedParams |
bool | m_running |
FileRecord * | m_fileSink |
File sink to record device I/Q output. More... | |
QNetworkAccessManager * | m_networkManager |
QNetworkRequest | m_networkRequest |
Additional Inherited Members | |
Public Types inherited from DeviceSampleSource | |
enum | fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER } |
enum | FrequencyShiftScheme { FSHIFT_STD = 0, FSHIFT_TXSYNC } |
Static Public Member Functions inherited from DeviceSampleSource | |
static qint64 | calculateDeviceCenterFrequency (quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false) |
static qint64 | calculateCenterFrequency (quint64 deviceCenterFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false) |
static qint32 | calculateFrequencyShift (int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme) |
Protected Slots inherited from DeviceSampleSource | |
void | handleInputMessages () |
Protected Attributes inherited from DeviceSampleSource | |
SampleSinkFifo | m_sampleFifo |
MessageQueue | m_inputMessageQueue |
Input queue to the source. More... | |
MessageQueue * | m_guiMessageQueue |
Input message queue to the GUI. More... | |
Definition at line 38 of file bladerf1input.h.
Bladerf1Input::Bladerf1Input | ( | DeviceAPI * | deviceAPI | ) |
Definition at line 43 of file bladerf1input.cpp.
References arg().
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop().
|
virtual |
Definition at line 62 of file bladerf1input.cpp.
References closeDevice(), m_deviceAPI, m_fileSink, m_networkManager, m_running, networkManagerFinished(), DeviceAPI::removeAncillarySink(), DeviceAPI::setBuddySharedPtr(), and stop().
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop().
|
private |
Definition at line 340 of file bladerf1input.cpp.
References DeviceSampleSource::calculateDeviceCenterFrequency(), DeviceAPI::configureCorrections(), DeviceAPI::getDeviceEngineInputMessageQueue(), DeviceAPI::getDeviceSinkEngine(), getLnaGain(), DeviceAPI::getSinkBuddies(), FileRecord::handleMessage(), BladeRF1InputSettings::m_bandwidth, m_bladerfThread, BladeRF1InputSettings::m_centerFrequency, BladeRF1InputSettings::m_dcBlock, m_dev, m_deviceAPI, BladeRF1InputSettings::m_devSampleRate, BladeRF1InputSettings::m_fcPos, m_fileSink, BladeRF1InputSettings::m_iqCorrection, BladeRF1InputSettings::m_lnaGain, BladeRF1InputSettings::m_log2Decim, BladeRF1InputSettings::m_reverseAPIAddress, BladeRF1InputSettings::m_reverseAPIDeviceIndex, BladeRF1InputSettings::m_reverseAPIPort, m_settings, m_sharedParams, BladeRF1InputSettings::m_useReverseAPI, BladeRF1InputSettings::m_vga1, BladeRF1InputSettings::m_vga2, BladeRF1InputSettings::m_xb200, DeviceBladeRF1Params::m_xb200Attached, BladeRF1InputSettings::m_xb200Filter, BladeRF1InputSettings::m_xb200Path, MessageQueue::push(), Bladerf1InputThread::setFcPos(), Bladerf1InputThread::setLog2Decimation(), DSPDeviceSinkEngine::state(), DSPDeviceSinkEngine::StRunning, and webapiReverseSendSettings().
Referenced by handleMessage(), init(), and start().
|
private |
Definition at line 176 of file bladerf1input.cpp.
References DeviceAPI::getSinkBuddies(), DeviceBladeRF1Params::m_dev, m_dev, m_deviceAPI, and m_sharedParams.
Referenced by openDevice(), and ~Bladerf1Input().
|
virtual |
Implements DeviceSampleSource.
Definition at line 222 of file bladerf1input.cpp.
References Bladerf1Input::MsgConfigureBladerf1::create(), BladeRF1InputSettings::deserialize(), DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, m_settings, MessageQueue::push(), and BladeRF1InputSettings::resetToDefaults().
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop().
|
virtual |
Implements DeviceSampleSource.
Definition at line 77 of file bladerf1input.cpp.
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop().
|
virtual |
Center frequency exposed by the source.
Implements DeviceSampleSource.
Definition at line 255 of file bladerf1input.cpp.
References BladeRF1InputSettings::m_centerFrequency, and m_settings.
Referenced by setSampleRate().
|
virtual |
Implements DeviceSampleSource.
Definition at line 244 of file bladerf1input.cpp.
References m_deviceDescription.
Referenced by setMessageQueueToGUI().
|
private |
Definition at line 601 of file bladerf1input.cpp.
Referenced by applySettings().
|
virtual |
Sample rate exposed by the source.
Implements DeviceSampleSource.
Definition at line 249 of file bladerf1input.cpp.
References BladeRF1InputSettings::m_devSampleRate, BladeRF1InputSettings::m_log2Decim, and m_settings.
Referenced by setMessageQueueToGUI().
|
virtual |
Implements DeviceSampleSource.
Definition at line 275 of file bladerf1input.cpp.
References applySettings(), FileRecord::genUniqueFileName(), DeviceAPI::getDeviceUID(), Bladerf1Input::MsgConfigureBladerf1::getForce(), Bladerf1Input::MsgConfigureBladerf1::getSettings(), Bladerf1Input::MsgFileRecord::getStartStop(), Bladerf1Input::MsgStartStop::getStartStop(), DeviceAPI::initDeviceEngine(), m_deviceAPI, BladeRF1InputSettings::m_fileRecordName, m_fileSink, m_settings, BladeRF1InputSettings::m_useReverseAPI, Message::match(), FileRecord::setFileName(), DeviceAPI::startDeviceEngine(), FileRecord::startRecording(), DeviceAPI::stopDeviceEngine(), FileRecord::stopRecording(), and webapiReverseSendStartStop().
Referenced by setSampleRate().
|
virtual |
initializations to be done when all collaborating objects are created and possibly connected
Implements DeviceSampleSource.
Definition at line 144 of file bladerf1input.cpp.
References applySettings(), and m_settings.
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop().
|
privateslot |
Definition at line 867 of file bladerf1input.cpp.
Referenced by ~Bladerf1Input().
|
private |
Definition at line 82 of file bladerf1input.cpp.
References closeDevice(), DeviceAPI::getBuddySharedPtr(), DeviceAPI::getSamplingDeviceSerial(), DeviceAPI::getSinkBuddies(), DeviceBladeRF1Params::m_dev, m_dev, m_deviceAPI, DeviceSampleSource::m_sampleFifo, m_sharedParams, DeviceBladeRF1::open_bladerf(), and SampleSinkFifo::setSize().
|
virtual |
Implements DeviceSampleSource.
Definition at line 217 of file bladerf1input.cpp.
References m_settings, and BladeRF1InputSettings::serialize().
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop().
|
virtual |
Implements DeviceSampleSource.
Definition at line 260 of file bladerf1input.cpp.
References Bladerf1Input::MsgConfigureBladerf1::create(), BladeRF1InputSettings::m_centerFrequency, DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, m_settings, and MessageQueue::push().
Referenced by setSampleRate().
|
inlinevirtual |
Implements DeviceSampleSource.
Definition at line 113 of file bladerf1input.h.
References getDeviceDescription(), getSampleRate(), and DeviceSampleSource::m_guiMessageQueue.
|
inlinevirtual |
For when the source sample rate is set externally.
Implements DeviceSampleSource.
Definition at line 116 of file bladerf1input.h.
References getCenterFrequency(), handleMessage(), setCenterFrequency(), webapiRun(), webapiRunGet(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
virtual |
Implements DeviceSampleSource.
Definition at line 149 of file bladerf1input.cpp.
References applySettings(), m_bladerfThread, m_dev, BladeRF1InputSettings::m_fcPos, BladeRF1InputSettings::m_log2Decim, m_running, DeviceSampleSource::m_sampleFifo, m_settings, Bladerf1InputThread::setFcPos(), Bladerf1InputThread::setLog2Decimation(), Bladerf1InputThread::startWork(), and stop().
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop().
|
virtual |
Implements DeviceSampleSource.
Definition at line 203 of file bladerf1input.cpp.
References m_bladerfThread, m_running, and Bladerf1InputThread::stopWork().
Referenced by Bladerf1Input::MsgStartStop::MsgStartStop(), start(), and ~Bladerf1Input().
|
private |
Definition at line 628 of file bladerf1input.cpp.
References SWGSDRangel::SWGDeviceSettings::getBladeRf1InputSettings(), SWGSDRangel::SWGBladeRF1InputSettings::getFileRecordName(), SWGSDRangel::SWGBladeRF1InputSettings::getReverseApiAddress(), BladeRF1InputSettings::m_bandwidth, BladeRF1InputSettings::m_centerFrequency, BladeRF1InputSettings::m_dcBlock, BladeRF1InputSettings::m_devSampleRate, BladeRF1InputSettings::m_fcPos, BladeRF1InputSettings::m_fileRecordName, BladeRF1InputSettings::m_iqCorrection, BladeRF1InputSettings::m_lnaGain, BladeRF1InputSettings::m_log2Decim, BladeRF1InputSettings::m_reverseAPIAddress, BladeRF1InputSettings::m_reverseAPIDeviceIndex, BladeRF1InputSettings::m_reverseAPIPort, BladeRF1InputSettings::m_useReverseAPI, BladeRF1InputSettings::m_vga1, BladeRF1InputSettings::m_vga2, BladeRF1InputSettings::m_xb200, BladeRF1InputSettings::m_xb200Filter, BladeRF1InputSettings::m_xb200Path, SWGSDRangel::SWGBladeRF1InputSettings::setBandwidth(), SWGSDRangel::SWGBladeRF1InputSettings::setCenterFrequency(), SWGSDRangel::SWGBladeRF1InputSettings::setDcBlock(), SWGSDRangel::SWGBladeRF1InputSettings::setDevSampleRate(), SWGSDRangel::SWGBladeRF1InputSettings::setFcPos(), SWGSDRangel::SWGBladeRF1InputSettings::setFileRecordName(), SWGSDRangel::SWGBladeRF1InputSettings::setIqCorrection(), SWGSDRangel::SWGBladeRF1InputSettings::setLnaGain(), SWGSDRangel::SWGBladeRF1InputSettings::setLog2Decim(), SWGSDRangel::SWGBladeRF1InputSettings::setReverseApiAddress(), SWGSDRangel::SWGBladeRF1InputSettings::setReverseApiDeviceIndex(), SWGSDRangel::SWGBladeRF1InputSettings::setReverseApiPort(), SWGSDRangel::SWGBladeRF1InputSettings::setUseReverseApi(), SWGSDRangel::SWGBladeRF1InputSettings::setVga1(), SWGSDRangel::SWGBladeRF1InputSettings::setVga2(), SWGSDRangel::SWGBladeRF1InputSettings::setXb200(), SWGSDRangel::SWGBladeRF1InputSettings::setXb200Filter(), and SWGSDRangel::SWGBladeRF1InputSettings::setXb200Path().
Referenced by webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 767 of file bladerf1input.cpp.
References SWGSDRangel::SWGDeviceSettings::asJson(), SWGSDRangel::SWGDeviceSettings::getBladeRf1InputSettings(), DeviceAPI::getDeviceSetIndex(), BladeRF1InputSettings::m_bandwidth, BladeRF1InputSettings::m_centerFrequency, BladeRF1InputSettings::m_dcBlock, m_deviceAPI, BladeRF1InputSettings::m_devSampleRate, BladeRF1InputSettings::m_fcPos, BladeRF1InputSettings::m_fileRecordName, BladeRF1InputSettings::m_iqCorrection, BladeRF1InputSettings::m_lnaGain, BladeRF1InputSettings::m_log2Decim, m_networkManager, m_networkRequest, BladeRF1InputSettings::m_reverseAPIAddress, BladeRF1InputSettings::m_reverseAPIDeviceIndex, BladeRF1InputSettings::m_reverseAPIPort, BladeRF1InputSettings::m_vga1, BladeRF1InputSettings::m_vga2, BladeRF1InputSettings::m_xb200, BladeRF1InputSettings::m_xb200Filter, BladeRF1InputSettings::m_xb200Path, SWGSDRangel::SWGBladeRF1InputSettings::setBandwidth(), SWGSDRangel::SWGDeviceSettings::setBladeRf1InputSettings(), SWGSDRangel::SWGBladeRF1InputSettings::setCenterFrequency(), SWGSDRangel::SWGBladeRF1InputSettings::setDcBlock(), SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGBladeRF1InputSettings::setDevSampleRate(), SWGSDRangel::SWGDeviceSettings::setDirection(), SWGSDRangel::SWGBladeRF1InputSettings::setFcPos(), SWGSDRangel::SWGBladeRF1InputSettings::setFileRecordName(), SWGSDRangel::SWGBladeRF1InputSettings::setIqCorrection(), SWGSDRangel::SWGBladeRF1InputSettings::setLnaGain(), SWGSDRangel::SWGBladeRF1InputSettings::setLog2Decim(), SWGSDRangel::SWGDeviceSettings::setOriginatorIndex(), SWGSDRangel::SWGBladeRF1InputSettings::setVga1(), SWGSDRangel::SWGBladeRF1InputSettings::setXb200(), SWGSDRangel::SWGBladeRF1InputSettings::setXb200Filter(), and SWGSDRangel::SWGBladeRF1InputSettings::setXb200Path().
Referenced by applySettings().
|
private |
Definition at line 839 of file bladerf1input.cpp.
References SWGSDRangel::SWGDeviceSettings::asJson(), DeviceAPI::getDeviceSetIndex(), m_deviceAPI, m_networkManager, m_networkRequest, BladeRF1InputSettings::m_reverseAPIAddress, BladeRF1InputSettings::m_reverseAPIDeviceIndex, BladeRF1InputSettings::m_reverseAPIPort, m_settings, SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGDeviceSettings::setDirection(), and SWGSDRangel::SWGDeviceSettings::setOriginatorIndex().
Referenced by handleMessage().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 748 of file bladerf1input.cpp.
References Bladerf1Input::MsgStartStop::create(), DeviceAPI::getDeviceEngineStateStr(), SWGSDRangel::SWGDeviceState::getState(), m_deviceAPI, DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, and MessageQueue::push().
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 739 of file bladerf1input.cpp.
References DeviceAPI::getDeviceEngineStateStr(), SWGSDRangel::SWGDeviceState::getState(), and m_deviceAPI.
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 617 of file bladerf1input.cpp.
References SWGSDRangel::SWGDeviceSettings::getBladeRf1InputSettings(), SWGSDRangel::SWGBladeRF1InputSettings::init(), m_settings, SWGSDRangel::SWGDeviceSettings::setBladeRf1InputSettings(), and webapiFormatDeviceSettings().
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 662 of file bladerf1input.cpp.
References Bladerf1Input::MsgConfigureBladerf1::create(), SWGSDRangel::SWGBladeRF1InputSettings::getBandwidth(), SWGSDRangel::SWGDeviceSettings::getBladeRf1InputSettings(), SWGSDRangel::SWGBladeRF1InputSettings::getCenterFrequency(), SWGSDRangel::SWGBladeRF1InputSettings::getDcBlock(), SWGSDRangel::SWGBladeRF1InputSettings::getDevSampleRate(), SWGSDRangel::SWGBladeRF1InputSettings::getFcPos(), SWGSDRangel::SWGBladeRF1InputSettings::getFileRecordName(), SWGSDRangel::SWGBladeRF1InputSettings::getIqCorrection(), SWGSDRangel::SWGBladeRF1InputSettings::getLnaGain(), SWGSDRangel::SWGBladeRF1InputSettings::getLog2Decim(), SWGSDRangel::SWGBladeRF1InputSettings::getReverseApiAddress(), SWGSDRangel::SWGBladeRF1InputSettings::getReverseApiDeviceIndex(), SWGSDRangel::SWGBladeRF1InputSettings::getReverseApiPort(), SWGSDRangel::SWGBladeRF1InputSettings::getUseReverseApi(), SWGSDRangel::SWGBladeRF1InputSettings::getVga1(), SWGSDRangel::SWGBladeRF1InputSettings::getVga2(), SWGSDRangel::SWGBladeRF1InputSettings::getXb200(), SWGSDRangel::SWGBladeRF1InputSettings::getXb200Filter(), SWGSDRangel::SWGBladeRF1InputSettings::getXb200Path(), BladeRF1InputSettings::m_bandwidth, BladeRF1InputSettings::m_centerFrequency, BladeRF1InputSettings::m_dcBlock, BladeRF1InputSettings::m_devSampleRate, BladeRF1InputSettings::m_fcPos, BladeRF1InputSettings::m_fileRecordName, DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, BladeRF1InputSettings::m_iqCorrection, BladeRF1InputSettings::m_lnaGain, BladeRF1InputSettings::m_log2Decim, BladeRF1InputSettings::m_reverseAPIAddress, BladeRF1InputSettings::m_reverseAPIDeviceIndex, BladeRF1InputSettings::m_reverseAPIPort, m_settings, BladeRF1InputSettings::m_useReverseAPI, BladeRF1InputSettings::m_vga1, BladeRF1InputSettings::m_vga2, BladeRF1InputSettings::m_xb200, BladeRF1InputSettings::m_xb200Filter, BladeRF1InputSettings::m_xb200Path, MessageQueue::push(), and webapiFormatDeviceSettings().
Referenced by setSampleRate().
|
private |
Definition at line 146 of file bladerf1input.h.
Referenced by applySettings(), start(), and stop().
|
private |
Definition at line 145 of file bladerf1input.h.
Referenced by applySettings(), closeDevice(), openDevice(), and start().
|
private |
Definition at line 142 of file bladerf1input.h.
Referenced by applySettings(), closeDevice(), handleMessage(), openDevice(), webapiReverseSendSettings(), webapiReverseSendStartStop(), webapiRun(), webapiRunGet(), and ~Bladerf1Input().
|
private |
Definition at line 147 of file bladerf1input.h.
Referenced by getDeviceDescription().
|
private |
File sink to record device I/Q output.
Definition at line 150 of file bladerf1input.h.
Referenced by applySettings(), handleMessage(), and ~Bladerf1Input().
|
private |
Definition at line 143 of file bladerf1input.h.
|
private |
Definition at line 151 of file bladerf1input.h.
Referenced by webapiReverseSendSettings(), webapiReverseSendStartStop(), and ~Bladerf1Input().
|
private |
Definition at line 152 of file bladerf1input.h.
Referenced by webapiReverseSendSettings(), and webapiReverseSendStartStop().
|
private |
Definition at line 149 of file bladerf1input.h.
Referenced by start(), stop(), and ~Bladerf1Input().
|
private |
Definition at line 144 of file bladerf1input.h.
Referenced by applySettings(), deserialize(), getCenterFrequency(), getSampleRate(), handleMessage(), init(), serialize(), setCenterFrequency(), start(), webapiReverseSendStartStop(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 148 of file bladerf1input.h.
Referenced by applySettings(), closeDevice(), and openDevice().