From 35702041a04511e4b5b7aeb9bb1c7513bada24c3 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 20 Dec 2018 23:20:21 +0100 Subject: [PATCH] Reverse API: Daemon Source --- plugins/channelrx/demodam/amdemod.cpp | 1 - .../channeltx/daemonsource/daemonsource.cpp | 117 +++++++++++++++++- plugins/channeltx/daemonsource/daemonsource.h | 8 ++ .../daemonsource/daemonsourcegui.cpp | 11 ++ .../daemonsource/daemonsourcesettings.cpp | 23 ++++ .../daemonsource/daemonsourcesettings.h | 5 + sdrbase/resources/webapi/doc/html2/index.html | 18 ++- .../doc/swagger/include/DaemonSource.yaml | 13 +- .../api/swagger/include/DaemonSource.yaml | 13 +- swagger/sdrangel/code/html2/index.html | 18 ++- .../qt5/client/SWGDaemonSourceSettings.cpp | 107 ++++++++++++++++ .../code/qt5/client/SWGDaemonSourceSettings.h | 30 +++++ 12 files changed, 356 insertions(+), 8 deletions(-) diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index 98acef1a3..c3c733777 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/plugins/channeltx/daemonsource/daemonsource.cpp b/plugins/channeltx/daemonsource/daemonsource.cpp index bf57d0283..dd8af8951 100644 --- a/plugins/channeltx/daemonsource/daemonsource.cpp +++ b/plugins/channeltx/daemonsource/daemonsource.cpp @@ -20,6 +20,9 @@ #include #include +#include +#include +#include #include "SWGChannelSettings.h" #include "SWGChannelReport.h" @@ -59,10 +62,15 @@ DaemonSource::DaemonSource(DeviceSinkAPI *deviceAPI) : m_threadedChannelizer = new ThreadedBasebandSampleSource(m_channelizer, this); m_deviceAPI->addThreadedSource(m_threadedChannelizer); m_deviceAPI->addChannelAPI(this); + + m_networkManager = new QNetworkAccessManager(); + connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); } DaemonSource::~DaemonSource() { + disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + delete m_networkManager; m_deviceAPI->removeChannelAPI(this); m_deviceAPI->removeThreadedSource(m_threadedChannelizer); delete m_threadedChannelizer; @@ -201,19 +209,36 @@ void DaemonSource::applySettings(const DaemonSourceSettings& settings, bool forc << " force: " << force; bool change = false; + QList reverseAPIKeys; - if ((m_settings.m_dataAddress != settings.m_dataAddress) || force) { + if ((m_settings.m_dataAddress != settings.m_dataAddress) || force) + { + reverseAPIKeys.append("dataAddress"); change = true; } - if ((m_settings.m_dataPort != settings.m_dataPort) || force) { + if ((m_settings.m_dataPort != settings.m_dataPort) || force) + { + reverseAPIKeys.append("dataPort"); change = true; } - if (change && m_sourceThread) { + if (change && m_sourceThread) + { + reverseAPIKeys.append("sourceThread"); m_sourceThread->dataBind(settings.m_dataAddress, settings.m_dataPort); } + if (settings.m_useReverseAPI) + { + bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) || + (m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) || + (m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) || + (m_settings.m_reverseAPIDeviceIndex != settings.m_reverseAPIDeviceIndex) || + (m_settings.m_reverseAPIChannelIndex != settings.m_reverseAPIChannelIndex); + webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); + } + m_settings = settings; } @@ -392,6 +417,21 @@ int DaemonSource::webapiSettingsPutPatch( if (channelSettingsKeys.contains("title")) { settings.m_title = *response.getDaemonSourceSettings()->getTitle(); } + if (channelSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = response.getDaemonSourceSettings()->getUseReverseApi() != 0; + } + if (channelSettingsKeys.contains("reverseAPIAddress")) { + settings.m_reverseAPIAddress = *response.getDaemonSourceSettings()->getReverseApiAddress() != 0; + } + if (channelSettingsKeys.contains("reverseAPIPort")) { + settings.m_reverseAPIPort = response.getDaemonSourceSettings()->getReverseApiPort(); + } + if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) { + settings.m_reverseAPIDeviceIndex = response.getDaemonSourceSettings()->getReverseApiDeviceIndex(); + } + if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { + settings.m_reverseAPIChannelIndex = response.getDaemonSourceSettings()->getReverseApiChannelIndex(); + } MsgConfigureDaemonSource *msg = MsgConfigureDaemonSource::create(settings, force); m_inputMessageQueue.push(msg); @@ -435,6 +475,18 @@ void DaemonSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& } else { response.getDaemonSourceSettings()->setTitle(new QString(settings.m_title)); } + + response.getDaemonSourceSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); + + if (response.getDaemonSourceSettings()->getReverseApiAddress()) { + *response.getDaemonSourceSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; + } else { + response.getDaemonSourceSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); + } + + response.getDaemonSourceSettings()->setReverseApiPort(settings.m_reverseAPIPort); + response.getDaemonSourceSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); + response.getDaemonSourceSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); } void DaemonSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) @@ -457,3 +509,62 @@ void DaemonSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& resp response.getDaemonSourceReport()->setDeviceSampleRate(m_deviceAPI->getSampleSink()->getSampleRate()); } +void DaemonSource::webapiReverseSendSettings(QList& channelSettingsKeys, const DaemonSourceSettings& settings, bool force) +{ + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + swgChannelSettings->setTx(1); + swgChannelSettings->setChannelType(new QString("DaemonSource")); + swgChannelSettings->setDaemonSourceSettings(new SWGSDRangel::SWGDaemonSourceSettings()); + SWGSDRangel::SWGDaemonSourceSettings *swgDaemonSourceSettings = swgChannelSettings->getDaemonSourceSettings(); + + // transfer data that has been modified. When force is on transfer all data except reverse API data + + if (channelSettingsKeys.contains("dataAddress") || force) { + swgDaemonSourceSettings->setDataAddress(new QString(settings.m_dataAddress)); + } + if (channelSettingsKeys.contains("dataPort") || force) { + swgDaemonSourceSettings->setDataPort(settings.m_dataPort); + } + if (channelSettingsKeys.contains("rgbColor") || force) { + swgDaemonSourceSettings->setRgbColor(settings.m_rgbColor); + } + if (channelSettingsKeys.contains("title") || force) { + swgDaemonSourceSettings->setTitle(new QString(settings.m_title)); + } + + QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") + .arg(settings.m_reverseAPIAddress) + .arg(settings.m_reverseAPIPort) + .arg(settings.m_reverseAPIDeviceIndex) + .arg(settings.m_reverseAPIChannelIndex); + m_networkRequest.setUrl(QUrl(channelSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer=new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(swgChannelSettings->asJson().toUtf8()); + buffer->seek(0); + + // Always use PATCH to avoid passing reverse API settings + m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer); + + delete swgChannelSettings; +} + +void DaemonSource::networkManagerFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError replyError = reply->error(); + + if (replyError) + { + qWarning() << "DaemonSource::networkManagerFinished:" + << " error(" << (int) replyError + << "): " << replyError + << ": " << reply->errorString(); + return; + } + + QString answer = reply->readAll(); + answer.chop(1); // remove last \n + qDebug("DaemonSource::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); +} diff --git a/plugins/channeltx/daemonsource/daemonsource.h b/plugins/channeltx/daemonsource/daemonsource.h index 25237fa25..f753dbc90 100644 --- a/plugins/channeltx/daemonsource/daemonsource.h +++ b/plugins/channeltx/daemonsource/daemonsource.h @@ -18,6 +18,7 @@ #define PLUGINS_CHANNELTX_DAEMONSRC_DAEMONSRC_H_ #include +#include #include "cm256.h" @@ -35,6 +36,8 @@ class UpChannelizer; class DeviceSinkAPI; class DaemonSourceThread; class SDRDaemonDataBlock; +class QNetworkAccessManager; +class QNetworkReply; class DaemonSource : public BasebandSampleSource, public ChannelSourceAPI { Q_OBJECT @@ -233,14 +236,19 @@ private: uint32_t m_nbCorrectableErrors; //!< count of correctable errors in number of blocks uint32_t m_nbUncorrectableErrors; //!< count of uncorrectable errors in number of blocks + QNetworkAccessManager *m_networkManager; + QNetworkRequest m_networkRequest; + void applySettings(const DaemonSourceSettings& settings, bool force = false); void handleDataBlock(SDRDaemonDataBlock *dataBlock); void printMeta(const QString& header, SDRDaemonMetaDataFEC *metaData); uint32_t calculateDataReadQueueSize(int sampleRate); void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const DaemonSourceSettings& settings); void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); + void webapiReverseSendSettings(QList& channelSettingsKeys, const DaemonSourceSettings& settings, bool force); private slots: + void networkManagerFinished(QNetworkReply *reply); void handleData(); }; diff --git a/plugins/channeltx/daemonsource/daemonsourcegui.cpp b/plugins/channeltx/daemonsource/daemonsourcegui.cpp index 5a95a4059..658bfb06c 100644 --- a/plugins/channeltx/daemonsource/daemonsourcegui.cpp +++ b/plugins/channeltx/daemonsource/daemonsourcegui.cpp @@ -273,11 +273,22 @@ void DaemonSourceGUI::onWidgetRolled(QWidget* widget, bool rollDown) void DaemonSourceGUI::onMenuDialogCalled(const QPoint &p) { BasicChannelSettingsDialog dialog(&m_channelMarker, this); + dialog.setUseReverseAPI(m_settings.m_useReverseAPI); + dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); + dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); + dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); + dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex); + dialog.move(p); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); m_settings.m_title = m_channelMarker.getTitle(); + m_settings.m_useReverseAPI = dialog.useReverseAPI(); + m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); + m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); + m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex(); + m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex(); setWindowTitle(m_settings.m_title); setTitleColor(m_settings.m_rgbColor); diff --git a/plugins/channeltx/daemonsource/daemonsourcesettings.cpp b/plugins/channeltx/daemonsource/daemonsourcesettings.cpp index ca0dafbe5..bf30eb8f8 100644 --- a/plugins/channeltx/daemonsource/daemonsourcesettings.cpp +++ b/plugins/channeltx/daemonsource/daemonsourcesettings.cpp @@ -32,6 +32,11 @@ void DaemonSourceSettings::resetToDefaults() m_rgbColor = QColor(140, 4, 4).rgb(); m_title = "Daemon source"; m_channelMarker = nullptr; + m_useReverseAPI = false; + m_reverseAPIAddress = "127.0.0.1"; + m_reverseAPIPort = 8888; + m_reverseAPIDeviceIndex = 0; + m_reverseAPIChannelIndex = 0; } QByteArray DaemonSourceSettings::serialize() const @@ -41,6 +46,11 @@ QByteArray DaemonSourceSettings::serialize() const s.writeU32(2, m_dataPort); s.writeU32(3, m_rgbColor); s.writeString(4, m_title); + s.writeBool(5, m_useReverseAPI); + s.writeString(6, m_reverseAPIAddress); + s.writeU32(7, m_reverseAPIPort); + s.writeU32(8, m_reverseAPIDeviceIndex); + s.writeU32(9, m_reverseAPIChannelIndex); return s.final(); } @@ -71,7 +81,20 @@ bool DaemonSourceSettings::deserialize(const QByteArray& data) d.readU32(3, &m_rgbColor, QColor(0, 255, 255).rgb()); d.readString(4, &m_title, "Daemon source"); + d.readBool(5, &m_useReverseAPI, false); + d.readString(6, &m_reverseAPIAddress, "127.0.0.1"); + d.readU32(7, &tmp, 0); + if ((tmp > 1023) && (tmp < 65535)) { + m_reverseAPIPort = tmp; + } else { + m_reverseAPIPort = 8888; + } + + d.readU32(8, &tmp, 0); + m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp; + d.readU32(9, &tmp, 0); + m_reverseAPIChannelIndex = tmp > 99 ? 99 : tmp; return true; } else diff --git a/plugins/channeltx/daemonsource/daemonsourcesettings.h b/plugins/channeltx/daemonsource/daemonsourcesettings.h index df1ab6736..832ecc747 100644 --- a/plugins/channeltx/daemonsource/daemonsourcesettings.h +++ b/plugins/channeltx/daemonsource/daemonsourcesettings.h @@ -28,6 +28,11 @@ struct DaemonSourceSettings uint16_t m_dataPort; //!< Listening data port quint32 m_rgbColor; QString m_title; + bool m_useReverseAPI; + QString m_reverseAPIAddress; + uint16_t m_reverseAPIPort; + uint16_t m_reverseAPIDeviceIndex; + uint16_t m_reverseAPIChannelIndex; Serializable *m_channelMarker; diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index d8ffae178..9ffc69923 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1995,6 +1995,22 @@ margin-bottom: 20px; }, "title" : { "type" : "string" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "reverseAPIChannelIndex" : { + "type" : "integer" } }, "description" : "Daemon channel source settings" @@ -23749,7 +23765,7 @@ except ApiException as e:
- Generated 2018-12-20T08:23:16.509+01:00 + Generated 2018-12-20T23:13:50.969+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/DaemonSource.yaml b/sdrbase/resources/webapi/doc/swagger/include/DaemonSource.yaml index 36f13f348..745b3df89 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/DaemonSource.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/DaemonSource.yaml @@ -11,7 +11,18 @@ DaemonSourceSettings: type: integer title: type: string - + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIDeviceIndex: + type: integer + reverseAPIChannelIndex: + type: integer + DaemonSourceReport: description: "Daemon channel source report" properties: diff --git a/swagger/sdrangel/api/swagger/include/DaemonSource.yaml b/swagger/sdrangel/api/swagger/include/DaemonSource.yaml index 36f13f348..745b3df89 100644 --- a/swagger/sdrangel/api/swagger/include/DaemonSource.yaml +++ b/swagger/sdrangel/api/swagger/include/DaemonSource.yaml @@ -11,7 +11,18 @@ DaemonSourceSettings: type: integer title: type: string - + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIDeviceIndex: + type: integer + reverseAPIChannelIndex: + type: integer + DaemonSourceReport: description: "Daemon channel source report" properties: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index d8ffae178..9ffc69923 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1995,6 +1995,22 @@ margin-bottom: 20px; }, "title" : { "type" : "string" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIDeviceIndex" : { + "type" : "integer" + }, + "reverseAPIChannelIndex" : { + "type" : "integer" } }, "description" : "Daemon channel source settings" @@ -23749,7 +23765,7 @@ except ApiException as e:
- Generated 2018-12-20T08:23:16.509+01:00 + Generated 2018-12-20T23:13:50.969+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.cpp index 287f4f324..222433d36 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.cpp @@ -36,6 +36,16 @@ SWGDaemonSourceSettings::SWGDaemonSourceSettings() { m_rgb_color_isSet = false; title = nullptr; m_title_isSet = false; + use_reverse_api = 0; + m_use_reverse_api_isSet = false; + reverse_api_address = nullptr; + m_reverse_api_address_isSet = false; + reverse_api_port = 0; + m_reverse_api_port_isSet = false; + reverse_api_device_index = 0; + m_reverse_api_device_index_isSet = false; + reverse_api_channel_index = 0; + m_reverse_api_channel_index_isSet = false; } SWGDaemonSourceSettings::~SWGDaemonSourceSettings() { @@ -52,6 +62,16 @@ SWGDaemonSourceSettings::init() { m_rgb_color_isSet = false; title = new QString(""); m_title_isSet = false; + use_reverse_api = 0; + m_use_reverse_api_isSet = false; + reverse_api_address = new QString(""); + m_reverse_api_address_isSet = false; + reverse_api_port = 0; + m_reverse_api_port_isSet = false; + reverse_api_device_index = 0; + m_reverse_api_device_index_isSet = false; + reverse_api_channel_index = 0; + m_reverse_api_channel_index_isSet = false; } void @@ -64,6 +84,13 @@ SWGDaemonSourceSettings::cleanup() { if(title != nullptr) { delete title; } + + if(reverse_api_address != nullptr) { + delete reverse_api_address; + } + + + } SWGDaemonSourceSettings* @@ -85,6 +112,16 @@ SWGDaemonSourceSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + ::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString"); + + ::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_device_index, pJson["reverseAPIDeviceIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_channel_index, pJson["reverseAPIChannelIndex"], "qint32", ""); + } QString @@ -113,6 +150,21 @@ SWGDaemonSourceSettings::asJsonObject() { if(title != nullptr && *title != QString("")){ toJsonValue(QString("title"), title, obj, QString("QString")); } + if(m_use_reverse_api_isSet){ + obj->insert("useReverseAPI", QJsonValue(use_reverse_api)); + } + if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ + toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString")); + } + if(m_reverse_api_port_isSet){ + obj->insert("reverseAPIPort", QJsonValue(reverse_api_port)); + } + if(m_reverse_api_device_index_isSet){ + obj->insert("reverseAPIDeviceIndex", QJsonValue(reverse_api_device_index)); + } + if(m_reverse_api_channel_index_isSet){ + obj->insert("reverseAPIChannelIndex", QJsonValue(reverse_api_channel_index)); + } return obj; } @@ -157,6 +209,56 @@ SWGDaemonSourceSettings::setTitle(QString* title) { this->m_title_isSet = true; } +qint32 +SWGDaemonSourceSettings::getUseReverseApi() { + return use_reverse_api; +} +void +SWGDaemonSourceSettings::setUseReverseApi(qint32 use_reverse_api) { + this->use_reverse_api = use_reverse_api; + this->m_use_reverse_api_isSet = true; +} + +QString* +SWGDaemonSourceSettings::getReverseApiAddress() { + return reverse_api_address; +} +void +SWGDaemonSourceSettings::setReverseApiAddress(QString* reverse_api_address) { + this->reverse_api_address = reverse_api_address; + this->m_reverse_api_address_isSet = true; +} + +qint32 +SWGDaemonSourceSettings::getReverseApiPort() { + return reverse_api_port; +} +void +SWGDaemonSourceSettings::setReverseApiPort(qint32 reverse_api_port) { + this->reverse_api_port = reverse_api_port; + this->m_reverse_api_port_isSet = true; +} + +qint32 +SWGDaemonSourceSettings::getReverseApiDeviceIndex() { + return reverse_api_device_index; +} +void +SWGDaemonSourceSettings::setReverseApiDeviceIndex(qint32 reverse_api_device_index) { + this->reverse_api_device_index = reverse_api_device_index; + this->m_reverse_api_device_index_isSet = true; +} + +qint32 +SWGDaemonSourceSettings::getReverseApiChannelIndex() { + return reverse_api_channel_index; +} +void +SWGDaemonSourceSettings::setReverseApiChannelIndex(qint32 reverse_api_channel_index) { + this->reverse_api_channel_index = reverse_api_channel_index; + this->m_reverse_api_channel_index_isSet = true; +} + bool SWGDaemonSourceSettings::isSet(){ @@ -166,6 +268,11 @@ SWGDaemonSourceSettings::isSet(){ if(m_data_port_isSet){ isObjectUpdated = true; break;} if(m_rgb_color_isSet){ isObjectUpdated = true; break;} if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;} + if(m_use_reverse_api_isSet){ isObjectUpdated = true; break;} + if(reverse_api_address != nullptr && *reverse_api_address != QString("")){ isObjectUpdated = true; break;} + if(m_reverse_api_port_isSet){ isObjectUpdated = true; break;} + if(m_reverse_api_device_index_isSet){ isObjectUpdated = true; break;} + if(m_reverse_api_channel_index_isSet){ isObjectUpdated = true; break;} }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.h b/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.h index 7fecec636..6bdab70dd 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGDaemonSourceSettings.h @@ -54,6 +54,21 @@ public: QString* getTitle(); void setTitle(QString* title); + qint32 getUseReverseApi(); + void setUseReverseApi(qint32 use_reverse_api); + + QString* getReverseApiAddress(); + void setReverseApiAddress(QString* reverse_api_address); + + qint32 getReverseApiPort(); + void setReverseApiPort(qint32 reverse_api_port); + + qint32 getReverseApiDeviceIndex(); + void setReverseApiDeviceIndex(qint32 reverse_api_device_index); + + qint32 getReverseApiChannelIndex(); + void setReverseApiChannelIndex(qint32 reverse_api_channel_index); + virtual bool isSet() override; @@ -70,6 +85,21 @@ private: QString* title; bool m_title_isSet; + qint32 use_reverse_api; + bool m_use_reverse_api_isSet; + + QString* reverse_api_address; + bool m_reverse_api_address_isSet; + + qint32 reverse_api_port; + bool m_reverse_api_port_isSet; + + qint32 reverse_api_device_index; + bool m_reverse_api_device_index_isSet; + + qint32 reverse_api_channel_index; + bool m_reverse_api_channel_index_isSet; + }; }