diff --git a/plugins/samplesource/hackrf/hackrfgui.cpp b/plugins/samplesource/hackrf/hackrfgui.cpp
index 099160e22..edc4b3280 100644
--- a/plugins/samplesource/hackrf/hackrfgui.cpp
+++ b/plugins/samplesource/hackrf/hackrfgui.cpp
@@ -107,7 +107,7 @@ void HackRFGui::handleSourceMessages()
while ((message = m_sampleSource->getOutputMessageQueueToGUI()->pop()) != 0)
{
- qDebug("AirspyGui::HandleSourceMessages: message: %s", message->getIdentifier());
+ qDebug("HackRFGui::HandleSourceMessages: message: %s", message->getIdentifier());
if (handleMessage(*message))
{
@@ -132,9 +132,13 @@ void HackRFGui::displaySettings()
ui->fcPos->setCurrentIndex((int) m_settings.m_fcPos);
+ ui->lnaExt->setChecked(m_settings.m_lnaExt);
ui->lnaGainText->setText(tr("%1dB").arg(m_settings.m_lnaGain));
ui->lna->setValue(m_settings.m_lnaGain);
+ ui->rej->setCurrentIndex(m_settings.m_imjRejFilterIndex);
+ ui->bbFilter->setCurrentIndex(m_settings.m_bandwidthIndex);
+
ui->vgaText->setText(tr("%1dB").arg(m_settings.m_vgaGain));
ui->vga->setValue(m_settings.m_vgaGain);
}
@@ -233,12 +237,30 @@ void HackRFGui::on_sampleRate_currentIndexChanged(int index)
sendSettings();
}
+void HackRFGui::on_rej_currentIndexChanged(int index)
+{
+ m_settings.m_imjRejFilterIndex = index;
+ sendSettings();
+}
+
+void HackRFGui::on_bbFilter_currentIndexChanged(int index)
+{
+ m_settings.m_bandwidthIndex = index;
+ sendSettings();
+}
+
void HackRFGui::on_biasT_stateChanged(int state)
{
m_settings.m_biasT = (state == Qt::Checked);
sendSettings();
}
+void HackRFGui::on_lnaExt_stateChanged(int state)
+{
+ m_settings.m_lnaExt = (state == Qt::Checked);
+ sendSettings();
+}
+
void HackRFGui::on_decim_valueChanged(int value)
{
if ((value <0) || (value > 6))
diff --git a/plugins/samplesource/hackrf/hackrfgui.h b/plugins/samplesource/hackrf/hackrfgui.h
index 8aeee0a10..d65d3090d 100644
--- a/plugins/samplesource/hackrf/hackrfgui.h
+++ b/plugins/samplesource/hackrf/hackrfgui.h
@@ -76,7 +76,10 @@ private slots:
void on_biasT_stateChanged(int state);
void on_decim_valueChanged(int value);
void on_fcPos_currentIndexChanged(int index);
+ void on_lnaExt_stateChanged(int state);
void on_lna_valueChanged(int value);
+ void on_rej_currentIndexChanged(int index);
+ void on_bbFilter_currentIndexChanged(int index);
void on_vga_valueChanged(int value);
void updateHardware();
void handleSourceMessages();
diff --git a/plugins/samplesource/hackrf/hackrfgui.ui b/plugins/samplesource/hackrf/hackrfgui.ui
index bb6bb039a..77c0ed58c 100644
--- a/plugins/samplesource/hackrf/hackrfgui.ui
+++ b/plugins/samplesource/hackrf/hackrfgui.ui
@@ -6,8 +6,8 @@
0
0
- 198
- 214
+ 215
+ 220
@@ -224,7 +224,7 @@
-
-
+
3
@@ -235,7 +235,7 @@
- -
+
-
Qt::Horizontal
@@ -267,6 +267,19 @@
+ -
+
+
+ Extra LNA
+
+
+ Qt::RightToLeft
+
+
+ LNA Ext
+
+
+
-
diff --git a/plugins/samplesource/hackrf/hackrfinput.cpp b/plugins/samplesource/hackrf/hackrfinput.cpp
index 8785e2278..9fb42a535 100644
--- a/plugins/samplesource/hackrf/hackrfinput.cpp
+++ b/plugins/samplesource/hackrf/hackrfinput.cpp
@@ -34,11 +34,13 @@ HackRFInput::Settings::Settings() :
m_devSampleRateIndex(0),
m_LOppmTenths(0),
m_lnaGain(14),
- m_mixerGain(15),
+ m_imjRejFilterIndex(0),
+ m_bandwidthIndex(0),
m_vgaGain(4),
m_log2Decim(0),
m_fcPos(FC_POS_CENTER),
- m_biasT(false)
+ m_biasT(false),
+ m_lnaExt(false)
{
}
@@ -48,11 +50,13 @@ void HackRFInput::Settings::resetToDefaults()
m_devSampleRateIndex = 0;
m_LOppmTenths = 0;
m_lnaGain = 14;
- m_mixerGain = 15;
+ m_imjRejFilterIndex = 0;
+ m_bandwidthIndex = 0;
m_vgaGain = 4;
m_log2Decim = 0;
m_fcPos = FC_POS_CENTER;
m_biasT = false;
+ m_lnaExt = false;
}
QByteArray HackRFInput::Settings::serialize() const
@@ -65,9 +69,11 @@ QByteArray HackRFInput::Settings::serialize() const
data.m_log2Decim = m_log2Decim;
data.m_fcPos = (qint32) m_fcPos;
data.m_lnaGain = m_lnaGain;
- data.m_mixerGain = m_mixerGain;
+ data.m_imjRejFilterIndex = m_imjRejFilterIndex;
+ data.m_bandwidthIndex = m_bandwidthIndex;
data.m_vgaGain = m_vgaGain;
data.m_biasT = m_biasT;
+ data.m_lnaExt = m_lnaExt;
QByteArray byteArray;
@@ -88,9 +94,11 @@ bool HackRFInput::Settings::deserialize(const QByteArray& serializedData)
m_log2Decim = data.m_log2Decim;
m_fcPos = (fcPos_t) data.m_fcPos;
m_lnaGain = data.m_lnaGain;
- m_mixerGain = data.m_mixerGain;
+ m_imjRejFilterIndex = data.m_imjRejFilterIndex;
+ m_bandwidthIndex = data.m_bandwidthIndex;
m_vgaGain = data.m_vgaGain;
m_biasT = data.m_biasT;
+ m_lnaExt = data.m_lnaExt;
return valid;
}
diff --git a/plugins/samplesource/hackrf/hackrfinput.h b/plugins/samplesource/hackrf/hackrfinput.h
index eda20989e..34e138fa5 100644
--- a/plugins/samplesource/hackrf/hackrfinput.h
+++ b/plugins/samplesource/hackrf/hackrfinput.h
@@ -38,11 +38,11 @@ public:
quint32 m_bandwidthIndex;
quint32 m_imjRejFilterIndex;
quint32 m_lnaGain;
- quint32 m_mixerGain;
quint32 m_vgaGain;
quint32 m_log2Decim;
fcPos_t m_fcPos;
bool m_biasT;
+ bool m_lnaExt;
Settings();
void resetToDefaults();
diff --git a/plugins/samplesource/hackrf/hackrfserializer.cpp b/plugins/samplesource/hackrf/hackrfserializer.cpp
index 63fd3d0ea..6c832345a 100644
--- a/plugins/samplesource/hackrf/hackrfserializer.cpp
+++ b/plugins/samplesource/hackrf/hackrfserializer.cpp
@@ -29,9 +29,11 @@ void HackRFSerializer::writeSerializedData(const AirspyData& data, QByteArray& s
s.writeU32(4, data.m_log2Decim);
s.writeS32(5, data.m_fcPos);
s.writeU32(6, data.m_lnaGain);
- s.writeU32(7, data.m_mixerGain);
- s.writeU32(8, data.m_vgaGain);
- s.writeBool(9, data.m_biasT);
+ s.writeU32(7, data.m_imjRejFilterIndex);
+ s.writeU32(8, data.m_bandwidthIndex);
+ s.writeU32(9, data.m_vgaGain);
+ s.writeBool(10, data.m_biasT);
+ s.writeBool(11, data.m_lnaExt);
serializedData = s.final();
}
@@ -60,9 +62,11 @@ bool HackRFSerializer::readSerializedData(const QByteArray& serializedData, Airs
d.readU32(4, &data.m_log2Decim, 0);
d.readS32(5, &data.m_fcPos, 0);
d.readU32(6, &data.m_lnaGain, 14);
- d.readU32(7, &data.m_mixerGain, 15);
- d.readU32(8, &data.m_vgaGain, 4);
- d.readBool(9, &data.m_biasT, false);
+ d.readU32(7, &data.m_imjRejFilterIndex, 0);
+ d.readU32(8, &data.m_bandwidthIndex, 0);
+ d.readU32(9, &data.m_vgaGain, 4);
+ d.readBool(10, &data.m_biasT, false);
+ d.readBool(11, &data.m_lnaExt, false);
return SampleSourceSerializer::readSerializedData(sampleSourceSerialized, data.m_data);
}
@@ -80,7 +84,9 @@ void HackRFSerializer::setDefaults(AirspyData& data)
data.m_log2Decim = 0;
data.m_fcPos = 0;
data.m_lnaGain = 14;
- data.m_mixerGain = 15;
+ data.m_imjRejFilterIndex = 0;
+ data.m_bandwidthIndex = 0;
data.m_vgaGain = 4;
data.m_biasT = false;
+ data.m_lnaExt = false;
}
diff --git a/plugins/samplesource/hackrf/hackrfserializer.h b/plugins/samplesource/hackrf/hackrfserializer.h
index 6de5f6dc6..3d84239ce 100644
--- a/plugins/samplesource/hackrf/hackrfserializer.h
+++ b/plugins/samplesource/hackrf/hackrfserializer.h
@@ -30,9 +30,11 @@ public:
quint32 m_log2Decim;
qint32 m_fcPos;
quint32 m_lnaGain;
- quint32 m_mixerGain;
+ quint32 m_imjRejFilterIndex;
+ quint32 m_bandwidthIndex;
quint32 m_vgaGain;
bool m_biasT;
+ bool m_lnaExt;
};
static void writeSerializedData(const AirspyData& data, QByteArray& serializedData);