HackRF: fixed bandwidth selection

pull/60/head
f4exb 2017-05-26 17:42:57 +02:00
rodzic 2ae702763b
commit 3b44a5367c
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -296,7 +296,7 @@ bool HackRFOutput::applySettings(const HackRFOutputSettings& settings, bool forc
{
if (m_dev != 0)
{
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(settings.m_bandwidth);
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(settings.m_bandwidth + 1); // +1 so the round down to lower than yields desired bandwidth
rc = (hackrf_error) hackrf_set_baseband_filter_bandwidth(m_dev, bw_index);
if (rc != HACKRF_SUCCESS)

Wyświetl plik

@ -185,7 +185,7 @@ bool HackRFInput::handleMessage(const Message& message)
MsgConfigureHackRF& conf = (MsgConfigureHackRF&) message;
qDebug() << "HackRFInput::handleMessage: MsgConfigureHackRF";
bool success = applySettings(conf.getSettings(), false);
bool success = applySettings(conf.getSettings(), conf.getForce());
if (!success)
{
@ -373,7 +373,7 @@ bool HackRFInput::applySettings(const HackRFInputSettings& settings, bool force)
if (m_dev != 0)
{
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(m_settings.m_bandwidth);
uint32_t bw_index = hackrf_compute_baseband_filter_bw_round_down_lt(m_settings.m_bandwidth + 1); // +1 so the round down to lower than yields desired bandwidth
rc = (hackrf_error) hackrf_set_baseband_filter_bandwidth(m_dev, bw_index);
if (rc != HACKRF_SUCCESS)