SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Types | Public Member Functions | Public Attributes | List of all members
HackRFInputSettings Struct Reference

#include <hackrfinputsettings.h>

Public Types

enum  fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER }
 

Public Member Functions

 HackRFInputSettings ()
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

quint64 m_centerFrequency
 
qint32 m_LOppmTenths
 
quint32 m_bandwidth
 
quint32 m_lnaGain
 
quint32 m_vgaGain
 
quint32 m_log2Decim
 
fcPos_t m_fcPos
 
quint64 m_devSampleRate
 
bool m_biasT
 
bool m_lnaExt
 
bool m_dcBlock
 
bool m_iqCorrection
 
QString m_fileRecordName
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 

Detailed Description

Definition at line 24 of file hackrfinputsettings.h.

Member Enumeration Documentation

◆ fcPos_t

Constructor & Destructor Documentation

◆ HackRFInputSettings()

HackRFInputSettings::HackRFInputSettings ( )

Definition at line 24 of file hackrfinputsettings.cpp.

References resetToDefaults().

25 {
27 }
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool HackRFInputSettings::deserialize ( const QByteArray &  data)

Definition at line 73 of file hackrfinputsettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_bandwidth, m_biasT, m_dcBlock, m_devSampleRate, m_fcPos, m_iqCorrection, m_lnaExt, m_lnaGain, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, m_vgaGain, SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), SimpleDeserializer::readU64(), and resetToDefaults().

Referenced by HackRFInputGui::deserialize(), and HackRFInput::deserialize().

74 {
75  SimpleDeserializer d(data);
76 
77  if (!d.isValid())
78  {
80  return false;
81  }
82 
83  if (d.getVersion() == 1)
84  {
85  int intval;
86  uint32_t uintval;
87 
88  d.readS32(1, &m_LOppmTenths, 0);
89  d.readBool(3, &m_biasT, false);
90  d.readU32(4, &m_log2Decim, 0);
91  d.readS32(5, &intval, 0);
92  m_fcPos = (fcPos_t) intval;
93  d.readBool(6, &m_lnaExt, false);
94  d.readU32(7, &m_lnaGain, 16);
95  d.readU32(8, &m_bandwidth, 1750000);
96  d.readU32(9, &m_vgaGain, 16);
97  d.readBool(10, &m_dcBlock, false);
98  d.readBool(11, &m_iqCorrection, false);
99  d.readU64(12, &m_devSampleRate, 2400000U);
100  d.readBool(14, &m_useReverseAPI, false);
101  d.readString(15, &m_reverseAPIAddress, "127.0.0.1");
102  d.readU32(16, &uintval, 0);
103 
104  if ((uintval > 1023) && (uintval < 65535)) {
105  m_reverseAPIPort = uintval;
106  } else {
107  m_reverseAPIPort = 8888;
108  }
109 
110  d.readU32(17, &uintval, 0);
111  m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
112 
113  return true;
114  }
115  else
116  {
117  resetToDefaults();
118  return false;
119  }
120 }
unsigned int uint32_t
Definition: rtptypes_win.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void HackRFInputSettings::resetToDefaults ( )

Definition at line 29 of file hackrfinputsettings.cpp.

References FC_POS_CENTER, m_bandwidth, m_biasT, m_centerFrequency, m_dcBlock, m_devSampleRate, m_fcPos, m_fileRecordName, m_iqCorrection, m_lnaExt, m_lnaGain, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, and m_vgaGain.

Referenced by deserialize(), HackRFInput::deserialize(), HackRFInputSettings(), and HackRFInputGui::resetToDefaults().

30 {
31  m_centerFrequency = 435000 * 1000;
32  m_LOppmTenths = 0;
33  m_biasT = false;
34  m_log2Decim = 0;
36  m_lnaExt = false;
37  m_lnaGain = 16;
38  m_bandwidth = 1750000;
39  m_vgaGain = 16;
40  m_dcBlock = false;
41  m_iqCorrection = false;
42  m_devSampleRate = 2400000;
43  m_fileRecordName = "";
44  m_useReverseAPI = false;
45  m_reverseAPIAddress = "127.0.0.1";
46  m_reverseAPIPort = 8888;
48 }
+ Here is the caller graph for this function:

◆ serialize()

QByteArray HackRFInputSettings::serialize ( ) const

Definition at line 50 of file hackrfinputsettings.cpp.

References SimpleSerializer::final(), m_bandwidth, m_biasT, m_dcBlock, m_devSampleRate, m_fcPos, m_iqCorrection, m_lnaExt, m_lnaGain, m_log2Decim, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, m_vgaGain, SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), SimpleSerializer::writeU32(), and SimpleSerializer::writeU64().

Referenced by HackRFInputGui::serialize(), and HackRFInput::serialize().

51 {
52  SimpleSerializer s(1);
53 
54  s.writeS32(1, m_LOppmTenths);
55  s.writeBool(3, m_biasT);
56  s.writeU32(4, m_log2Decim);
57  s.writeS32(5, m_fcPos);
58  s.writeBool(6, m_lnaExt);
59  s.writeU32(7, m_lnaGain);
60  s.writeU32(8, m_bandwidth);
61  s.writeU32(9, m_vgaGain);
62  s.writeBool(10, m_dcBlock);
63  s.writeBool(11, m_iqCorrection);
64  s.writeU64(12, m_devSampleRate);
65  s.writeBool(14, m_useReverseAPI);
66  s.writeString(15, m_reverseAPIAddress);
67  s.writeU32(16, m_reverseAPIPort);
68  s.writeU32(17, m_reverseAPIDeviceIndex);
69 
70  return s.final();
71 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bandwidth

quint32 HackRFInputSettings::m_bandwidth

◆ m_biasT

bool HackRFInputSettings::m_biasT

◆ m_centerFrequency

quint64 HackRFInputSettings::m_centerFrequency

◆ m_dcBlock

bool HackRFInputSettings::m_dcBlock

◆ m_devSampleRate

quint64 HackRFInputSettings::m_devSampleRate

◆ m_fcPos

fcPos_t HackRFInputSettings::m_fcPos

◆ m_fileRecordName

QString HackRFInputSettings::m_fileRecordName

◆ m_iqCorrection

bool HackRFInputSettings::m_iqCorrection

◆ m_lnaExt

bool HackRFInputSettings::m_lnaExt

◆ m_lnaGain

quint32 HackRFInputSettings::m_lnaGain

◆ m_log2Decim

quint32 HackRFInputSettings::m_log2Decim

◆ m_LOppmTenths

qint32 HackRFInputSettings::m_LOppmTenths

◆ m_reverseAPIAddress

QString HackRFInputSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t HackRFInputSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t HackRFInputSettings::m_reverseAPIPort

◆ m_useReverseAPI

bool HackRFInputSettings::m_useReverseAPI

◆ m_vgaGain

quint32 HackRFInputSettings::m_vgaGain

The documentation for this struct was generated from the following files: