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

#include <remoteoutputsettings.h>

Public Member Functions

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

Public Attributes

quint64 m_centerFrequency
 
quint32 m_sampleRate
 
float m_txDelay
 
quint32 m_nbFECBlocks
 
QString m_apiAddress
 
quint16 m_apiPort
 
QString m_dataAddress
 
quint16 m_dataPort
 
quint32 m_deviceIndex
 
quint32 m_channelIndex
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 

Detailed Description

Definition at line 24 of file remoteoutputsettings.h.

Constructor & Destructor Documentation

◆ RemoteOutputSettings()

RemoteOutputSettings::RemoteOutputSettings ( )

Definition at line 21 of file remoteoutputsettings.cpp.

References resetToDefaults().

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

Member Function Documentation

◆ deserialize()

bool RemoteOutputSettings::deserialize ( const QByteArray &  data)

Definition at line 66 of file remoteoutputsettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_apiAddress, m_apiPort, m_centerFrequency, m_channelIndex, m_dataAddress, m_dataPort, m_deviceIndex, m_nbFECBlocks, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_sampleRate, m_txDelay, m_useReverseAPI, SimpleDeserializer::readBool(), SimpleDeserializer::readFloat(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), SimpleDeserializer::readU64(), and resetToDefaults().

Referenced by RemoteOutputSinkGui::deserialize(), and RemoteOutput::deserialize().

67 {
68  SimpleDeserializer d(data);
69 
70  if (!d.isValid())
71  {
73  return false;
74  }
75 
76  if (d.getVersion() == 1)
77  {
78  quint32 uintval;
79 
80  d.readU64(1, &m_centerFrequency, 435000*1000);
81  d.readU32(2, &m_sampleRate, 48000);
82  d.readFloat(3, &m_txDelay, 0.5);
83  d.readU32(4, &m_nbFECBlocks, 0);
84  d.readString(5, &m_apiAddress, "127.0.0.1");
85  d.readU32(6, &uintval, 9090);
86  m_apiPort = uintval % (1<<16);
87  d.readString(7, &m_dataAddress, "127.0.0.1");
88  d.readU32(8, &uintval, 9090);
89  m_dataPort = uintval % (1<<16);
90  d.readU32(10, &m_deviceIndex, 0);
91  d.readU32(11, &m_channelIndex, 0);
92  d.readBool(12, &m_useReverseAPI, false);
93  d.readString(13, &m_reverseAPIAddress, "127.0.0.1");
94  d.readU32(14, &uintval, 0);
95 
96  if ((uintval > 1023) && (uintval < 65535)) {
97  m_reverseAPIPort = uintval;
98  } else {
99  m_reverseAPIPort = 8888;
100  }
101 
102  d.readU32(15, &uintval, 0);
103  m_reverseAPIDeviceIndex = uintval > 99 ? 99 : uintval;
104 
105  return true;
106  }
107  else
108  {
109  resetToDefaults();
110  return false;
111  }
112 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void RemoteOutputSettings::resetToDefaults ( )

Definition at line 26 of file remoteoutputsettings.cpp.

References m_apiAddress, m_apiPort, m_centerFrequency, m_channelIndex, m_dataAddress, m_dataPort, m_deviceIndex, m_nbFECBlocks, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_sampleRate, m_txDelay, and m_useReverseAPI.

Referenced by deserialize(), RemoteOutput::deserialize(), RemoteOutputSettings(), and RemoteOutputSinkGui::resetToDefaults().

27 {
28  m_centerFrequency = 435000*1000;
29  m_sampleRate = 48000;
30  m_txDelay = 0.35;
31  m_nbFECBlocks = 0;
32  m_apiAddress = "127.0.0.1";
33  m_apiPort = 9091;
34  m_dataAddress = "127.0.0.1";
35  m_dataPort = 9090;
36  m_deviceIndex = 0;
37  m_channelIndex = 0;
38  m_useReverseAPI = false;
39  m_reverseAPIAddress = "127.0.0.1";
40  m_reverseAPIPort = 8888;
42 }
+ Here is the caller graph for this function:

◆ serialize()

QByteArray RemoteOutputSettings::serialize ( ) const

Definition at line 44 of file remoteoutputsettings.cpp.

References SimpleSerializer::final(), m_apiAddress, m_apiPort, m_centerFrequency, m_channelIndex, m_dataAddress, m_dataPort, m_deviceIndex, m_nbFECBlocks, m_reverseAPIAddress, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_sampleRate, m_txDelay, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeFloat(), SimpleSerializer::writeString(), SimpleSerializer::writeU32(), and SimpleSerializer::writeU64().

Referenced by RemoteOutputSinkGui::serialize(), and RemoteOutput::serialize().

45 {
46  SimpleSerializer s(1);
47 
48  s.writeU64(1, m_centerFrequency);
49  s.writeU32(2, m_sampleRate);
50  s.writeFloat(3, m_txDelay);
51  s.writeU32(4, m_nbFECBlocks);
52  s.writeString(5, m_apiAddress);
53  s.writeU32(6, m_apiPort);
54  s.writeString(7, m_dataAddress);
55  s.writeU32(8, m_dataPort);
56  s.writeU32(10, m_deviceIndex);
57  s.writeU32(11, m_channelIndex);
58  s.writeBool(12, m_useReverseAPI);
59  s.writeString(13, m_reverseAPIAddress);
60  s.writeU32(14, m_reverseAPIPort);
61  s.writeU32(15, 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_apiAddress

QString RemoteOutputSettings::m_apiAddress

◆ m_apiPort

quint16 RemoteOutputSettings::m_apiPort

◆ m_centerFrequency

quint64 RemoteOutputSettings::m_centerFrequency

Definition at line 25 of file remoteoutputsettings.h.

Referenced by deserialize(), resetToDefaults(), and serialize().

◆ m_channelIndex

quint32 RemoteOutputSettings::m_channelIndex

◆ m_dataAddress

QString RemoteOutputSettings::m_dataAddress

◆ m_dataPort

quint16 RemoteOutputSettings::m_dataPort

◆ m_deviceIndex

quint32 RemoteOutputSettings::m_deviceIndex

◆ m_nbFECBlocks

quint32 RemoteOutputSettings::m_nbFECBlocks

◆ m_reverseAPIAddress

QString RemoteOutputSettings::m_reverseAPIAddress

◆ m_reverseAPIDeviceIndex

uint16_t RemoteOutputSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t RemoteOutputSettings::m_reverseAPIPort

◆ m_sampleRate

quint32 RemoteOutputSettings::m_sampleRate

◆ m_txDelay

float RemoteOutputSettings::m_txDelay

◆ m_useReverseAPI

bool RemoteOutputSettings::m_useReverseAPI

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