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 <hackrfinput.h>
Classes | |
class | MsgConfigureHackRF |
class | MsgFileRecord |
class | MsgReportHackRF |
class | MsgStartStop |
Public Member Functions | |
HackRFInput (DeviceAPI *deviceAPI) | |
virtual | ~HackRFInput () |
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 HackRFInputSettings &settings, bool force) |
void | setDeviceCenterFrequency (quint64 freq, qint32 LOppmTenths) |
void | webapiFormatDeviceSettings (SWGSDRangel::SWGDeviceSettings &response, const HackRFInputSettings &settings) |
void | webapiReverseSendSettings (QList< QString > &deviceSettingsKeys, const HackRFInputSettings &settings, bool force) |
void | webapiReverseSendStartStop (bool start) |
Private Attributes | |
DeviceAPI * | m_deviceAPI |
QMutex | m_mutex |
HackRFInputSettings | m_settings |
struct hackrf_device * | m_dev |
HackRFInputThread * | m_hackRFThread |
QString | m_deviceDescription |
DeviceHackRFParams | 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 37 of file hackrfinput.h.
HackRFInput::HackRFInput | ( | DeviceAPI * | deviceAPI | ) |
Definition at line 44 of file hackrfinput.cpp.
References arg().
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord().
|
virtual |
Definition at line 64 of file hackrfinput.cpp.
References closeDevice(), m_deviceAPI, m_fileSink, m_networkManager, m_running, networkManagerFinished(), DeviceAPI::removeAncillarySink(), DeviceAPI::setBuddySharedPtr(), and stop().
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord().
|
private |
Definition at line 365 of file hackrfinput.cpp.
References DeviceSampleSource::calculateDeviceCenterFrequency(), DeviceAPI::configureCorrections(), DeviceHackRFShared::MsgSynchronizeFrequency::create(), DeviceAPI::getDeviceEngineInputMessageQueue(), DeviceAPI::getSamplingDeviceInputMessageQueue(), DeviceAPI::getSinkBuddies(), FileRecord::handleMessage(), HackRFInputSettings::m_bandwidth, HackRFInputSettings::m_biasT, HackRFInputSettings::m_centerFrequency, HackRFInputSettings::m_dcBlock, m_dev, m_deviceAPI, HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_fcPos, m_fileSink, m_hackRFThread, HackRFInputSettings::m_iqCorrection, HackRFInputSettings::m_lnaExt, HackRFInputSettings::m_lnaGain, HackRFInputSettings::m_log2Decim, HackRFInputSettings::m_LOppmTenths, HackRFInputSettings::m_reverseAPIAddress, HackRFInputSettings::m_reverseAPIDeviceIndex, HackRFInputSettings::m_reverseAPIPort, m_settings, HackRFInputSettings::m_useReverseAPI, HackRFInputSettings::m_vgaGain, MessageQueue::push(), setDeviceCenterFrequency(), HackRFInputThread::setFcPos(), HackRFInputThread::setLog2Decimation(), HackRFInputThread::setSamplerate(), and webapiReverseSendSettings().
Referenced by handleMessage(), init(), and start().
|
private |
Definition at line 165 of file hackrfinput.cpp.
References DeviceAPI::getSinkBuddies(), DeviceHackRFParams::m_dev, m_dev, m_deviceAPI, and m_sharedParams.
Referenced by openDevice(), and ~HackRFInput().
|
virtual |
Implements DeviceSampleSource.
Definition at line 202 of file hackrfinput.cpp.
References HackRFInput::MsgConfigureHackRF::create(), HackRFInputSettings::deserialize(), DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, m_settings, MessageQueue::push(), and HackRFInputSettings::resetToDefaults().
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord().
|
virtual |
Implements DeviceSampleSource.
Definition at line 79 of file hackrfinput.cpp.
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord().
|
virtual |
Center frequency exposed by the source.
Implements DeviceSampleSource.
Definition at line 234 of file hackrfinput.cpp.
References HackRFInputSettings::m_centerFrequency, and m_settings.
Referenced by setSampleRate().
|
virtual |
Implements DeviceSampleSource.
Definition at line 224 of file hackrfinput.cpp.
References m_deviceDescription.
Referenced by setMessageQueueToGUI().
|
virtual |
Sample rate exposed by the source.
Implements DeviceSampleSource.
Definition at line 229 of file hackrfinput.cpp.
References HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_log2Decim, and m_settings.
Referenced by setMessageQueueToGUI().
|
virtual |
Implements DeviceSampleSource.
Definition at line 254 of file hackrfinput.cpp.
References applySettings(), DeviceSampleSource::calculateCenterFrequency(), HackRFInput::MsgConfigureHackRF::create(), DeviceSampleSource::FSHIFT_TXSYNC, FileRecord::genUniqueFileName(), DeviceAPI::getDeviceEngineInputMessageQueue(), DeviceAPI::getDeviceUID(), HackRFInput::MsgConfigureHackRF::getForce(), DeviceHackRFShared::MsgSynchronizeFrequency::getFrequency(), HackRFInput::MsgConfigureHackRF::getSettings(), HackRFInput::MsgStartStop::getStartStop(), HackRFInput::MsgFileRecord::getStartStop(), FileRecord::handleMessage(), DeviceAPI::initDeviceEngine(), HackRFInputSettings::m_centerFrequency, m_deviceAPI, HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_fcPos, HackRFInputSettings::m_fileRecordName, m_fileSink, DeviceSampleSource::m_guiMessageQueue, HackRFInputSettings::m_log2Decim, m_settings, HackRFInputSettings::m_useReverseAPI, Message::match(), MessageQueue::push(), 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 131 of file hackrfinput.cpp.
References applySettings(), and m_settings.
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord().
|
privateslot |
Definition at line 832 of file hackrfinput.cpp.
Referenced by ~HackRFInput().
|
private |
Definition at line 84 of file hackrfinput.cpp.
References closeDevice(), DeviceAPI::getBuddySharedPtr(), DeviceAPI::getSamplingDeviceSerial(), DeviceAPI::getSinkBuddies(), DeviceHackRFParams::m_dev, m_dev, m_deviceAPI, DeviceSampleSource::m_sampleFifo, m_sharedParams, DeviceHackRF::open_hackrf(), and SampleSinkFifo::setSize().
|
virtual |
Implements DeviceSampleSource.
Definition at line 197 of file hackrfinput.cpp.
References m_settings, and HackRFInputSettings::serialize().
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord().
|
virtual |
Implements DeviceSampleSource.
Definition at line 239 of file hackrfinput.cpp.
References HackRFInput::MsgConfigureHackRF::create(), HackRFInputSettings::m_centerFrequency, DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, m_settings, and MessageQueue::push().
Referenced by setSampleRate().
|
private |
Definition at line 349 of file hackrfinput.cpp.
References m_dev.
Referenced by applySettings().
|
inlinevirtual |
Implements DeviceSampleSource.
Definition at line 130 of file hackrfinput.h.
References getDeviceDescription(), getSampleRate(), and DeviceSampleSource::m_guiMessageQueue.
|
inlinevirtual |
For when the source sample rate is set externally.
Implements DeviceSampleSource.
Definition at line 133 of file hackrfinput.h.
References getCenterFrequency(), handleMessage(), setCenterFrequency(), webapiRun(), webapiRunGet(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
virtual |
Implements DeviceSampleSource.
Definition at line 136 of file hackrfinput.cpp.
References applySettings(), m_dev, HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_fcPos, m_hackRFThread, HackRFInputSettings::m_log2Decim, m_running, DeviceSampleSource::m_sampleFifo, m_settings, HackRFInputThread::setFcPos(), HackRFInputThread::setLog2Decimation(), HackRFInputThread::setSamplerate(), HackRFInputThread::startWork(), and stop().
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord().
|
virtual |
Implements DeviceSampleSource.
Definition at line 182 of file hackrfinput.cpp.
References m_hackRFThread, m_running, and HackRFInputThread::stopWork().
Referenced by HackRFInput::MsgFileRecord::MsgFileRecord(), start(), and ~HackRFInput().
|
private |
Definition at line 674 of file hackrfinput.cpp.
References SWGSDRangel::SWGHackRFInputSettings::getFileRecordName(), SWGSDRangel::SWGDeviceSettings::getHackRfInputSettings(), SWGSDRangel::SWGHackRFInputSettings::getReverseApiAddress(), HackRFInputSettings::m_bandwidth, HackRFInputSettings::m_biasT, HackRFInputSettings::m_centerFrequency, HackRFInputSettings::m_dcBlock, HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_fcPos, HackRFInputSettings::m_fileRecordName, HackRFInputSettings::m_iqCorrection, HackRFInputSettings::m_lnaExt, HackRFInputSettings::m_lnaGain, HackRFInputSettings::m_log2Decim, HackRFInputSettings::m_LOppmTenths, HackRFInputSettings::m_reverseAPIAddress, HackRFInputSettings::m_reverseAPIDeviceIndex, HackRFInputSettings::m_reverseAPIPort, HackRFInputSettings::m_useReverseAPI, HackRFInputSettings::m_vgaGain, SWGSDRangel::SWGHackRFInputSettings::setBandwidth(), SWGSDRangel::SWGHackRFInputSettings::setBiasT(), SWGSDRangel::SWGHackRFInputSettings::setCenterFrequency(), SWGSDRangel::SWGHackRFInputSettings::setDcBlock(), SWGSDRangel::SWGHackRFInputSettings::setDevSampleRate(), SWGSDRangel::SWGHackRFInputSettings::setFcPos(), SWGSDRangel::SWGHackRFInputSettings::setFileRecordName(), SWGSDRangel::SWGHackRFInputSettings::setIqCorrection(), SWGSDRangel::SWGHackRFInputSettings::setLnaExt(), SWGSDRangel::SWGHackRFInputSettings::setLnaGain(), SWGSDRangel::SWGHackRFInputSettings::setLog2Decim(), SWGSDRangel::SWGHackRFInputSettings::setLOppmTenths(), SWGSDRangel::SWGHackRFInputSettings::setReverseApiAddress(), SWGSDRangel::SWGHackRFInputSettings::setReverseApiDeviceIndex(), SWGSDRangel::SWGHackRFInputSettings::setReverseApiPort(), SWGSDRangel::SWGHackRFInputSettings::setUseReverseApi(), and SWGSDRangel::SWGHackRFInputSettings::setVgaGain().
Referenced by webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 735 of file hackrfinput.cpp.
References SWGSDRangel::SWGDeviceSettings::asJson(), DeviceAPI::getDeviceSetIndex(), SWGSDRangel::SWGDeviceSettings::getHackRfInputSettings(), HackRFInputSettings::m_bandwidth, HackRFInputSettings::m_biasT, HackRFInputSettings::m_centerFrequency, HackRFInputSettings::m_dcBlock, m_deviceAPI, HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_fcPos, HackRFInputSettings::m_fileRecordName, HackRFInputSettings::m_iqCorrection, HackRFInputSettings::m_lnaExt, HackRFInputSettings::m_lnaGain, HackRFInputSettings::m_log2Decim, HackRFInputSettings::m_LOppmTenths, m_networkManager, m_networkRequest, HackRFInputSettings::m_reverseAPIAddress, HackRFInputSettings::m_reverseAPIDeviceIndex, HackRFInputSettings::m_reverseAPIPort, HackRFInputSettings::m_vgaGain, SWGSDRangel::SWGHackRFInputSettings::setBandwidth(), SWGSDRangel::SWGHackRFInputSettings::setBiasT(), SWGSDRangel::SWGHackRFInputSettings::setCenterFrequency(), SWGSDRangel::SWGHackRFInputSettings::setDcBlock(), SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGHackRFInputSettings::setDevSampleRate(), SWGSDRangel::SWGDeviceSettings::setDirection(), SWGSDRangel::SWGHackRFInputSettings::setFcPos(), SWGSDRangel::SWGHackRFInputSettings::setFileRecordName(), SWGSDRangel::SWGDeviceSettings::setHackRfInputSettings(), SWGSDRangel::SWGHackRFInputSettings::setIqCorrection(), SWGSDRangel::SWGHackRFInputSettings::setLnaExt(), SWGSDRangel::SWGHackRFInputSettings::setLnaGain(), SWGSDRangel::SWGHackRFInputSettings::setLog2Decim(), SWGSDRangel::SWGHackRFInputSettings::setLOppmTenths(), SWGSDRangel::SWGDeviceSettings::setOriginatorIndex(), and SWGSDRangel::SWGHackRFInputSettings::setVgaGain().
Referenced by applySettings().
|
private |
Definition at line 804 of file hackrfinput.cpp.
References SWGSDRangel::SWGDeviceSettings::asJson(), DeviceAPI::getDeviceSetIndex(), m_deviceAPI, m_networkManager, m_networkRequest, HackRFInputSettings::m_reverseAPIAddress, HackRFInputSettings::m_reverseAPIDeviceIndex, HackRFInputSettings::m_reverseAPIPort, m_settings, SWGSDRangel::SWGDeviceSettings::setDeviceHwType(), SWGSDRangel::SWGDeviceSettings::setDirection(), and SWGSDRangel::SWGDeviceSettings::setOriginatorIndex().
Referenced by handleMessage().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 716 of file hackrfinput.cpp.
References HackRFInput::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 707 of file hackrfinput.cpp.
References DeviceAPI::getDeviceEngineStateStr(), SWGSDRangel::SWGDeviceState::getState(), and m_deviceAPI.
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 586 of file hackrfinput.cpp.
References SWGSDRangel::SWGDeviceSettings::getHackRfInputSettings(), SWGSDRangel::SWGHackRFInputSettings::init(), m_settings, SWGSDRangel::SWGDeviceSettings::setHackRfInputSettings(), and webapiFormatDeviceSettings().
Referenced by setSampleRate().
|
virtual |
Reimplemented from DeviceSampleSource.
Definition at line 597 of file hackrfinput.cpp.
References HackRFInput::MsgConfigureHackRF::create(), SWGSDRangel::SWGHackRFInputSettings::getBandwidth(), SWGSDRangel::SWGHackRFInputSettings::getBiasT(), SWGSDRangel::SWGHackRFInputSettings::getCenterFrequency(), SWGSDRangel::SWGHackRFInputSettings::getDcBlock(), SWGSDRangel::SWGHackRFInputSettings::getDevSampleRate(), SWGSDRangel::SWGHackRFInputSettings::getFcPos(), SWGSDRangel::SWGHackRFInputSettings::getFileRecordName(), SWGSDRangel::SWGDeviceSettings::getHackRfInputSettings(), SWGSDRangel::SWGHackRFInputSettings::getIqCorrection(), SWGSDRangel::SWGHackRFInputSettings::getLnaExt(), SWGSDRangel::SWGHackRFInputSettings::getLnaGain(), SWGSDRangel::SWGHackRFInputSettings::getLog2Decim(), SWGSDRangel::SWGHackRFInputSettings::getLOppmTenths(), SWGSDRangel::SWGHackRFInputSettings::getReverseApiAddress(), SWGSDRangel::SWGHackRFInputSettings::getReverseApiDeviceIndex(), SWGSDRangel::SWGHackRFInputSettings::getReverseApiPort(), SWGSDRangel::SWGHackRFInputSettings::getUseReverseApi(), SWGSDRangel::SWGHackRFInputSettings::getVgaGain(), HackRFInputSettings::m_bandwidth, HackRFInputSettings::m_biasT, HackRFInputSettings::m_centerFrequency, HackRFInputSettings::m_dcBlock, HackRFInputSettings::m_devSampleRate, HackRFInputSettings::m_fcPos, HackRFInputSettings::m_fileRecordName, DeviceSampleSource::m_guiMessageQueue, DeviceSampleSource::m_inputMessageQueue, HackRFInputSettings::m_iqCorrection, HackRFInputSettings::m_lnaExt, HackRFInputSettings::m_lnaGain, HackRFInputSettings::m_log2Decim, HackRFInputSettings::m_LOppmTenths, HackRFInputSettings::m_reverseAPIAddress, HackRFInputSettings::m_reverseAPIDeviceIndex, HackRFInputSettings::m_reverseAPIPort, m_settings, HackRFInputSettings::m_useReverseAPI, HackRFInputSettings::m_vgaGain, MessageQueue::push(), and webapiFormatDeviceSettings().
Referenced by setSampleRate().
|
private |
Definition at line 163 of file hackrfinput.h.
Referenced by applySettings(), closeDevice(), openDevice(), setDeviceCenterFrequency(), and start().
|
private |
Definition at line 160 of file hackrfinput.h.
Referenced by applySettings(), closeDevice(), handleMessage(), openDevice(), webapiReverseSendSettings(), webapiReverseSendStartStop(), webapiRun(), webapiRunGet(), and ~HackRFInput().
|
private |
Definition at line 165 of file hackrfinput.h.
Referenced by getDeviceDescription().
|
private |
File sink to record device I/Q output.
Definition at line 168 of file hackrfinput.h.
Referenced by applySettings(), handleMessage(), and ~HackRFInput().
|
private |
Definition at line 164 of file hackrfinput.h.
Referenced by applySettings(), start(), and stop().
|
private |
Definition at line 161 of file hackrfinput.h.
|
private |
Definition at line 169 of file hackrfinput.h.
Referenced by webapiReverseSendSettings(), webapiReverseSendStartStop(), and ~HackRFInput().
|
private |
Definition at line 170 of file hackrfinput.h.
Referenced by webapiReverseSendSettings(), and webapiReverseSendStartStop().
|
private |
Definition at line 167 of file hackrfinput.h.
Referenced by start(), stop(), and ~HackRFInput().
|
private |
Definition at line 162 of file hackrfinput.h.
Referenced by applySettings(), deserialize(), getCenterFrequency(), getSampleRate(), handleMessage(), init(), serialize(), setCenterFrequency(), start(), webapiReverseSendStartStop(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 166 of file hackrfinput.h.
Referenced by closeDevice(), and openDevice().