diff --git a/plugins/samplesource/hackrf/hackrfgui.cpp b/plugins/samplesource/hackrf/hackrfgui.cpp index 7378a42c6..3e94ae128 100644 --- a/plugins/samplesource/hackrf/hackrfgui.cpp +++ b/plugins/samplesource/hackrf/hackrfgui.cpp @@ -255,7 +255,7 @@ void HackRFGui::on_fcPos_currentIndexChanged(int index) void HackRFGui::on_lna_valueChanged(int value) { - if ((value < 0) || (value > 14)) + if ((value < 0) || (value > 40)) return; ui->lnaGainText->setText(tr("%1dB").arg(value)); @@ -265,7 +265,7 @@ void HackRFGui::on_lna_valueChanged(int value) void HackRFGui::on_vga_valueChanged(int value) { - if ((value < 0) || (value > 15)) + if ((value < 0) || (value > 62)) return; ui->vgaText->setText(tr("%1dB").arg(value)); @@ -281,7 +281,7 @@ void HackRFGui::updateHardware() m_updateTimer.stop(); } -unsigned int HackRFSampleRates::m_rates_k[] = {2400, 3200, 4800, 6400, 9680, 12800, 19200}; +unsigned int HackRFSampleRates::m_rates_k[] = {2500, 3200, 5000, 6400, 10000, 12800, 19200}; unsigned int HackRFSampleRates::getRate(unsigned int rate_index) { diff --git a/plugins/samplesource/hackrf/hackrfinput.cpp b/plugins/samplesource/hackrf/hackrfinput.cpp index 841dd0cfe..6ae700245 100644 --- a/plugins/samplesource/hackrf/hackrfinput.cpp +++ b/plugins/samplesource/hackrf/hackrfinput.cpp @@ -420,7 +420,7 @@ bool HackRFInput::applySettings(const Settings& settings, bool force) if(rc != HACKRF_SUCCESS) { - qDebug("HackRFInput::applySettings: airspy_set_rf_bias failed: %s", hackrf_error_name(rc)); + qDebug("HackRFInput::applySettings: hackrf_set_antenna_enable failed: %s", hackrf_error_name(rc)); } else { @@ -429,6 +429,25 @@ bool HackRFInput::applySettings(const Settings& settings, bool force) } } + if ((m_settings.m_lnaExt != settings.m_lnaExt) || force) + { + m_settings.m_lnaExt = settings.m_lnaExt; + + if (m_dev != 0) + { + rc = (hackrf_error) hackrf_set_amp_enable(m_dev, (m_settings.m_lnaExt ? 1 : 0)); + + if(rc != HACKRF_SUCCESS) + { + qDebug("HackRFInput::applySettings: hackrf_set_amp_enable failed: %s", hackrf_error_name(rc)); + } + else + { + qDebug() << "HackRFInput:applySettings: extra LNA set to " << m_settings.m_lnaExt; + } + } + } + if (forwardChange) { int sampleRate = devSampleRate/(1<