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
HackRFOutputSettings Struct Reference

#include <hackrfoutputsettings.h>

Public Types

enum  fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER }
 

Public Member Functions

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

Public Attributes

quint64 m_centerFrequency
 
qint32 m_LOppmTenths
 
quint32 m_bandwidth
 
quint32 m_vgaGain
 
quint32 m_log2Interp
 
fcPos_t m_fcPos
 
quint64 m_devSampleRate
 
bool m_biasT
 
bool m_lnaExt
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 

Detailed Description

Definition at line 24 of file hackrfoutputsettings.h.

Member Enumeration Documentation

◆ fcPos_t

Constructor & Destructor Documentation

◆ HackRFOutputSettings()

HackRFOutputSettings::HackRFOutputSettings ( )

Definition at line 24 of file hackrfoutputsettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool HackRFOutputSettings::deserialize ( const QByteArray &  data)

Definition at line 66 of file hackrfoutputsettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_bandwidth, m_biasT, m_devSampleRate, m_fcPos, m_lnaExt, m_log2Interp, 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 HackRFOutputGui::deserialize(), and HackRFOutput::deserialize().

67 {
68  SimpleDeserializer d(data);
69 
70  if (!d.isValid())
71  {
73  return false;
74  }
75 
76  if (d.getVersion() == 1)
77  {
78  uint32_t uintval;
79  int32_t intval;
80 
81  d.readS32(1, &m_LOppmTenths, 0);
82  d.readS32(2, &intval, 2);
83  m_fcPos = (fcPos_t) (intval < 0 ? 0 : intval > 2 ? 2 : intval);
84  d.readBool(3, &m_biasT, false);
85  d.readU32(4, &m_log2Interp, 0);
86  d.readBool(5, &m_lnaExt, false);
87  d.readU32(6, &m_vgaGain, 30);
88  d.readU32(7, &m_bandwidth, 1750000);
89  d.readU64(8, &m_devSampleRate, 2400000);
90  d.readBool(9, &m_useReverseAPI, false);
91  d.readString(10, &m_reverseAPIAddress, "127.0.0.1");
92  d.readU32(11, &uintval, 0);
93 
94  if ((uintval > 1023) && (uintval < 65535)) {
95  m_reverseAPIPort = uintval;
96  } else {
97  m_reverseAPIPort = 8888;
98  }
99 
100  d.readU32(12, &uintval, 0);
101  m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
102 
103  return true;
104  }
105  else
106  {
107  resetToDefaults();
108  return false;
109  }
110 }
unsigned int uint32_t
Definition: rtptypes_win.h:46
int int32_t
Definition: rtptypes_win.h:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void HackRFOutputSettings::resetToDefaults ( )

Definition at line 29 of file hackrfoutputsettings.cpp.

References FC_POS_CENTER, m_bandwidth, m_biasT, m_centerFrequency, m_devSampleRate, m_fcPos, m_lnaExt, m_log2Interp, m_LOppmTenths, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, and m_vgaGain.

Referenced by deserialize(), HackRFOutput::deserialize(), HackRFOutputSettings(), and HackRFOutputGui::resetToDefaults().

30 {
31  m_centerFrequency = 435000 * 1000;
32  m_LOppmTenths = 0;
33  m_biasT = false;
34  m_log2Interp = 0;
36  m_lnaExt = false;
37  m_vgaGain = 22;
38  m_bandwidth = 1750000;
39  m_devSampleRate = 2400000;
40  m_useReverseAPI = false;
41  m_reverseAPIAddress = "127.0.0.1";
42  m_reverseAPIPort = 8888;
44 }
+ Here is the caller graph for this function:

◆ serialize()

QByteArray HackRFOutputSettings::serialize ( ) const

Definition at line 46 of file hackrfoutputsettings.cpp.

References SimpleSerializer::final(), m_bandwidth, m_biasT, m_devSampleRate, m_fcPos, m_lnaExt, m_log2Interp, 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 HackRFOutputGui::serialize(), and HackRFOutput::serialize().

47 {
48  SimpleSerializer s(1);
49 
50  s.writeS32(1, m_LOppmTenths);
51  s.writeS32(2, (int) m_fcPos);
52  s.writeBool(3, m_biasT);
53  s.writeU32(4, m_log2Interp);
54  s.writeBool(5, m_lnaExt);
55  s.writeU32(6, m_vgaGain);
56  s.writeU32(7, m_bandwidth);
57  s.writeU64(8, m_devSampleRate);
58  s.writeBool(9, m_useReverseAPI);
59  s.writeString(10, m_reverseAPIAddress);
60  s.writeU32(11, m_reverseAPIPort);
61  s.writeU32(12, m_reverseAPIDeviceIndex);
62 
63  return s.final();
64 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bandwidth

quint32 HackRFOutputSettings::m_bandwidth

◆ m_biasT

bool HackRFOutputSettings::m_biasT

◆ m_centerFrequency

quint64 HackRFOutputSettings::m_centerFrequency

◆ m_devSampleRate

quint64 HackRFOutputSettings::m_devSampleRate

◆ m_fcPos

fcPos_t HackRFOutputSettings::m_fcPos

◆ m_lnaExt

bool HackRFOutputSettings::m_lnaExt

◆ m_log2Interp

quint32 HackRFOutputSettings::m_log2Interp

◆ m_LOppmTenths

qint32 HackRFOutputSettings::m_LOppmTenths

◆ m_reverseAPIAddress

QString HackRFOutputSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t HackRFOutputSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t HackRFOutputSettings::m_reverseAPIPort

◆ m_useReverseAPI

bool HackRFOutputSettings::m_useReverseAPI

◆ m_vgaGain

quint32 HackRFOutputSettings::m_vgaGain

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