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

#include <remoteinputsettings.h>

Public Member Functions

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

Public Attributes

QString m_apiAddress
 
quint16 m_apiPort
 
QString m_dataAddress
 
quint16 m_dataPort
 
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 remoteinputsettings.h.

Constructor & Destructor Documentation

◆ RemoteInputSettings()

RemoteInputSettings::RemoteInputSettings ( )

Definition at line 21 of file remoteinputsettings.cpp.

References resetToDefaults().

22 {
24 }
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool RemoteInputSettings::deserialize ( const QByteArray &  data)

Definition at line 59 of file remoteinputsettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_apiAddress, m_apiPort, m_dataAddress, m_dataPort, m_dcBlock, m_iqCorrection, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, SimpleDeserializer::readBool(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by RemoteInputGui::deserialize(), and RemoteInput::deserialize().

60 {
61  SimpleDeserializer d(data);
62 
63  if (!d.isValid())
64  {
66  return false;
67  }
68 
69  if (d.getVersion() == 1)
70  {
71  quint32 uintval;
72 
73  d.readString(5, &m_apiAddress, "127.0.0.1");
74  d.readU32(6, &uintval, 9090);
75  m_apiPort = uintval % (1<<16);
76  d.readU32(7, &uintval, 9091);
77  m_dataPort = uintval % (1<<16);
78  d.readString(8, &m_dataAddress, "127.0.0.1");
79  d.readBool(9, &m_dcBlock, false);
80  d.readBool(10, &m_iqCorrection, false);
81  d.readBool(11, &m_useReverseAPI, false);
82  d.readString(12, &m_reverseAPIAddress, "127.0.0.1");
83  d.readU32(13, &uintval, 0);
84 
85  if ((uintval > 1023) && (uintval < 65535)) {
86  m_reverseAPIPort = uintval;
87  } else {
88  m_reverseAPIPort = 8888;
89  }
90 
91  d.readU32(14, &uintval, 0);
92  m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
93  return true;
94  }
95  else
96  {
98  return false;
99  }
100 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void RemoteInputSettings::resetToDefaults ( )

Definition at line 26 of file remoteinputsettings.cpp.

References m_apiAddress, m_apiPort, m_dataAddress, m_dataPort, m_dcBlock, m_fileRecordName, m_iqCorrection, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, and m_useReverseAPI.

Referenced by deserialize(), RemoteInput::deserialize(), RemoteInputSettings(), and RemoteInputGui::resetToDefaults().

27 {
28  m_apiAddress = "127.0.0.1";
29  m_apiPort = 9091;
30  m_dataAddress = "127.0.0.1";
31  m_dataPort = 9090;
32  m_dcBlock = false;
33  m_iqCorrection = false;
34  m_fileRecordName = "";
35  m_useReverseAPI = false;
36  m_reverseAPIAddress = "127.0.0.1";
37  m_reverseAPIPort = 8888;
39 }
+ Here is the caller graph for this function:

◆ serialize()

QByteArray RemoteInputSettings::serialize ( ) const

Definition at line 41 of file remoteinputsettings.cpp.

References SimpleSerializer::final(), m_apiAddress, m_apiPort, m_dataAddress, m_dataPort, m_dcBlock, m_iqCorrection, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by RemoteInputGui::serialize(), and RemoteInput::serialize().

42 {
43  SimpleSerializer s(1);
44 
45  s.writeString(5, m_apiAddress);
46  s.writeU32(6, m_apiPort);
47  s.writeU32(7, m_dataPort);
48  s.writeString(8, m_dataAddress);
49  s.writeBool(9, m_dcBlock);
50  s.writeBool(10, m_iqCorrection);
51  s.writeBool(11, m_useReverseAPI);
52  s.writeString(12, m_reverseAPIAddress);
53  s.writeU32(13, m_reverseAPIPort);
54  s.writeU32(14, m_reverseAPIDeviceIndex);
55 
56  return s.final();
57 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_apiAddress

QString RemoteInputSettings::m_apiAddress

◆ m_apiPort

quint16 RemoteInputSettings::m_apiPort

◆ m_dataAddress

QString RemoteInputSettings::m_dataAddress

◆ m_dataPort

quint16 RemoteInputSettings::m_dataPort

◆ m_dcBlock

bool RemoteInputSettings::m_dcBlock

◆ m_fileRecordName

QString RemoteInputSettings::m_fileRecordName

◆ m_iqCorrection

bool RemoteInputSettings::m_iqCorrection

◆ m_reverseAPIAddress

QString RemoteInputSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t RemoteInputSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t RemoteInputSettings::m_reverseAPIPort

◆ m_useReverseAPI

bool RemoteInputSettings::m_useReverseAPI

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