diff --git a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp index a15bc9dd2..50ee32744 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp @@ -132,7 +132,10 @@ bool HackRFOutput::start() // mutexLocker.unlock(); applySettings(m_settings, true); - m_hackRFThread->setLog2Interpolation(m_settings.m_log2Interp); + + m_hackRFThread->setSamplerate(m_settings.m_devSampleRate); + m_hackRFThread->setLog2Interpolation(m_settings.m_log2Interp); + m_hackRFThread->setFcPos((int) m_settings.m_fcPos); m_hackRFThread->startWork(); @@ -413,6 +416,9 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc if ((m_settings.m_LOppmTenths != settings.m_LOppmTenths) || force) { reverseAPIKeys.append("LOppmTenths"); } + if ((m_settings.m_fcPos != settings.m_fcPos) || force) { + reverseAPIKeys.append("fcPos"); + } if ((m_settings.m_centerFrequency != settings.m_centerFrequency) || (m_settings.m_devSampleRate != settings.m_devSampleRate) || @@ -571,6 +577,12 @@ int HackRFOutput::webapiSettingsPutPatch( if (deviceSettingsKeys.contains("log2Interp")) { settings.m_log2Interp = response.getHackRfOutputSettings()->getLog2Interp(); } + if (deviceSettingsKeys.contains("fcPos")) + { + int fcPos = response.getHackRfInputSettings()->getFcPos(); + fcPos = fcPos < 0 ? 0 : fcPos > 2 ? 2 : fcPos; + settings.m_fcPos = (HackRFOutputSettings::fcPos_t) fcPos; + } if (deviceSettingsKeys.contains("devSampleRate")) { settings.m_devSampleRate = response.getHackRfOutputSettings()->getDevSampleRate(); } @@ -613,6 +625,7 @@ void HackRFOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re response.getHackRfOutputSettings()->setBandwidth(settings.m_bandwidth); response.getHackRfOutputSettings()->setVgaGain(settings.m_vgaGain); response.getHackRfOutputSettings()->setLog2Interp(settings.m_log2Interp); + response.getHackRfOutputSettings()->setFcPos(settings.m_fcPos); response.getHackRfOutputSettings()->setDevSampleRate(settings.m_devSampleRate); response.getHackRfOutputSettings()->setBiasT(settings.m_biasT ? 1 : 0); response.getHackRfOutputSettings()->setLnaExt(settings.m_lnaExt ? 1 : 0); @@ -683,6 +696,9 @@ void HackRFOutput::webapiReverseSendSettings(QList& deviceSettingsKeys, if (deviceSettingsKeys.contains("log2Interp") || force) { swgHackRFOutputSettings->setLog2Interp(settings.m_log2Interp); } + if (deviceSettingsKeys.contains("fcPos") || force) { + swgHackRFOutputSettings->setFcPos((int) settings.m_fcPos); + } if (deviceSettingsKeys.contains("devSampleRate") || force) { swgHackRFOutputSettings->setDevSampleRate(settings.m_devSampleRate); } diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index eabea493f..2c3c8b677 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -2828,6 +2828,10 @@ margin-bottom: 20px; "log2Interp" : { "type" : "integer" }, + "fcPos" : { + "type" : "integer", + "description" : "0=Infra 1=Supra 2=Center" + }, "devSampleRate" : { "type" : "integer" }, @@ -24649,7 +24653,7 @@ except ApiException as e:
- Generated 2019-03-30T20:33:10.840+01:00 + Generated 2019-04-02T13:22:46.589+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/HackRF.yaml b/sdrbase/resources/webapi/doc/swagger/include/HackRF.yaml index 3c1028a0c..eafe6555e 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/HackRF.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/HackRF.yaml @@ -53,6 +53,9 @@ HackRFOutputSettings: type: integer log2Interp: type: integer + fcPos: + description: 0=Infra 1=Supra 2=Center + type: integer devSampleRate: type: integer biasT: diff --git a/swagger/sdrangel/api/swagger/include/HackRF.yaml b/swagger/sdrangel/api/swagger/include/HackRF.yaml index 3c1028a0c..eafe6555e 100644 --- a/swagger/sdrangel/api/swagger/include/HackRF.yaml +++ b/swagger/sdrangel/api/swagger/include/HackRF.yaml @@ -53,6 +53,9 @@ HackRFOutputSettings: type: integer log2Interp: type: integer + fcPos: + description: 0=Infra 1=Supra 2=Center + type: integer devSampleRate: type: integer biasT: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index eabea493f..2c3c8b677 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -2828,6 +2828,10 @@ margin-bottom: 20px; "log2Interp" : { "type" : "integer" }, + "fcPos" : { + "type" : "integer", + "description" : "0=Infra 1=Supra 2=Center" + }, "devSampleRate" : { "type" : "integer" }, @@ -24649,7 +24653,7 @@ except ApiException as e:
- Generated 2019-03-30T20:33:10.840+01:00 + Generated 2019-04-02T13:22:46.589+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.cpp index c0077a926..4ca7b4101 100644 --- a/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.cpp @@ -38,6 +38,8 @@ SWGHackRFOutputSettings::SWGHackRFOutputSettings() { m_vga_gain_isSet = false; log2_interp = 0; m_log2_interp_isSet = false; + fc_pos = 0; + m_fc_pos_isSet = false; dev_sample_rate = 0; m_dev_sample_rate_isSet = false; bias_t = 0; @@ -70,6 +72,8 @@ SWGHackRFOutputSettings::init() { m_vga_gain_isSet = false; log2_interp = 0; m_log2_interp_isSet = false; + fc_pos = 0; + m_fc_pos_isSet = false; dev_sample_rate = 0; m_dev_sample_rate_isSet = false; bias_t = 0; @@ -97,6 +101,7 @@ SWGHackRFOutputSettings::cleanup() { + if(reverse_api_address != nullptr) { delete reverse_api_address; } @@ -125,6 +130,8 @@ SWGHackRFOutputSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", ""); + ::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", ""); + ::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", ""); ::SWGSDRangel::setValue(&bias_t, pJson["biasT"], "qint32", ""); @@ -170,6 +177,9 @@ SWGHackRFOutputSettings::asJsonObject() { if(m_log2_interp_isSet){ obj->insert("log2Interp", QJsonValue(log2_interp)); } + if(m_fc_pos_isSet){ + obj->insert("fcPos", QJsonValue(fc_pos)); + } if(m_dev_sample_rate_isSet){ obj->insert("devSampleRate", QJsonValue(dev_sample_rate)); } @@ -245,6 +255,16 @@ SWGHackRFOutputSettings::setLog2Interp(qint32 log2_interp) { this->m_log2_interp_isSet = true; } +qint32 +SWGHackRFOutputSettings::getFcPos() { + return fc_pos; +} +void +SWGHackRFOutputSettings::setFcPos(qint32 fc_pos) { + this->fc_pos = fc_pos; + this->m_fc_pos_isSet = true; +} + qint32 SWGHackRFOutputSettings::getDevSampleRate() { return dev_sample_rate; @@ -325,6 +345,7 @@ SWGHackRFOutputSettings::isSet(){ if(m_bandwidth_isSet){ isObjectUpdated = true; break;} if(m_vga_gain_isSet){ isObjectUpdated = true; break;} if(m_log2_interp_isSet){ isObjectUpdated = true; break;} + if(m_fc_pos_isSet){ isObjectUpdated = true; break;} if(m_dev_sample_rate_isSet){ isObjectUpdated = true; break;} if(m_bias_t_isSet){ isObjectUpdated = true; break;} if(m_lna_ext_isSet){ isObjectUpdated = true; break;} diff --git a/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.h b/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.h index afd3f3cfa..0b5f5d925 100644 --- a/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGHackRFOutputSettings.h @@ -57,6 +57,9 @@ public: qint32 getLog2Interp(); void setLog2Interp(qint32 log2_interp); + qint32 getFcPos(); + void setFcPos(qint32 fc_pos); + qint32 getDevSampleRate(); void setDevSampleRate(qint32 dev_sample_rate); @@ -97,6 +100,9 @@ private: qint32 log2_interp; bool m_log2_interp_isSet; + qint32 fc_pos; + bool m_fc_pos_isSet; + qint32 dev_sample_rate; bool m_dev_sample_rate_isSet;