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 Member Functions | Public Attributes | List of all members
KiwiSDRSettings Struct Reference

#include <kiwisdrsettings.h>

Public Member Functions

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

Public Attributes

uint32_t m_gain
 
bool m_useAGC
 
bool m_dcBlock
 
quint64 m_centerFrequency
 
QString m_serverAddress
 
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 kiwisdrsettings.h.

Constructor & Destructor Documentation

◆ KiwiSDRSettings()

KiwiSDRSettings::KiwiSDRSettings ( )

Definition at line 22 of file kiwisdrsettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool KiwiSDRSettings::deserialize ( const QByteArray &  data)

Definition at line 60 of file kiwisdrsettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_gain, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_serverAddress, m_useAGC, m_useReverseAPI, SimpleDeserializer::readBool(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by KiwiSDRGui::deserialize(), and KiwiSDRInput::deserialize().

61 {
62  SimpleDeserializer d(data);
63 
64  if (!d.isValid())
65  {
67  return false;
68  }
69 
70  if (d.getVersion() == 2)
71  {
72  uint32_t utmp;
73 
74  d.readString(2, &m_serverAddress, "127.0.0.1:8073");
75  d.readU32(3, &m_gain, 20);
76  d.readBool(4, &m_useAGC, true);
77 
78  d.readBool(100, &m_useReverseAPI, false);
79  d.readString(101, &m_reverseAPIAddress, "127.0.0.1");
80  d.readU32(102, &utmp, 0);
81 
82  if ((utmp > 1023) && (utmp < 65535)) {
83  m_reverseAPIPort = utmp;
84  }
85  else {
86  m_reverseAPIPort = 8888;
87  }
88 
89  d.readU32(103, &utmp, 0);
90  m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp;
91 
92  return true;
93  }
94  else
95  {
97  return false;
98  }
99 }
QString m_serverAddress
QString m_reverseAPIAddress
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIPort
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void KiwiSDRSettings::resetToDefaults ( )

Definition at line 27 of file kiwisdrsettings.cpp.

References m_centerFrequency, m_dcBlock, m_fileRecordName, m_gain, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_serverAddress, m_useAGC, and m_useReverseAPI.

Referenced by deserialize(), KiwiSDRInput::deserialize(), KiwiSDRSettings(), and KiwiSDRGui::resetToDefaults().

28 {
29  m_centerFrequency = 1450000;
30 
31  m_gain = 20;
32  m_useAGC = true;
33  m_dcBlock = false;
34 
35  m_serverAddress = "127.0.0.1:8073";
36 
37  m_fileRecordName = "";
38  m_useReverseAPI = false;
39  m_reverseAPIAddress = "127.0.0.1";
40  m_reverseAPIPort = 8888;
42 }
QString m_serverAddress
QString m_reverseAPIAddress
uint16_t m_reverseAPIDeviceIndex
QString m_fileRecordName
uint16_t m_reverseAPIPort
quint64 m_centerFrequency
+ Here is the caller graph for this function:

◆ serialize()

QByteArray KiwiSDRSettings::serialize ( ) const

Definition at line 44 of file kiwisdrsettings.cpp.

References SimpleSerializer::final(), m_gain, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_serverAddress, m_useAGC, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by KiwiSDRGui::serialize(), and KiwiSDRInput::serialize().

45 {
46  SimpleSerializer s(2);
47 
48  s.writeString(2, m_serverAddress);
49  s.writeU32(3, m_gain);
50  s.writeBool(4, m_useAGC);
51 
52  s.writeBool(100, m_useReverseAPI);
53  s.writeString(101, m_reverseAPIAddress);
54  s.writeU32(102, m_reverseAPIPort);
55  s.writeU32(103, m_reverseAPIDeviceIndex);
56 
57  return s.final();
58 }
QString m_serverAddress
QString m_reverseAPIAddress
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIPort
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_centerFrequency

quint64 KiwiSDRSettings::m_centerFrequency

◆ m_dcBlock

bool KiwiSDRSettings::m_dcBlock

◆ m_fileRecordName

QString KiwiSDRSettings::m_fileRecordName

◆ m_gain

uint32_t KiwiSDRSettings::m_gain

◆ m_reverseAPIAddress

QString KiwiSDRSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t KiwiSDRSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t KiwiSDRSettings::m_reverseAPIPort

◆ m_serverAddress

QString KiwiSDRSettings::m_serverAddress

◆ m_useAGC

bool KiwiSDRSettings::m_useAGC

◆ m_useReverseAPI

bool KiwiSDRSettings::m_useReverseAPI

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