1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

HackRF input plugin: use actual sample rate and bandwidth values not indexes

This commit is contained in:
f4exb
2017-01-08 02:48:01 +01:00
parent a02b78d24d
commit 1a8d96d874
9 changed files with 163 additions and 120 deletions
@@ -29,13 +29,13 @@ void HackRFInputSettings::resetToDefaults()
{
m_centerFrequency = 435000 * 1000;
m_LOppmTenths = 0;
m_devSampleRateIndex = 0;
m_devSampleRate = 2400000;
m_biasT = false;
m_log2Decim = 0;
m_fcPos = FC_POS_CENTER;
m_lnaExt = false;
m_lnaGain = 16;
m_bandwidthIndex = 0;
m_bandwidth = 1750000;
m_vgaGain = 16;
m_dcBlock = false;
m_iqCorrection = false;
@@ -46,13 +46,13 @@ QByteArray HackRFInputSettings::serialize() const
SimpleSerializer s(1);
s.writeS32(1, m_LOppmTenths);
s.writeU32(2, m_devSampleRateIndex);
s.writeU32(2, m_devSampleRate);
s.writeBool(3, m_biasT);
s.writeU32(4, m_log2Decim);
s.writeS32(5, m_fcPos);
s.writeBool(6, m_lnaExt);
s.writeU32(7, m_lnaGain);
s.writeU32(8, m_bandwidthIndex);
s.writeU32(8, m_bandwidth);
s.writeU32(9, m_vgaGain);
s.writeBool(10, m_dcBlock);
s.writeBool(11, m_iqCorrection);
@@ -75,14 +75,14 @@ bool HackRFInputSettings::deserialize(const QByteArray& data)
int intval;
d.readS32(1, &m_LOppmTenths, 0);
d.readU32(2, &m_devSampleRateIndex, 0);
d.readU32(2, &m_devSampleRate, 2400000);
d.readBool(3, &m_biasT, false);
d.readU32(4, &m_log2Decim, 0);
d.readS32(5, &intval, 0);
m_fcPos = (fcPos_t) intval;
d.readBool(6, &m_lnaExt, false);
d.readU32(7, &m_lnaGain, 16);
d.readU32(8, &m_bandwidthIndex, 0);
d.readU32(8, &m_bandwidth, 1750000);
d.readU32(9, &m_vgaGain, 16);
d.readBool(10, &m_dcBlock, false);
d.readBool(11, &m_iqCorrection, false);