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

#include <remotesinksettings.h>

+ Collaboration diagram for RemoteSinkSettings:

Public Member Functions

 RemoteSinkSettings ()
 
void resetToDefaults ()
 
void setChannelMarker (Serializable *channelMarker)
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 

Public Attributes

uint16_t m_nbFECBlocks
 
uint32_t m_txDelay
 
QString m_dataAddress
 
uint16_t m_dataPort
 
quint32 m_rgbColor
 
QString m_title
 
uint32_t m_log2Decim
 
uint32_t m_filterChainHash
 
bool m_useReverseAPI
 
QString m_reverseAPIAddress
 
uint16_t m_reverseAPIPort
 
uint16_t m_reverseAPIDeviceIndex
 
uint16_t m_reverseAPIChannelIndex
 
Serializablem_channelMarker
 

Detailed Description

Definition at line 32 of file remotesinksettings.h.

Constructor & Destructor Documentation

◆ RemoteSinkSettings()

RemoteSinkSettings::RemoteSinkSettings ( )

Definition at line 32 of file remotesinksettings.cpp.

References resetToDefaults().

33 {
35 }
+ Here is the call graph for this function:

Member Function Documentation

◆ deserialize()

bool RemoteSinkSettings::deserialize ( const QByteArray &  data)

Definition at line 75 of file remotesinksettings.cpp.

References SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_dataAddress, m_dataPort, m_filterChainHash, m_log2Decim, m_nbFECBlocks, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, m_txDelay, m_useReverseAPI, SimpleDeserializer::readBool(), SimpleDeserializer::readString(), SimpleDeserializer::readU32(), and resetToDefaults().

Referenced by RemoteSinkGUI::deserialize(), RemoteSink::deserialize(), and setChannelMarker().

76 {
77  SimpleDeserializer d(data);
78 
79  if(!d.isValid())
80  {
82  return false;
83  }
84 
85  if(d.getVersion() == 1)
86  {
87  uint32_t tmp;
88  QString strtmp;
89 
90  d.readU32(1, &tmp, 0);
91 
92  if (tmp < 128) {
93  m_nbFECBlocks = tmp;
94  } else {
95  m_nbFECBlocks = 0;
96  }
97 
98  d.readU32(2, &m_txDelay, 35);
99  d.readString(3, &m_dataAddress, "127.0.0.1");
100  d.readU32(4, &tmp, 0);
101 
102  if ((tmp > 1023) && (tmp < 65535)) {
103  m_dataPort = tmp;
104  } else {
105  m_dataPort = 9090;
106  }
107 
108  d.readU32(5, &m_rgbColor, QColor(0, 255, 255).rgb());
109  d.readString(6, &m_title, "Remote sink");
110  d.readBool(7, &m_useReverseAPI, false);
111  d.readString(8, &m_reverseAPIAddress, "127.0.0.1");
112  d.readU32(9, &tmp, 0);
113 
114  if ((tmp > 1023) && (tmp < 65535)) {
115  m_reverseAPIPort = tmp;
116  } else {
117  m_reverseAPIPort = 8888;
118  }
119 
120  d.readU32(10, &tmp, 0);
121  m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp;
122  d.readU32(11, &tmp, 0);
123  m_reverseAPIChannelIndex = tmp > 99 ? 99 : tmp;
124  d.readU32(12, &tmp, 0);
125  m_log2Decim = tmp > 6 ? 6 : tmp;
126  d.readU32(13, &m_filterChainHash, 0);
127 
128  return true;
129  }
130  else
131  {
132  resetToDefaults();
133  return false;
134  }
135 }
uint16_t m_reverseAPIDeviceIndex
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint16_t m_reverseAPIChannelIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetToDefaults()

void RemoteSinkSettings::resetToDefaults ( )

Definition at line 37 of file remotesinksettings.cpp.

References m_channelMarker, m_dataAddress, m_dataPort, m_filterChainHash, m_log2Decim, m_nbFECBlocks, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, m_txDelay, and m_useReverseAPI.

Referenced by deserialize(), RemoteSink::deserialize(), RemoteSinkSettings(), and RemoteSinkGUI::resetToDefaults().

38 {
39  m_nbFECBlocks = 0;
40  m_txDelay = 35;
41  m_dataAddress = "127.0.0.1";
42  m_dataPort = 9090;
43  m_rgbColor = QColor(140, 4, 4).rgb();
44  m_title = "Remote sink";
45  m_log2Decim = 0;
47  m_channelMarker = nullptr;
48  m_useReverseAPI = false;
49  m_reverseAPIAddress = "127.0.0.1";
50  m_reverseAPIPort = 8888;
53 }
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
Serializable * m_channelMarker
+ Here is the caller graph for this function:

◆ serialize()

QByteArray RemoteSinkSettings::serialize ( ) const

Definition at line 55 of file remotesinksettings.cpp.

References SimpleSerializer::final(), m_dataAddress, m_dataPort, m_filterChainHash, m_log2Decim, m_nbFECBlocks, m_reverseAPIAddress, m_reverseAPIChannelIndex, m_reverseAPIDeviceIndex, m_reverseAPIPort, m_rgbColor, m_title, m_txDelay, m_useReverseAPI, SimpleSerializer::writeBool(), SimpleSerializer::writeString(), and SimpleSerializer::writeU32().

Referenced by RemoteSinkGUI::serialize(), RemoteSink::serialize(), and setChannelMarker().

56 {
57  SimpleSerializer s(1);
58  s.writeU32(1, m_nbFECBlocks);
59  s.writeU32(2, m_txDelay);
60  s.writeString(3, m_dataAddress);
61  s.writeU32(4, m_dataPort);
62  s.writeU32(5, m_rgbColor);
63  s.writeString(6, m_title);
64  s.writeBool(7, m_useReverseAPI);
65  s.writeString(8, m_reverseAPIAddress);
66  s.writeU32(9, m_reverseAPIPort);
67  s.writeU32(10, m_reverseAPIDeviceIndex);
68  s.writeU32(11, m_reverseAPIChannelIndex);
69  s.writeU32(12, m_log2Decim);
70  s.writeU32(13, m_filterChainHash);
71 
72  return s.final();
73 }
uint16_t m_reverseAPIDeviceIndex
uint16_t m_reverseAPIChannelIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setChannelMarker()

void RemoteSinkSettings::setChannelMarker ( Serializable channelMarker)
inline

Definition at line 52 of file remotesinksettings.h.

References deserialize(), and serialize().

Referenced by RemoteSinkGUI::RemoteSinkGUI().

52 { m_channelMarker = channelMarker; }
Serializable * m_channelMarker
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

Serializable* RemoteSinkSettings::m_channelMarker

Definition at line 48 of file remotesinksettings.h.

Referenced by resetToDefaults().

◆ m_dataAddress

QString RemoteSinkSettings::m_dataAddress

◆ m_dataPort

uint16_t RemoteSinkSettings::m_dataPort

◆ m_filterChainHash

uint32_t RemoteSinkSettings::m_filterChainHash

◆ m_log2Decim

uint32_t RemoteSinkSettings::m_log2Decim

◆ m_nbFECBlocks

uint16_t RemoteSinkSettings::m_nbFECBlocks

◆ m_reverseAPIAddress

QString RemoteSinkSettings::m_reverseAPIAddress

◆ m_reverseAPIChannelIndex

uint16_t RemoteSinkSettings::m_reverseAPIChannelIndex

◆ m_reverseAPIDeviceIndex

uint16_t RemoteSinkSettings::m_reverseAPIDeviceIndex

◆ m_reverseAPIPort

uint16_t RemoteSinkSettings::m_reverseAPIPort

◆ m_rgbColor

quint32 RemoteSinkSettings::m_rgbColor

◆ m_title

QString RemoteSinkSettings::m_title

◆ m_txDelay

uint32_t RemoteSinkSettings::m_txDelay

◆ m_useReverseAPI

bool RemoteSinkSettings::m_useReverseAPI

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