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

#include <bladerf1inputsettings.h>

Public Types

enum  fcPos_t { FC_POS_INFRA = 0, FC_POS_SUPRA, FC_POS_CENTER }
 

Public Member Functions

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

Public Attributes

quint64 m_centerFrequency
 
qint32 m_devSampleRate
 
qint32 m_lnaGain
 
qint32 m_vga1
 
qint32 m_vga2
 
qint32 m_bandwidth
 
quint32 m_log2Decim
 
fcPos_t m_fcPos
 
bool m_xb200
 
bladerf_xb200_path m_xb200Path
 
bladerf_xb200_filter m_xb200Filter
 
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 25 of file bladerf1inputsettings.h.

Member Enumeration Documentation

◆ fcPos_t

Constructor & Destructor Documentation

◆ BladeRF1InputSettings()

BladeRF1InputSettings::BladeRF1InputSettings ( )

Definition at line 24 of file bladerf1inputsettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool BladeRF1InputSettings::deserialize ( const QByteArray &  data)

Definition at line 75 of file bladerf1inputsettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_bandwidth, m_dcBlock, m_devSampleRate, m_fcPos, m_iqCorrection, m_lnaGain, m_log2Decim, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, m_vga1, m_vga2, m_xb200, m_xb200Filter, m_xb200Path, SimpleDeserializer::readBool(), SimpleDeserializer::readS32(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by Bladerf1InputGui::deserialize(), and Bladerf1Input::deserialize().

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

◆ resetToDefaults()

void BladeRF1InputSettings::resetToDefaults ( )

Definition at line 29 of file bladerf1inputsettings.cpp.

References FC_POS_INFRA, m_bandwidth, m_centerFrequency, m_dcBlock, m_devSampleRate, m_fcPos, m_fileRecordName, m_iqCorrection, m_lnaGain, m_log2Decim, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, m_vga1, m_vga2, m_xb200, m_xb200Filter, and m_xb200Path.

Referenced by BladeRF1InputSettings(), deserialize(), Bladerf1Input::deserialize(), and Bladerf1InputGui::resetToDefaults().

30 {
31  m_centerFrequency = 435000*1000;
32  m_devSampleRate = 3072000;
33  m_lnaGain = 0;
34  m_vga1 = 20;
35  m_vga2 = 9;
36  m_bandwidth = 1500000;
37  m_log2Decim = 0;
39  m_xb200 = false;
40  m_xb200Path = BLADERF_XB200_MIX;
41  m_xb200Filter = BLADERF_XB200_AUTO_1DB;
42  m_dcBlock = false;
43  m_iqCorrection = false;
44  m_fileRecordName = "";
45  m_useReverseAPI = false;
46  m_reverseAPIAddress = "127.0.0.1";
47  m_reverseAPIPort = 8888;
49 }
bladerf_xb200_filter m_xb200Filter
bladerf_xb200_path m_xb200Path
+ Here is the caller graph for this function:

◆ serialize()

QByteArray BladeRF1InputSettings::serialize ( ) const

Definition at line 51 of file bladerf1inputsettings.cpp.

References SimpleSerializer::final(), m_bandwidth, m_dcBlock, m_devSampleRate, m_fcPos, m_iqCorrection, m_lnaGain, m_log2Decim, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, m_vga1, m_vga2, m_xb200, m_xb200Filter, m_xb200Path, SimpleSerializer::writeBool(), SimpleSerializer::writeS32(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by Bladerf1InputGui::serialize(), and Bladerf1Input::serialize().

52 {
53  SimpleSerializer s(1);
54 
55  s.writeS32(1, m_devSampleRate);
56  s.writeS32(2, m_lnaGain);
57  s.writeS32(3, m_vga1);
58  s.writeS32(4, m_vga2);
59  s.writeS32(5, m_bandwidth);
60  s.writeU32(6, m_log2Decim);
61  s.writeS32(7, (int) m_fcPos);
62  s.writeBool(8, m_xb200);
63  s.writeS32(9, (int) m_xb200Path);
64  s.writeS32(10, (int) m_xb200Filter);
65  s.writeBool(11, m_dcBlock);
66  s.writeBool(12, m_iqCorrection);
67  s.writeBool(13, m_useReverseAPI);
68  s.writeString(14, m_reverseAPIAddress);
69  s.writeU32(15, m_reverseAPIPort);
70  s.writeU32(16, m_reverseAPIDeviceIndex);
71 
72  return s.final();
73 }
bladerf_xb200_filter m_xb200Filter
bladerf_xb200_path m_xb200Path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bandwidth

qint32 BladeRF1InputSettings::m_bandwidth

◆ m_centerFrequency

quint64 BladeRF1InputSettings::m_centerFrequency

◆ m_dcBlock

bool BladeRF1InputSettings::m_dcBlock

◆ m_devSampleRate

qint32 BladeRF1InputSettings::m_devSampleRate

◆ m_fcPos

fcPos_t BladeRF1InputSettings::m_fcPos

◆ m_fileRecordName

QString BladeRF1InputSettings::m_fileRecordName

◆ m_iqCorrection

bool BladeRF1InputSettings::m_iqCorrection

◆ m_lnaGain

qint32 BladeRF1InputSettings::m_lnaGain

◆ m_log2Decim

quint32 BladeRF1InputSettings::m_log2Decim

◆ m_reverseAPIAddress

QString BladeRF1InputSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t BladeRF1InputSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t BladeRF1InputSettings::m_reverseAPIPort

◆ m_useReverseAPI

bool BladeRF1InputSettings::m_useReverseAPI

◆ m_vga1

qint32 BladeRF1InputSettings::m_vga1

◆ m_vga2

qint32 BladeRF1InputSettings::m_vga2

◆ m_xb200

bool BladeRF1InputSettings::m_xb200

◆ m_xb200Filter

bladerf_xb200_filter BladeRF1InputSettings::m_xb200Filter

◆ m_xb200Path

bladerf_xb200_path BladeRF1InputSettings::m_xb200Path

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