diff --git a/CHANGELOG b/CHANGELOG index 22f61a20c..808e0c97c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,23 @@ +sdrangel (7.2.1-1) unstable; urgency=medium + + * AMBE feature: fixed many errors preventing build on Windows and MacOS. Issue #1254 + + -- Edouard Griffiths, F4EXB Thu, 26 May 2022 03:12:00 +0200 + +sdrangel (7.2.0-1) unstable; urgency=medium + + * Support hardware AMBE decoding wih a new feature plugin. Implements #1254 + + -- Edouard Griffiths, F4EXB Wed, 25 May 2022 16:35:36 +0200 + +sdrangel (7.1.0-1) unstable; urgency=medium + + * Support LimeRFE wtih a new feature plugin. Implements #1251 + * Fixed auto stack workspaces status save/restore + * Fix typing errors in readme's. PR #1253 + + -- Edouard Griffiths, F4EXB Sun, 22 May 2022 22:24:21 +0200 + sdrangel (7.0.1-1) unstable; urgency=medium * Added ability to build a package for MacOS. PR #1249 @@ -9,7 +29,7 @@ sdrangel (7.0.1-1) unstable; urgency=medium * Save/restore auto-stack function in workspaces. Part of #1250 * Fixed ButtonSwitch background color with stylesheets - -- Edouard Griffiths, F4EXB Thu, 19 May 2022 26:02:31 +0200 + -- Edouard Griffiths, F4EXB Thu, 19 May 2022 16:02:31 +0200 sdrangel (7.0.0-1) unstable; urgency=medium diff --git a/CMakeLists.txt b/CMakeLists.txt index f1bb54042..32ee35ff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # configure version set(sdrangel_VERSION_MAJOR "7") -set(sdrangel_VERSION_MINOR "0") +set(sdrangel_VERSION_MINOR "2") set(sdrangel_VERSION_PATCH "1") set(sdrangel_VERSION_SUFFIX "") @@ -393,7 +393,7 @@ else() find_package(Codec2) find_package(CM256cc) find_package(LibMbe) - find_package(SerialDV REQUIRED) + find_package(SerialDV) find_package(LibDSDcc) find_package(Sgp4) find_package(AptDec) diff --git a/debian/changelog b/debian/changelog index a1ba031f5..dd9b651e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +sdrangel (7.2.1-1) unstable; urgency=medium + + * AMBE feature: fixed many errors preventing build on Windows and MacOS. Issue #1254 + + -- Edouard Griffiths, F4EXB Thu, 26 May 2022 03:12:00 +0200 + +sdrangel (7.2.0-1) unstable; urgency=medium + + * Support hardware AMBE decoding wih a new feature plugin. Implements #1254 + + -- Edouard Griffiths, F4EXB Wed, 25 May 2022 16:35:36 +0200 + +sdrangel (7.1.0-1) unstable; urgency=medium + + * Support LimeRFE wtih a new feature plugin. Implements #1251 + * Fixed auto stack workspaces status save/restore + * Fix typing errors in readme's. PR #1253 + + -- Edouard Griffiths, F4EXB Sun, 22 May 2022 22:24:21 +0200 + sdrangel (7.0.1-1) unstable; urgency=medium * Added ability to build a package for MacOS. PR #1249 diff --git a/doc/img/AMBE_plugin.png b/doc/img/AMBE_plugin.png new file mode 100644 index 000000000..d92d13e54 Binary files /dev/null and b/doc/img/AMBE_plugin.png differ diff --git a/doc/img/AMBE_plugin.xcf b/doc/img/AMBE_plugin.xcf new file mode 100644 index 000000000..090439eee Binary files /dev/null and b/doc/img/AMBE_plugin.xcf differ diff --git a/doc/img/DSDdemod_plugin.png b/doc/img/DSDdemod_plugin.png index 1e6d12cb2..7f59b3942 100644 Binary files a/doc/img/DSDdemod_plugin.png and b/doc/img/DSDdemod_plugin.png differ diff --git a/doc/img/DSDdemod_plugin.xcf b/doc/img/DSDdemod_plugin.xcf index 9b176e599..d7a6f07f1 100644 Binary files a/doc/img/DSDdemod_plugin.xcf and b/doc/img/DSDdemod_plugin.xcf differ diff --git a/doc/img/LimeRFEUSB_dialog.png b/doc/img/LimeRFEUSB_dialog.png deleted file mode 100644 index 64cd98f3c..000000000 Binary files a/doc/img/LimeRFEUSB_dialog.png and /dev/null differ diff --git a/doc/img/LimeRFEUSB_dialog.xcf b/doc/img/LimeRFEUSB_dialog.xcf deleted file mode 100644 index c6e8763bb..000000000 Binary files a/doc/img/LimeRFEUSB_dialog.xcf and /dev/null differ diff --git a/doc/img/LimeRFEUSB_dialog_power.png b/doc/img/LimeRFEUSB_dialog_power.png deleted file mode 100644 index e59a30226..000000000 Binary files a/doc/img/LimeRFEUSB_dialog_power.png and /dev/null differ diff --git a/doc/img/LimeRFEUSB_dialog_power.xcf b/doc/img/LimeRFEUSB_dialog_power.xcf deleted file mode 100644 index 9c3cdfd8f..000000000 Binary files a/doc/img/LimeRFEUSB_dialog_power.xcf and /dev/null differ diff --git a/doc/img/LimeRFE_plugin.png b/doc/img/LimeRFE_plugin.png new file mode 100644 index 000000000..5d91e6dee Binary files /dev/null and b/doc/img/LimeRFE_plugin.png differ diff --git a/doc/img/LimeRFE_plugin.xcf b/doc/img/LimeRFE_plugin.xcf new file mode 100644 index 000000000..0224841bf Binary files /dev/null and b/doc/img/LimeRFE_plugin.xcf differ diff --git a/doc/img/LimeRFEUSB_dialog_mode.png b/doc/img/LimeRFE_plugin_control.png similarity index 100% rename from doc/img/LimeRFEUSB_dialog_mode.png rename to doc/img/LimeRFE_plugin_control.png diff --git a/doc/img/LimeRFEUSB_dialog_mode.xcf b/doc/img/LimeRFE_plugin_control.xcf similarity index 100% rename from doc/img/LimeRFEUSB_dialog_mode.xcf rename to doc/img/LimeRFE_plugin_control.xcf diff --git a/doc/img/LimeRFE_plugin_power.png b/doc/img/LimeRFE_plugin_power.png new file mode 100644 index 000000000..dbd3c7a29 Binary files /dev/null and b/doc/img/LimeRFE_plugin_power.png differ diff --git a/doc/img/LimeRFE_plugin_power.xcf b/doc/img/LimeRFE_plugin_power.xcf new file mode 100644 index 000000000..303b9fd33 Binary files /dev/null and b/doc/img/LimeRFE_plugin_power.xcf differ diff --git a/doc/img/LimeRFEUSB_dialog_rx.png b/doc/img/LimeRFE_plugin_rx.png similarity index 100% rename from doc/img/LimeRFEUSB_dialog_rx.png rename to doc/img/LimeRFE_plugin_rx.png diff --git a/doc/img/LimeRFEUSB_dialog_rx.xcf b/doc/img/LimeRFE_plugin_rx.xcf similarity index 100% rename from doc/img/LimeRFEUSB_dialog_rx.xcf rename to doc/img/LimeRFE_plugin_rx.xcf diff --git a/doc/img/LimeRFEUSB_dialog_tx.png b/doc/img/LimeRFE_plugin_tx.png similarity index 100% rename from doc/img/LimeRFEUSB_dialog_tx.png rename to doc/img/LimeRFE_plugin_tx.png diff --git a/doc/img/LimeRFEUSB_dialog_tx.xcf b/doc/img/LimeRFE_plugin_tx.xcf similarity index 100% rename from doc/img/LimeRFEUSB_dialog_tx.xcf rename to doc/img/LimeRFE_plugin_tx.xcf diff --git a/plugins/channelrx/demodais/readme.md b/plugins/channelrx/demodais/readme.md index e160a3541..674a7a80d 100644 --- a/plugins/channelrx/demodais/readme.md +++ b/plugins/channelrx/demodais/readme.md @@ -68,7 +68,7 @@ UDP port number to forward received messages to.

12: UDP format

-The format the messages are forwared via UDP in. This can be either binary (which is useful for SDRangel's PERTester feature) or NMEA (which is useful for 3rd party applications such as OpenCPN). +The format the messages are forwarded via UDP in. This can be either binary (which is useful for SDRangel's PERTester feature) or NMEA (which is useful for 3rd party applications such as OpenCPN).

13: Start/stop Logging Messages to .csv File

diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index 00307028b..45c93b3b7 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -39,6 +39,7 @@ #include "dsp/dspcommands.h" #include "device/deviceapi.h" #include "feature/feature.h" +#include "feature/featureset.h" #include "settings/serializable.h" #include "util/db.h" #include "maincore.h" @@ -46,6 +47,8 @@ #include "dsddemod.h" MESSAGE_CLASS_DEFINITION(DSDDemod::MsgConfigureDSDDemod, Message) +MESSAGE_CLASS_DEFINITION(DSDDemod::MsgQueryAvailableAMBEFeatures, Message) +MESSAGE_CLASS_DEFINITION(DSDDemod::MsgReportAvailableAMBEFeatures, Message) const char* const DSDDemod::m_channelIdURI = "sdrangel.channel.dsddemod"; const char* const DSDDemod::m_channelId = "DSDDemod"; @@ -82,6 +85,20 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) : this, &DSDDemod::handleIndexInDeviceSetChanged ); + QObject::connect( + MainCore::instance(), + &MainCore::featureAdded, + this, + &DSDDemod::handleFeatureAdded + ); + QObject::connect( + MainCore::instance(), + &MainCore::featureRemoved, + this, + &DSDDemod::handleFeatureRemoved + ); + + scanAvailableAMBEFeatures(); } DSDDemod::~DSDDemod() @@ -176,6 +193,11 @@ bool DSDDemod::handleMessage(const Message& cmd) return true; } + else if (MsgQueryAvailableAMBEFeatures::match(cmd)) + { + notifyUpdateAMBEFeatures(); + return true; + } else { return false; @@ -219,6 +241,8 @@ void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force) << " m_traceStroke: " << settings.m_traceStroke << " m_traceDecay: " << settings.m_traceDecay << " m_streamIndex: " << settings.m_streamIndex + << " m_ambeFeatureIndex: " << settings.m_ambeFeatureIndex + << " m_connectAMBE: " << settings.m_connectAMBE << " force: " << force; QList reverseAPIKeys; @@ -280,6 +304,30 @@ void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force) if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force) { reverseAPIKeys.append("audioDeviceName"); } + if ((settings.m_ambeFeatureIndex != m_settings.m_ambeFeatureIndex) || force) { + reverseAPIKeys.append("ambeFeatureIndex"); + } + if ((settings.m_connectAMBE != m_settings.m_connectAMBE) || force) { + reverseAPIKeys.append("connectAMBE"); + } + + if ((m_settings.m_connectAMBE != settings.m_connectAMBE) + || (m_settings.m_ambeFeatureIndex != settings.m_ambeFeatureIndex) || force) + { + if (settings.m_connectAMBE) + { + for (const auto& feature : m_availableAMBEFeatures) + { + if (feature.m_featureIndex == settings.m_ambeFeatureIndex) { + m_basebandSink->setAMBEFeature(feature.m_feature); + } + } + } + else + { + m_basebandSink->setAMBEFeature(nullptr); + } + } if (m_settings.m_streamIndex != settings.m_streamIndex) { @@ -339,6 +387,32 @@ bool DSDDemod::deserialize(const QByteArray& data) } } +void DSDDemod::scanAvailableAMBEFeatures() +{ + MainCore *mainCore = MainCore::instance(); + int nbFeatures = mainCore->getFeatureeSets()[0]->getNumberOfFeatures(); + m_availableAMBEFeatures.clear(); + + for (int i = 0; i < nbFeatures; i++) + { + Feature *feature = mainCore->getFeatureeSets()[0]->getFeatureAt(i); + + if (feature->getURI() == "sdrangel.feature.ambe") { + m_availableAMBEFeatures[feature] = DSDDemodSettings::AvailableAMBEFeature{i, feature}; + } + } +} + +void DSDDemod::notifyUpdateAMBEFeatures() +{ + if (getMessageQueueToGUI()) + { + MsgReportAvailableAMBEFeatures *msg = MsgReportAvailableAMBEFeatures::create(); + msg->getFeatures() = m_availableAMBEFeatures.values(); + getMessageQueueToGUI()->push(msg); + } +} + void DSDDemod::sendSampleRateToDemodAnalyzer() { QList pipes; @@ -492,6 +566,12 @@ void DSDDemod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { settings.m_reverseAPIChannelIndex = response.getDsdDemodSettings()->getReverseApiChannelIndex(); } + if (channelSettingsKeys.contains("ambeFeatureIndex")) { + settings.m_ambeFeatureIndex = response.getDsdDemodSettings()->getAmbeFeatureIndex(); + } + if (channelSettingsKeys.contains("connectAMBE")) { + settings.m_connectAMBE = response.getDsdDemodSettings()->getConnectAmbe() != 0; + } if (settings.m_channelMarker && channelSettingsKeys.contains("channelMarker")) { settings.m_channelMarker->updateFrom(channelSettingsKeys, response.getDsdDemodSettings()->getChannelMarker()); } @@ -558,6 +638,8 @@ void DSDDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp response.getDsdDemodSettings()->setReverseApiPort(settings.m_reverseAPIPort); response.getDsdDemodSettings()->setReverseApiDeviceIndex(settings.m_reverseAPIDeviceIndex); response.getDsdDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex); + response.getDsdDemodSettings()->setAmbeFeatureIndex(settings.m_ambeFeatureIndex); + response.getDsdDemodSettings()->setConnectAmbe(settings.m_connectAMBE ? 1 : 0); if (settings.m_channelMarker) { @@ -744,6 +826,12 @@ void DSDDemod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("streamIndex") || force) { swgDSDDemodSettings->setStreamIndex(settings.m_streamIndex); } + if (channelSettingsKeys.contains("ambeFeatureIndex") || force) { + swgDSDDemodSettings->setAmbeFeatureIndex(settings.m_ambeFeatureIndex); + } + if (channelSettingsKeys.contains("connectAMBE") || force) { + swgDSDDemodSettings->setConnectAmbe(settings.m_connectAMBE ? 1 : 0); + } if (settings.m_channelMarker && (channelSettingsKeys.contains("channelMarker") || force)) { @@ -794,3 +882,40 @@ void DSDDemod::handleIndexInDeviceSetChanged(int index) m_basebandSink->setFifoLabel(fifoLabel); m_basebandSink->setAudioFifoLabel(fifoLabel); } + +void DSDDemod::handleFeatureAdded(int featureSetIndex, Feature *feature) +{ + if (featureSetIndex != 0) { + return; + } + + if ((feature->getURI() == "sdrangel.feature.ambe") && !m_availableAMBEFeatures.contains(feature)) + { + m_availableAMBEFeatures[feature] = DSDDemodSettings::AvailableAMBEFeature{feature->getIndexInFeatureSet(), feature}; + + if (m_settings.m_connectAMBE && (m_settings.m_ambeFeatureIndex == feature->getIndexInFeatureSet())) { + m_basebandSink->setAMBEFeature(feature); + } + + notifyUpdateAMBEFeatures(); + } +} + +void DSDDemod::handleFeatureRemoved(int featureSetIndex, Feature *feature) +{ + if (featureSetIndex != 0) { + return; + } + + if (m_availableAMBEFeatures.contains(feature)) + { + if (m_settings.m_ambeFeatureIndex == m_availableAMBEFeatures[feature].m_featureIndex) + { + m_settings.m_connectAMBE = false; + m_basebandSink->setAMBEFeature(nullptr); + } + + m_availableAMBEFeatures.remove(feature); + notifyUpdateAMBEFeatures(); + } +} diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index dd5584d1d..147d10143 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -62,6 +62,38 @@ public: { } }; + class MsgQueryAvailableAMBEFeatures : public Message { + MESSAGE_CLASS_DECLARATION + + public: + static MsgQueryAvailableAMBEFeatures* create() { + return new MsgQueryAvailableAMBEFeatures(); + } + + protected: + MsgQueryAvailableAMBEFeatures() : + Message() + { } + }; + + class MsgReportAvailableAMBEFeatures : public Message { + MESSAGE_CLASS_DECLARATION + + public: + QList& getFeatures() { return m_availableFeatures; } + + static MsgReportAvailableAMBEFeatures* create() { + return new MsgReportAvailableAMBEFeatures(); + } + + private: + QList m_availableFeatures; + + MsgReportAvailableAMBEFeatures() : + Message() + {} + }; + DSDDemod(DeviceAPI *deviceAPI); virtual ~DSDDemod(); virtual void destroy() { delete this; } @@ -140,6 +172,7 @@ private: DSDDemodBaseband *m_basebandSink; DSDDemodSettings m_settings; int m_basebandSampleRate; //!< stored from device message used when starting baseband sink + QHash m_availableAMBEFeatures; QNetworkAccessManager *m_networkManager; QNetworkRequest m_networkRequest; @@ -148,6 +181,8 @@ private: virtual bool handleMessage(const Message& cmd); void applySettings(const DSDDemodSettings& settings, bool force = false); + void scanAvailableAMBEFeatures(); + void notifyUpdateAMBEFeatures(); void sendSampleRateToDemodAnalyzer(); void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const DSDDemodSettings& settings, bool force); @@ -167,6 +202,8 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleIndexInDeviceSetChanged(int index); + void handleFeatureAdded(int featureSetIndex, Feature *feature); + void handleFeatureRemoved(int featureSetIndex, Feature *feature); }; #endif // INCLUDE_DSDDEMOD_H diff --git a/plugins/channelrx/demoddsd/dsddemodbaseband.h b/plugins/channelrx/demoddsd/dsddemodbaseband.h index 13f54448c..7f11382c6 100644 --- a/plugins/channelrx/demoddsd/dsddemodbaseband.h +++ b/plugins/channelrx/demoddsd/dsddemodbaseband.h @@ -29,6 +29,7 @@ class DownChannelizer; class ChannelAPI; +class Feature; class DSDDemodBaseband : public QObject { @@ -75,6 +76,7 @@ public: void setChannel(ChannelAPI *channel); void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } + void setAMBEFeature(Feature *ambeFeature) { m_sink.setAmbeFeature(ambeFeature); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index fc256d618..9dfa7490d 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -113,6 +113,13 @@ bool DSDDemodGUI::handleMessage(const Message& message) updateAbsoluteCenterFrequency(); return true; } + else if (DSDDemod::MsgReportAvailableAMBEFeatures::match(message)) + { + DSDDemod::MsgReportAvailableAMBEFeatures& report = (DSDDemod::MsgReportAvailableAMBEFeatures&) message; + m_availableAMBEFeatures = report.getFeatures(); + updateAMBEFeaturesList(); + return true; + } else { return false; @@ -263,6 +270,19 @@ void DSDDemodGUI::on_symbolPLLLock_toggled(bool checked) applySettings(); } +void DSDDemodGUI::on_ambeSupport_clicked(bool checked) +{ + m_settings.m_connectAMBE = checked; + m_settings.m_ambeFeatureIndex = m_availableAMBEFeatures[ui->ambeFeatures->currentIndex()].m_featureIndex; + applySettings(); +} + +void DSDDemodGUI::on_ambeFeatures_currentIndexChanged(int index) +{ + m_settings.m_ambeFeatureIndex = m_availableAMBEFeatures[index].m_featureIndex; + applySettings(); +} + void DSDDemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) { (void) widget; @@ -490,6 +510,17 @@ void DSDDemodGUI::displaySettings() ui->traceDecayText->setText(QString("%1").arg(m_settings.m_traceDecay)); m_scopeVisXY->setDecay(m_settings.m_traceDecay); + ui->ambeSupport->setChecked(m_settings.m_connectAMBE); + + for (int i = 0; i < ui->ambeFeatures->count(); i++) + { + if (ui->ambeFeatures->itemData(i).toInt() == m_settings.m_ambeFeatureIndex) + { + ui->ambeFeatures->setCurrentIndex(i); + break; + } + } + updateIndexLabel(); getRollupContents()->restoreState(m_rollupState); @@ -497,6 +528,32 @@ void DSDDemodGUI::displaySettings() blockApplySettings(false); } +void DSDDemodGUI::updateAMBEFeaturesList() +{ + ui->ambeFeatures->blockSignals(true); + ui->ambeSupport->blockSignals(true); + ui->ambeFeatures->clear(); + bool unsetAMBE = true; + + for (int i = 0; i < m_availableAMBEFeatures.count(); i++) + { + ui->ambeFeatures->addItem(tr("F:%1").arg(m_availableAMBEFeatures[i].m_featureIndex), m_availableAMBEFeatures[i].m_featureIndex); + + if (m_settings.m_ambeFeatureIndex == m_availableAMBEFeatures[i].m_featureIndex) + { + unsetAMBE = false; + ui->ambeFeatures->setCurrentIndex(i); + } + } + + if (unsetAMBE) { + ui->ambeSupport->setChecked(false); + } + + ui->ambeSupport->blockSignals(false); + ui->ambeFeatures->blockSignals(false); +} + void DSDDemodGUI::applySettings(bool force) { if (m_doApplySettings) @@ -658,6 +715,8 @@ void DSDDemodGUI::makeUIConnections() QObject::connect(ui->audioMute, &QToolButton::toggled, this, &DSDDemodGUI::on_audioMute_toggled); QObject::connect(ui->symbolPLLLock, &QToolButton::toggled, this, &DSDDemodGUI::on_symbolPLLLock_toggled); QObject::connect(ui->viewStatusLog, &QPushButton::clicked, this, &DSDDemodGUI::on_viewStatusLog_clicked); + QObject::connect(ui->ambeSupport, &QCheckBox::clicked, this, &DSDDemodGUI::on_ambeSupport_clicked); + QObject::connect(ui->ambeFeatures, QOverload::of(&QComboBox::currentIndexChanged), this, &DSDDemodGUI::on_ambeFeatures_currentIndexChanged); } void DSDDemodGUI::updateAbsoluteCenterFrequency() diff --git a/plugins/channelrx/demoddsd/dsddemodgui.h b/plugins/channelrx/demoddsd/dsddemodgui.h index e5de1b302..c841fd342 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.h +++ b/plugins/channelrx/demoddsd/dsddemodgui.h @@ -90,6 +90,7 @@ private: qint64 m_deviceCenterFrequency; int m_basebandSampleRate; bool m_doApplySettings; + QList m_availableAMBEFeatures; ScopeVisXY* m_scopeVisXY; @@ -117,6 +118,7 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); + void updateAMBEFeaturesList(); void updateMyPosition(); bool handleMessage(const Message& message); void makeUIConnections(); @@ -145,6 +147,8 @@ private slots: void on_highPassFilter_toggled(bool checked); void on_audioMute_toggled(bool checked); void on_symbolPLLLock_toggled(bool checked); + void on_ambeSupport_clicked(bool checked); + void on_ambeFeatures_currentIndexChanged(int index); void onWidgetRolled(QWidget* widget, bool rollDown); void onMenuDialogCalled(const QPoint& p); void on_viewStatusLog_clicked(); diff --git a/plugins/channelrx/demoddsd/dsddemodgui.ui b/plugins/channelrx/demoddsd/dsddemodgui.ui index 781d39d68..0403c7743 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.ui +++ b/plugins/channelrx/demoddsd/dsddemodgui.ui @@ -1231,6 +1231,29 @@ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + 10 + 170 + 71 + 23 + + + + AMBE + + + + + + 80 + 170 + 50 + 20 + + + diff --git a/plugins/channelrx/demoddsd/dsddemodplugin.cpp b/plugins/channelrx/demoddsd/dsddemodplugin.cpp index 17f2485f9..903d7348a 100644 --- a/plugins/channelrx/demoddsd/dsddemodplugin.cpp +++ b/plugins/channelrx/demoddsd/dsddemodplugin.cpp @@ -30,7 +30,7 @@ const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = { DSDDemod::m_channelId, QStringLiteral("DSD Demodulator"), - QStringLiteral("7.0.0"), + QStringLiteral("7.2.0"), QStringLiteral("(c) Edouard Griffiths, F4EXB"), QStringLiteral("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channelrx/demoddsd/dsddemodsettings.cpp b/plugins/channelrx/demoddsd/dsddemodsettings.cpp index ed7a6394f..73aaadda1 100644 --- a/plugins/channelrx/demoddsd/dsddemodsettings.cpp +++ b/plugins/channelrx/demoddsd/dsddemodsettings.cpp @@ -61,6 +61,8 @@ void DSDDemodSettings::resetToDefaults() m_reverseAPIChannelIndex = 0; m_workspaceIndex = 0; m_hidden = false; + m_ambeFeatureIndex = -1; + m_connectAMBE = false; } QByteArray DSDDemodSettings::serialize() const @@ -107,6 +109,8 @@ QByteArray DSDDemodSettings::serialize() const s.writeS32(32, m_workspaceIndex); s.writeBlob(33, m_geometryBytes); s.writeBool(34, m_hidden); + s.writeS32(35, m_ambeFeatureIndex); + s.writeBool(36, m_connectAMBE); return s.final(); } @@ -190,6 +194,8 @@ bool DSDDemodSettings::deserialize(const QByteArray& data) d.readS32(32, &m_workspaceIndex, 0); d.readBlob(33, &m_geometryBytes); d.readBool(34, &m_hidden, false); + d.readS32(35, &m_ambeFeatureIndex, -1); + d.readBool(36, &m_connectAMBE, false); return true; } diff --git a/plugins/channelrx/demoddsd/dsddemodsettings.h b/plugins/channelrx/demoddsd/dsddemodsettings.h index 3339be650..e4d22c30e 100644 --- a/plugins/channelrx/demoddsd/dsddemodsettings.h +++ b/plugins/channelrx/demoddsd/dsddemodsettings.h @@ -21,9 +21,20 @@ #include class Serializable; +class Feature; struct DSDDemodSettings { + struct AvailableAMBEFeature + { + int m_featureIndex; + Feature *m_feature; + + AvailableAMBEFeature() = default; + AvailableAMBEFeature(const AvailableAMBEFeature&) = default; + AvailableAMBEFeature& operator=(const AvailableAMBEFeature&) = default; + }; + qint64 m_inputFrequencyOffset; Real m_rfBandwidth; Real m_fmDeviation; @@ -55,6 +66,8 @@ struct DSDDemodSettings int m_workspaceIndex; QByteArray m_geometryBytes; bool m_hidden; + int m_ambeFeatureIndex; + bool m_connectAMBE; Serializable *m_channelMarker; Serializable *m_rollupState; diff --git a/plugins/channelrx/demoddsd/dsddemodsink.cpp b/plugins/channelrx/demoddsd/dsddemodsink.cpp index b1d20df72..5b2f9e164 100644 --- a/plugins/channelrx/demoddsd/dsddemodsink.cpp +++ b/plugins/channelrx/demoddsd/dsddemodsink.cpp @@ -34,6 +34,8 @@ #include "dsp/dspengine.h" #include "dsp/basebandsamplesink.h" #include "dsp/datafifo.h" +#include "dsp/dspcommands.h" +#include "feature/feature.h" #include "audio/audiooutputdevice.h" #include "util/db.h" #include "util/messagequeue.h" @@ -44,6 +46,7 @@ DSDDemodSink::DSDDemodSink() : m_channelSampleRate(48000), m_channelFrequencyOffset(0), + m_ambeFeature(nullptr), m_audioSampleRate(48000), m_interpolatorDistance(0.0f), m_interpolatorDistanceRemain(0.0f), @@ -89,7 +92,7 @@ void DSDDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV m_scopeSampleBuffer.clear(); - m_dsdDecoder.enableMbelib(!DSPEngine::instance()->hasDVSerialSupport()); // disable mbelib if DV serial support is present and activated else enable it + m_dsdDecoder.enableMbelib(!m_ambeFeature); // disable mbelib if DV serial support is present and activated else enable it for (SampleVector::const_iterator it = begin; it != end; ++it) { @@ -229,20 +232,24 @@ void DSDDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV m_scopeSampleBuffer.push_back(s); } - if (DSPEngine::instance()->hasDVSerialSupport()) + // if (DSPEngine::instance()->hasDVSerialSupport()) + if (m_ambeFeature) { if ((m_settings.m_slot1On) && m_dsdDecoder.mbeDVReady1()) { if (!m_settings.m_audioMute) { - DSPEngine::instance()->pushMbeFrame( - m_dsdDecoder.getMbeDVFrame1(), - m_dsdDecoder.getMbeRateIndex(), - m_settings.m_volume * 10.0, - m_settings.m_tdmaStereo ? 1 : 3, // left or both channels - m_settings.m_highPassFilter, - m_audioSampleRate/8000, // upsample from native 8k - &m_audioFifo1); + DSPPushMbeFrame *msg = new DSPPushMbeFrame( + m_dsdDecoder.getMbeDVFrame1(), + m_dsdDecoder.getMbeRateIndex(), + m_settings.m_volume * 10.0, + m_settings.m_tdmaStereo ? 1 : 3, // left or both channels + m_settings.m_highPassFilter, + m_audioSampleRate/8000, // upsample from native 8k + &m_audioFifo1 + ); + m_ambeFeature->handleMessage(*msg); + delete msg; } m_dsdDecoder.resetMbeDV1(); @@ -252,14 +259,17 @@ void DSDDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV { if (!m_settings.m_audioMute) { - DSPEngine::instance()->pushMbeFrame( - m_dsdDecoder.getMbeDVFrame2(), - m_dsdDecoder.getMbeRateIndex(), - m_settings.m_volume * 10.0, - m_settings.m_tdmaStereo ? 2 : 3, // right or both channels - m_settings.m_highPassFilter, - m_audioSampleRate/8000, // upsample from native 8k - &m_audioFifo2); + DSPPushMbeFrame *msg = new DSPPushMbeFrame( + m_dsdDecoder.getMbeDVFrame2(), + m_dsdDecoder.getMbeRateIndex(), + m_settings.m_volume * 10.0, + m_settings.m_tdmaStereo ? 2 : 3, // right or both channels + m_settings.m_highPassFilter, + m_audioSampleRate/8000, // upsample from native 8k + &m_audioFifo2 + ); + m_ambeFeature->handleMessage(*msg); + delete msg; } m_dsdDecoder.resetMbeDV2(); @@ -270,7 +280,7 @@ void DSDDemodSink::feed(const SampleVector::const_iterator& begin, const SampleV } } - if (!DSPEngine::instance()->hasDVSerialSupport()) + if (!m_ambeFeature) { if (m_settings.m_slot1On) { diff --git a/plugins/channelrx/demoddsd/dsddemodsink.h b/plugins/channelrx/demoddsd/dsddemodsink.h index 3279d553d..5eaa7ec6a 100644 --- a/plugins/channelrx/demoddsd/dsddemodsink.h +++ b/plugins/channelrx/demoddsd/dsddemodsink.h @@ -36,6 +36,7 @@ class BasebandSampleSink; class ChannelAPI; +class Feature; class DSDDemodSink : public ChannelSampleSink { public: @@ -83,6 +84,7 @@ public: } const char *updateAndGetStatusText(); + void setAmbeFeature(Feature *feature) { m_ambeFeature = feature; } private: struct MagSqLevelsStore @@ -114,6 +116,7 @@ private: int m_channelFrequencyOffset; DSDDemodSettings m_settings; ChannelAPI *m_channel; + Feature *m_ambeFeature; int m_audioSampleRate; QVector m_demodBuffer; int m_demodBufferFill; diff --git a/plugins/channelrx/demoddsd/readme.md b/plugins/channelrx/demoddsd/readme.md index 9aae7f0d0..b2ce48abc 100644 --- a/plugins/channelrx/demoddsd/readme.md +++ b/plugins/channelrx/demoddsd/readme.md @@ -18,26 +18,9 @@ To enable this plugin at compile time you will need to have DSDcc installed in y

DV serial device support

-You can use a serial device connected to your system that implements and exposes the packet interface of the AMBE3000 chip. This can be for example a ThumbDV USB dongle. You may also connect to an AMBE server instance over the network. +You can use a serial device connected to your system that implements and exposes the packet interface of the AMBE3000 chip. This can be for example a ThumbDV USB dongle. You may also connect to an AMBE server instance over the network. This is supported via the [AMBE feature](../../feature/ambe/readme.md). -DV serial devices are supported using the [SerialDV](https://github.com/f4exb/serialDV) library that is a mandatory requirement. Therefore you have to compile and install it in your system. Please refer to this project Readme.md to compile and install SerialDV. f you install it in a custom location say `/opt/install/serialdv` you will need to add this define to the cmake command: `-DSERIALDV_DIR=/opt/install/serialdv` - -To effectively use serial DV devices for AMBE decoding you will have to add at least one device to the list of AMBE devices in use using the `AMBE devices control` dialog opened with the `AMBE` option in the `Preferences` menu. The list of devices is saved in the program preferences so that they are persistent across program stop/start. However if the device name or server address changes in between the corresponding reference will be lost. - -Although such serial devices work with a serial interface at 400 kb in practice maybe for other reasons they are capable of handling only one conversation at a time. The software will allocate the device dynamically to a conversation with an inactivity timeout of 1 second so that conversations do not get interrupted constantly making the audio output too choppy. In practice you will have to have as many devices connected to your system as the number of conversations you would like to be handled in parallel. - -Note also that hardware serial devices are not supported in Windows because of trouble with COM port support (contributors welcome!). - -If no AMBE devices or servers are activated with the `AMBE devices control` AMBE decoding will take place with Mbelib. Possible copyright issues apart (see next) the audio quality with the DVSI AMBE chip is much better. - ---- -⚠ With kernel 4.4.52 and maybe other 4.4 versions the default for FTDI devices (that is in the ftdi_sio kernel module) is not to set it as low latency. This results in the ThumbDV dongle not working anymore because its response is too slow to sustain the normal AMBE packets flow. The solution is to force low latency by changing the variable for your device (ex: /dev/ttyUSB0) as follows: - -`echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer` or `sudo setserial /dev/ttyUSB0 low_latency` - -Newer kernels do not seem to have this issue. - ---- +If no AMBE features are active or the AMBE support is not engaged (B.19) AMBE decoding will take place with Mbelib. Possible copyright issues apart (see next) the audio quality with the DVSI AMBE chip is much better.

Mbelib support

@@ -590,3 +573,11 @@ This is the one side deviation in kHz (±) leading to maximum (100%) deviati

B.18: Gain after discriminator

This is the gain applied to the output of the discriminator before the decoder. Normally this would be set at unit gain 1.0 while the FM deviation is adjusted. However this can be used to extend the range of FM adjustment. + +

B.19: Activate AMBE hardware feature

+ +Connects to an [AMBE Feature](../../feature/ambe/readme.md) to process AMBE frames in hardware + +

B.20: AMBE feature index for hardware decoding

+ +Select the AMBE feature index used to process AMBE frames in hardware. If no AMBE feature is present then the list is empty. The list is automatically updated when an AMBE feature is added or removed. diff --git a/plugins/channelrx/demodvormc/readme.md b/plugins/channelrx/demodvormc/readme.md index 3053da335..4ab3aa259 100644 --- a/plugins/channelrx/demodvormc/readme.md +++ b/plugins/channelrx/demodvormc/readme.md @@ -42,7 +42,7 @@ Pressing this button downloads the OpenAIP.net Navaid database, which contains t

5: Draw Radials Adjusted for Magnetic Declination

-When checked, radials on the map will drawn adjusted for magnetic declination. For example, if a VOR has a magnetic declination of 5 degrees, and the radial is calculated at 0 degrees, the radial will be drawn to magnetic North, i.e. -5 degress from true North. If not checked, the same radial would be drawn to true North (i.e 0 degrees), which may result in a less accurate position estimate. +When checked, radials on the map will drawn adjusted for magnetic declination. For example, if a VOR has a magnetic declination of 5 degrees, and the radial is calculated at 0 degrees, the radial will be drawn to magnetic North, i.e. -5 degrees from true North. If not checked, the same radial would be drawn to true North (i.e 0 degrees), which may result in a less accurate position estimate.

6: Morse ident threshold

diff --git a/plugins/feature/CMakeLists.txt b/plugins/feature/CMakeLists.txt index 9a00b324d..4a79484d5 100644 --- a/plugins/feature/CMakeLists.txt +++ b/plugins/feature/CMakeLists.txt @@ -35,3 +35,11 @@ if (Qt5Charts_FOUND) add_subdirectory(radiosonde) add_subdirectory(startracker) endif() + +if (ENABLE_LIMESUITE AND LIMESUITE_FOUND) + add_subdirectory(limerfe) +endif() + +if (LIBSERIALDV_FOUND) + add_subdirectory(ambe) +endif() diff --git a/plugins/feature/ambe/CMakeLists.txt b/plugins/feature/ambe/CMakeLists.txt new file mode 100644 index 000000000..e2fb11f72 --- /dev/null +++ b/plugins/feature/ambe/CMakeLists.txt @@ -0,0 +1,65 @@ +project(ambe) + +set(ambe_SOURCES + ambe.cpp + ambesettings.cpp + ambeplugin.cpp + ambeengine.cpp + ambeworker.cpp + ambewebapiadapter.cpp +) + +set(ambe_HEADERS + ambe.h + ambesettings.h + ambeplugin.h + ambeengine.h + ambeworker.h + ambewebapiadapter.h +) + +include_directories( + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${LIBSERIALDV_INCLUDE_DIR} +) + +if(NOT SERVER_MODE) + set(ambe_SOURCES + ${ambe_SOURCES} + ambegui.cpp + ambegui.ui + ) + set(ambe_HEADERS + ${ambe_HEADERS} + ambegui.h + ) + + set(TARGET_NAME featureambe) + set(TARGET_LIB "Qt5::Widgets") + set(TARGET_LIB_GUI "sdrgui") + set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) +else() + set(TARGET_NAME featureambesrv) + set(TARGET_LIB "") + set(TARGET_LIB_GUI "") + set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) +endif() + +add_library(${TARGET_NAME} SHARED + ${ambe_SOURCES} +) + +target_link_libraries(${TARGET_NAME} + Qt5::Core + ${TARGET_LIB} + sdrbase + ${TARGET_LIB_GUI} + ${LIBSERIALDV_LIBRARY} +) + +install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) + +# Install debug symbols +if (WIN32) + install(FILES $ CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${INSTALL_FOLDER} ) +endif() diff --git a/plugins/feature/ambe/ambe.cpp b/plugins/feature/ambe/ambe.cpp new file mode 100644 index 000000000..b75ba8179 --- /dev/null +++ b/plugins/feature/ambe/ambe.cpp @@ -0,0 +1,430 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +#include "SWGFeatureSettings.h" +#include "SWGFeatureReport.h" +#include "SWGFeatureActions.h" +#include "SWGDVSerialDevices.h" +#include "SWGDVSerialDevice.h" +#include "SWGAMBEDevices.h" + +#include "settings/serializable.h" +#include "util/simpleserializer.h" +#include "dsp/dspcommands.h" + +#include "ambe.h" + +MESSAGE_CLASS_DEFINITION(AMBE::MsgConfigureAMBE, Message) +MESSAGE_CLASS_DEFINITION(AMBE::MsgReportDevices, Message) + +const char* const AMBE::m_featureIdURI = "sdrangel.feature.ambe"; +const char* const AMBE::m_featureId = "AMBE"; + +AMBE::AMBE(WebAPIAdapterInterface *webAPIAdapterInterface) : + Feature(m_featureIdURI, webAPIAdapterInterface) +{ + setObjectName(m_featureId); + m_state = StIdle; + m_errorMessage = "AMBE error"; + m_networkManager = new QNetworkAccessManager(); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AMBE::networkManagerFinished + ); +} + +AMBE::~AMBE() +{ + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AMBE::networkManagerFinished + ); + delete m_networkManager; +} + +void AMBE::start() +{ + qDebug("AMBE::start"); + m_state = StRunning; +} + +void AMBE::stop() +{ + qDebug("AMBE::stop"); + m_state = StIdle; +} + +void AMBE::applySettings(const AMBESettings& settings, bool force) +{ + (void) force; + m_settings = settings; +} + +bool AMBE::handleMessage(const Message& cmd) +{ + if (MsgConfigureAMBE::match(cmd)) + { + MsgConfigureAMBE& cfg = (MsgConfigureAMBE&) cmd; + qDebug() << "AMBE::handleMessage: MsgConfigureAMBE"; + applySettings(cfg.getSettings(), cfg.getForce()); + return true; + } + else if (DSPPushMbeFrame::match(cmd)) + { + DSPPushMbeFrame& cfg = (DSPPushMbeFrame&) cmd; + m_ambeEngine.pushMbeFrame( + cfg.getMbeFrame(), + cfg.getMbeRateIndex(), + cfg.getMbeVolumeIndex(), + cfg.getChannels(), + cfg.getUseHP(), + cfg.getUpsampling(), + cfg.getAudioFifo() + ); + return true; + } + + return false; +} + +QByteArray AMBE::serialize() const +{ + SimpleSerializer s(1); + s.writeBlob(1, m_settings.serialize()); + return s.final(); +} + +bool AMBE::deserialize(const QByteArray& data) +{ + SimpleDeserializer d(data); + + if (!d.isValid()) + { + m_settings.resetToDefaults(); + return false; + } + + if (d.getVersion() == 1) + { + QByteArray bytetmp; + d.readBlob(1, &bytetmp); + + if (m_settings.deserialize(bytetmp)) + { + MsgConfigureAMBE *msg = MsgConfigureAMBE::create(m_settings, true); + m_inputMessageQueue.push(msg); + return true; + } + else + { + m_settings.resetToDefaults(); + MsgConfigureAMBE *msg = MsgConfigureAMBE::create(m_settings, true); + m_inputMessageQueue.push(msg); + return false; + } + } + else + { + return false; + } +} + +void AMBE::networkManagerFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError replyError = reply->error(); + + if (replyError) + { + qWarning() << "AMBE::networkManagerFinished:" + << " error(" << (int) replyError + << "): " << replyError + << ": " << reply->errorString(); + } + else + { + QString answer = reply->readAll(); + answer.chop(1); // remove last \n + qDebug("AMBE::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); + } + + reply->deleteLater(); +} + +int AMBE::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAmbeSettings(new SWGSDRangel::SWGAMBESettings()); + response.getAmbeSettings()->init(); + webapiFormatFeatureSettings(response, m_settings); + return 200; +} + +int AMBE::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + AMBESettings settings = m_settings; + webapiUpdateFeatureSettings(settings, featureSettingsKeys, response); + + MsgConfigureAMBE *msg = MsgConfigureAMBE::create(settings, force); + m_inputMessageQueue.push(msg); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureAMBE *msgToGUI = MsgConfigureAMBE::create(settings, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatFeatureSettings(response, settings); + + return 200; +} + +int AMBE::webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAmbeReport(new SWGSDRangel::SWGAMBEReport()); + response.getAmbeReport()->init(); + webapiFormatFeatureReport(response); + return 200; +} + +void AMBE::webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const AMBESettings& settings) +{ + if (response.getAmbeSettings()->getTitle()) { + *response.getAmbeSettings()->getTitle() = settings.m_title; + } else { + response.getAmbeSettings()->setTitle(new QString(settings.m_title)); + } + + response.getAmbeSettings()->setRgbColor(settings.m_rgbColor); + response.getAmbeSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); + + if (response.getAmbeSettings()->getReverseApiAddress()) { + *response.getAmbeSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; + } else { + response.getAmbeSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); + } + + response.getAmbeSettings()->setReverseApiPort(settings.m_reverseAPIPort); + response.getAmbeSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex); + response.getAmbeSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex); + + if (settings.m_rollupState) + { + if (response.getAmbeSettings()->getRollupState()) + { + settings.m_rollupState->formatTo(response.getAmbeSettings()->getRollupState()); + } + else + { + SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState(); + settings.m_rollupState->formatTo(swgRollupState); + response.getAmbeSettings()->setRollupState(swgRollupState); + } + } +} + +void AMBE::webapiUpdateFeatureSettings( + AMBESettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response) +{ + if (featureSettingsKeys.contains("title")) { + settings.m_title = *response.getAmbeSettings()->getTitle(); + } + if (featureSettingsKeys.contains("rgbColor")) { + settings.m_rgbColor = response.getAmbeSettings()->getRgbColor(); + } + if (featureSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = response.getAmbeSettings()->getUseReverseApi() != 0; + } + if (featureSettingsKeys.contains("reverseAPIAddress")) { + settings.m_reverseAPIAddress = *response.getAmbeSettings()->getReverseApiAddress(); + } + if (featureSettingsKeys.contains("reverseAPIPort")) { + settings.m_reverseAPIPort = response.getAmbeSettings()->getReverseApiPort(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureSetIndex")) { + settings.m_reverseAPIFeatureSetIndex = response.getAmbeSettings()->getReverseApiFeatureSetIndex(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) { + settings.m_reverseAPIFeatureIndex = response.getAmbeSettings()->getReverseApiFeatureIndex(); + } + if (settings.m_rollupState && featureSettingsKeys.contains("rollupState")) { + settings.m_rollupState->updateFrom(featureSettingsKeys, response.getAmbeSettings()->getRollupState()); + } +} + +void AMBE::webapiReverseSendSettings(QList& featureSettingsKeys, const AMBESettings& settings, bool force) +{ + SWGSDRangel::SWGFeatureSettings *swgFeatureSettings = new SWGSDRangel::SWGFeatureSettings(); + // swgFeatureSettings->setOriginatorFeatureIndex(getIndexInDeviceSet()); + // swgFeatureSettings->setOriginatorFeatureSetIndex(getDeviceSetIndex()); + swgFeatureSettings->setFeatureType(new QString("AMBE")); + swgFeatureSettings->setAmbeSettings(new SWGSDRangel::SWGAMBESettings()); + SWGSDRangel::SWGAMBESettings *swgAMBESettings = swgFeatureSettings->getAmbeSettings(); + + // transfer data that has been modified. When force is on transfer all data except reverse API data + + if (featureSettingsKeys.contains("title") || force) { + swgAMBESettings->setTitle(new QString(settings.m_title)); + } + if (featureSettingsKeys.contains("rgbColor") || force) { + swgAMBESettings->setRgbColor(settings.m_rgbColor); + } + + QString channelSettingsURL = QString("http://%1:%2/sdrangel/featureset/%3/feature/%4/settings") + .arg(settings.m_reverseAPIAddress) + .arg(settings.m_reverseAPIPort) + .arg(settings.m_reverseAPIFeatureSetIndex) + .arg(settings.m_reverseAPIFeatureIndex); + m_networkRequest.setUrl(QUrl(channelSettingsURL)); + m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); + + QBuffer *buffer = new QBuffer(); + buffer->open((QBuffer::ReadWrite)); + buffer->write(swgFeatureSettings->asJson().toUtf8()); + buffer->seek(0); + + // Always use PATCH to avoid passing reverse API settings + QNetworkReply *reply = m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer); + buffer->setParent(reply); + + delete swgFeatureSettings; +} + +void AMBE::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response) +{ + // serial + + SWGSDRangel::SWGDVSerialDevices *swgDVSerialDevices = response.getAmbeReport()->getSerial(); + swgDVSerialDevices->init(); + + QList qDeviceNames; + getAMBEEngine()->scan(qDeviceNames); + swgDVSerialDevices->setNbDevices((int) qDeviceNames.size()); + QList *serialDeviceNamesList = swgDVSerialDevices->getDvSerialDevices(); + + for (const auto& deviceName : qDeviceNames) + { + serialDeviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); + serialDeviceNamesList->back()->init(); + *serialDeviceNamesList->back()->getDeviceName() = deviceName; + } + + // devices + + response.getAmbeReport()->setDevices(new QList); + QList deviceRefs; + getAMBEEngine()->getDeviceRefs(deviceRefs); + + for (auto& deviceRef : deviceRefs) + { + response.getAmbeReport()->getDevices()->append(new SWGSDRangel::SWGAMBEDeviceReport); + response.getAmbeReport()->getDevices()->back()->setDevicePath(new QString(deviceRef.m_devicePath)); + response.getAmbeReport()->getDevices()->back()->setSuccessCount(deviceRef.m_successCount); + response.getAmbeReport()->getDevices()->back()->setFailureCount(deviceRef.m_failureCount); + } +} + +int AMBE::webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage) +{ + SWGSDRangel::SWGAMBEActions *swgAMBEActions = query.getAmbeActions(); + + if (swgAMBEActions) + { + bool unknownAction = true; + + if (featureActionsKeys.contains("removeAll") && (swgAMBEActions->getRemoveAll() != 0)) + { + unknownAction = false; + getAMBEEngine()->releaseAll(); + + if (getMessageQueueToGUI()) + { + MsgReportDevices *msg = MsgReportDevices::create(); + getAMBEEngine()->scan(msg->getAvailableDevices()); + getAMBEEngine()->getDeviceRefs(msg->getUsedDevices()); + getMessageQueueToGUI()->push(msg); + } + } + + if (featureActionsKeys.contains("updateDevices")) + { + unknownAction = false; + bool updated = false; + SWGSDRangel::SWGAMBEDevices *swgAMBEDevices = swgAMBEActions->getUpdateDevices(); + QList *ambeList = swgAMBEDevices->getAmbeDevices(); + + for (QList::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) + { + updated = true; + + if ((*it)->getDelete() != 0) { + getAMBEEngine()->releaseController((*it)->getDeviceRef()->toStdString()); + } else { + getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString()); + } + } + + if (updated && getMessageQueueToGUI()) + { + MsgReportDevices *msg = MsgReportDevices::create(); + getAMBEEngine()->scan(msg->getAvailableDevices()); + getAMBEEngine()->getDeviceRefs(msg->getUsedDevices()); + getMessageQueueToGUI()->push(msg); + } + } + + if (unknownAction) + { + errorMessage = "Unknown action"; + return 400; + } + else + { + return 202; + } + } + else + { + errorMessage = "Missing AMBEActions in query"; + return 400; + } +} diff --git a/plugins/feature/ambe/ambe.h b/plugins/feature/ambe/ambe.h new file mode 100644 index 000000000..e4e317669 --- /dev/null +++ b/plugins/feature/ambe/ambe.h @@ -0,0 +1,142 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_AMBE_H_ +#define INCLUDE_FEATURE_AMBE_H_ + +#include +#include + +#include "feature/feature.h" +#include "util/message.h" + +#include "ambeengine.h" +#include "ambesettings.h" + +class WebAPIAdapterInterface; +class QNetworkAccessManager; +class QNetworkReply; + +class AMBE : public Feature +{ + Q_OBJECT +public: + class MsgConfigureAMBE : public Message { + MESSAGE_CLASS_DECLARATION + + public: + const AMBESettings& getSettings() const { return m_settings; } + bool getForce() const { return m_force; } + + static MsgConfigureAMBE* create(const AMBESettings& settings, bool force) { + return new MsgConfigureAMBE(settings, force); + } + + private: + AMBESettings m_settings; + bool m_force; + + MsgConfigureAMBE(const AMBESettings& settings, bool force) : + Message(), + m_settings(settings), + m_force(force) + { } + }; + + class MsgReportDevices : public Message { + MESSAGE_CLASS_DECLARATION + + public: + QList& getAvailableDevices() { return m_availableDevices; } + QList& getUsedDevices() { return m_usedDevices; } + + static MsgReportDevices* create() { + return new MsgReportDevices(); + } + + private: + QList m_availableDevices; + QList m_usedDevices; + + MsgReportDevices() : + Message() + {} + }; + + AMBE(WebAPIAdapterInterface *webAPIAdapterInterface); + virtual ~AMBE(); + virtual void destroy() { delete this; } + virtual bool handleMessage(const Message& cmd); + + virtual void getIdentifier(QString& id) const { id = objectName(); } + virtual QString getIdentifier() const { return objectName(); } + virtual void getTitle(QString& title) const { title = m_settings.m_title; } + + virtual QByteArray serialize() const; + virtual bool deserialize(const QByteArray& data); + + AMBEEngine *getAMBEEngine() { return &m_ambeEngine; } + + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage); + + virtual int webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage); + + static void webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const AMBESettings& settings); + + static void webapiUpdateFeatureSettings( + AMBESettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response); + + static const char* const m_featureIdURI; + static const char* const m_featureId; + +private: + AMBESettings m_settings; + AMBEEngine m_ambeEngine; + + QNetworkAccessManager *m_networkManager; + QNetworkRequest m_networkRequest; + + void start(); + void stop(); + void applySettings(const AMBESettings& settings, bool force = false); + void webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response); + void webapiReverseSendSettings(QList& featureSettingsKeys, const AMBESettings& settings, bool force); + +private slots: + void networkManagerFinished(QNetworkReply *reply); +}; + +#endif diff --git a/sdrbase/ambe/ambeengine.cpp b/plugins/feature/ambe/ambeengine.cpp similarity index 88% rename from sdrbase/ambe/ambeengine.cpp rename to plugins/feature/ambe/ambeengine.cpp index 8c56c4ec3..03571a8da 100644 --- a/sdrbase/ambe/ambeengine.cpp +++ b/plugins/feature/ambe/ambeengine.cpp @@ -43,6 +43,16 @@ #include "ambeworker.h" #include "ambeengine.h" +uint32_t AMBEEngine::AMBEController::getSuccessCount() const +{ + return worker ? worker->getSuccessCount() : 0; +} + +uint32_t AMBEEngine::AMBEController::getFailureCount() const +{ + return worker ? worker->getFailureCount() : 0; +} + AMBEEngine::AMBEEngine() {} @@ -54,6 +64,7 @@ AMBEEngine::~AMBEEngine() #if defined(_WIN32) void AMBEEngine::getComList() { + qDebug("AMBEEngine::getComList: Win"); m_comList.clear(); m_comList8250.clear(); char comCStr[16]; @@ -67,21 +78,23 @@ void AMBEEngine::getComList() } // Do not activate serial support at all for windows -void AMBEEngine::scan(std::vector& ambeDevices) +void AMBEEngine::scan(QList& ambeDevices) { (void) ambeDevices; } #elif defined(__APPLE__) void AMBEEngine::getComList() { + qDebug("AMBEEngine::getComList: Apple"); } -void AMBEEngine::scan(std::vector& ambeDevices) +void AMBEEngine::scan(QList& ambeDevices) { (void) ambeDevices; } #else void AMBEEngine::getComList() { + qDebug("AMBEEngine::getComList: Linux"); int n; struct dirent **namelist; m_comList.clear(); @@ -197,9 +210,10 @@ std::string AMBEEngine::get_driver(const std::string& tty) return ""; } -void AMBEEngine::scan(std::vector& ambeDevices) +void AMBEEngine::scan(QList& ambeDevices) { - getComList(); + qDebug("AMBEEngine::scan"); + AMBEEngine::getComList(); std::vector::const_iterator it = m_comList.begin(); ambeDevices.clear(); @@ -226,6 +240,7 @@ bool AMBEEngine::registerController(const std::string& deviceRef) if (worker->open(deviceRef)) { + qDebug("AMBEEngine::registerController: device: %s", deviceRef.c_str()); m_controllers.push_back(AMBEController()); m_controllers.back().worker = worker; m_controllers.back().thread = new QThread(); @@ -242,6 +257,7 @@ bool AMBEEngine::registerController(const std::string& deviceRef) return true; } + qWarning("AMBEEngine::registerController: failed to register device: %s", deviceRef.c_str()); return false; } @@ -285,13 +301,13 @@ void AMBEEngine::releaseAll() m_controllers.clear(); } -void AMBEEngine::getDeviceRefs(std::vector& deviceNames) +void AMBEEngine::getDeviceRefs(QList& deviceRefs) { std::vector::const_iterator it = m_controllers.begin(); while (it != m_controllers.end()) { - deviceNames.push_back(QString(it->device.c_str())); + deviceRefs.push_back(DeviceRef{QString(it->device.c_str()), it->getSuccessCount(), it->getFailureCount()}); ++it; } } @@ -340,47 +356,3 @@ void AMBEEngine::pushMbeFrame( } } } - -QByteArray AMBEEngine::serialize() const -{ - QStringList qDeviceList; - std::vector::const_iterator it = m_controllers.begin(); - - while (it != m_controllers.end()) - { - qDebug("AMBEEngine::serialize: %s", it->device.c_str()); - qDeviceList << QString(it->device.c_str()); - ++it; - } - - QByteArray data; - QDataStream *stream = new QDataStream(&data, QIODevice::WriteOnly); - (*stream) << qDeviceList; - delete stream; - - return data; -} - -bool AMBEEngine::deserialize(const QByteArray& data) -{ - if (data.size() <= 0) - { - qDebug("AMBEEngine::deserialize: invalid or no data"); - return false; - } - - QStringList qDeviceList; - QDataStream *stream = new QDataStream(data); - (*stream) >> qDeviceList; - delete stream; - - releaseAll(); - - for (int i = 0; i < qDeviceList.size(); ++i) - { - qDebug(" AMBEEngine::deserialize: %s", qDeviceList.at(i).toStdString().c_str()); - registerController(qDeviceList.at(i).toStdString()); - } - - return true; -} diff --git a/sdrbase/ambe/ambeengine.h b/plugins/feature/ambe/ambeengine.h similarity index 85% rename from sdrbase/ambe/ambeengine.h rename to plugins/feature/ambe/ambeengine.h index f083d17b7..21bbb421a 100644 --- a/sdrbase/ambe/ambeengine.h +++ b/plugins/feature/ambe/ambeengine.h @@ -25,26 +25,32 @@ #include #include #include +#include #include -#include "export.h" - class QThread; class AMBEWorker; class AudioFifo; -class SDRBASE_API AMBEEngine : public QObject +class AMBEEngine : public QObject { Q_OBJECT public: + struct DeviceRef + { + QString m_devicePath; //!< device path or url + uint32_t m_successCount; //!< number of frames successfully decoded + uint32_t m_failureCount; //!< number of frames failing decoding + }; + AMBEEngine(); ~AMBEEngine(); - void scan(std::vector& ambeDevices); + void scan(QList& ambeDevices); void releaseAll(); int getNbDevices() const { return m_controllers.size(); } //!< number of devices used - void getDeviceRefs(std::vector& devicesRefs); //!< reference of the devices used (device path or url) + void getDeviceRefs(QList& devicesRefs); //!< reference of the devices used bool registerController(const std::string& deviceRef); //!< create a new controller for the device in reference void releaseController(const std::string& deviceRef); //!< release controller resources for the device in reference @@ -57,9 +63,6 @@ public: int upsampling, AudioFifo *audioFifo); - QByteArray serialize() const; - bool deserialize(const QByteArray& data); - private: struct AMBEController { @@ -71,6 +74,9 @@ private: QThread *thread; AMBEWorker *worker; std::string device; + + uint32_t getSuccessCount() const; + uint32_t getFailureCount() const; }; #ifndef _WIN32 diff --git a/plugins/feature/ambe/ambegui.cpp b/plugins/feature/ambe/ambegui.cpp new file mode 100644 index 000000000..e99026cc2 --- /dev/null +++ b/plugins/feature/ambe/ambegui.cpp @@ -0,0 +1,377 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "feature/featureuiset.h" +#include "gui/basicfeaturesettingsdialog.h" +#include "gui/crightclickenabler.h" + +#include "ui_ambegui.h" +#include "ambegui.h" +#include "ambe.h" + +AMBEGUI* AMBEGUI::create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature) +{ + AMBEGUI* gui = new AMBEGUI(pluginAPI, featureUISet, feature); + return gui; +} + +void AMBEGUI::destroy() +{ + delete this; +} + +AMBEGUI::AMBEGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent) : + FeatureGUI(parent), + ui(new Ui::AMBEGUI), + m_pluginAPI(pluginAPI), + m_featureUISet(featureUISet), + m_doApplySettings(true) +{ + m_feature = feature; + setAttribute(Qt::WA_DeleteOnClose, true); + m_helpURL = "plugins/feature/ambe/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + + m_ambe = reinterpret_cast(feature); + m_ambe->setMessageQueueToGUI(&m_inputMessageQueue); + + m_settings.setRollupState(&m_rollupState); + + connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); + connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); + + populateSerialList(); + refreshInUseList(); + displaySettings(); + makeUIConnections(); +} + +AMBEGUI::~AMBEGUI() +{ + delete ui; +} + +void AMBEGUI::resetToDefaults() +{ + m_settings.resetToDefaults(); + displaySettings(); + applySettings(true); +} + +QByteArray AMBEGUI::serialize() const +{ + return m_settings.serialize(); +} + +bool AMBEGUI::deserialize(const QByteArray& data) +{ + if (m_settings.deserialize(data)) + { + m_feature->setWorkspaceIndex(m_settings.m_workspaceIndex); + displaySettings(); + refreshInUseList(); + return true; + } + else + { + resetToDefaults(); + return false; + } +} + +void AMBEGUI::setWorkspaceIndex(int index) +{ + m_settings.m_workspaceIndex = index; + m_feature->setWorkspaceIndex(index); +} + +void AMBEGUI::resizeEvent(QResizeEvent* size) +{ + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); + size->accept(); +} + +void AMBEGUI::onWidgetRolled(QWidget* widget, bool rollDown) +{ + (void) widget; + (void) rollDown; + + getRollupContents()->saveState(m_rollupState); + applySettings(); +} + +void AMBEGUI::onMenuDialogCalled(const QPoint &p) +{ + if (m_contextMenuType == ContextMenuChannelSettings) + { + BasicFeatureSettingsDialog dialog(this); + dialog.setTitle(m_settings.m_title); + dialog.setUseReverseAPI(m_settings.m_useReverseAPI); + dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); + dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); + dialog.setReverseAPIFeatureSetIndex(m_settings.m_reverseAPIFeatureSetIndex); + dialog.setReverseAPIFeatureIndex(m_settings.m_reverseAPIFeatureIndex); + dialog.setDefaultTitle(m_displayedName); + + dialog.move(p); + dialog.exec(); + + m_settings.m_title = dialog.getTitle(); + m_settings.m_useReverseAPI = dialog.useReverseAPI(); + m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); + m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); + m_settings.m_reverseAPIFeatureSetIndex = dialog.getReverseAPIFeatureSetIndex(); + m_settings.m_reverseAPIFeatureIndex = dialog.getReverseAPIFeatureIndex(); + + setTitle(m_settings.m_title); + setTitleColor(m_settings.m_rgbColor); + + applySettings(); + } + + resetContextMenuType(); +} + +void AMBEGUI::displaySettings() +{ + setTitleColor(m_settings.m_rgbColor); + setWindowTitle(m_settings.m_title); + setTitle(m_settings.m_title); +} + +void AMBEGUI::applySettings(bool force) +{ + if (m_doApplySettings) + { + AMBE::MsgConfigureAMBE* message = AMBE::MsgConfigureAMBE::create( m_settings, force); + m_ambe->getInputMessageQueue()->push(message); + } +} + +bool AMBEGUI::handleMessage(const Message& message) +{ + if (AMBE::MsgConfigureAMBE::match(message)) + { + qDebug("AMBEGUI::handleMessage: AMBE::MsgConfigureAMBE"); + const AMBE::MsgConfigureAMBE& cfg = (AMBE::MsgConfigureAMBE&) message; + m_settings = cfg.getSettings(); + displaySettings(); + return true; + } + else if (AMBE::MsgReportDevices::match(message)) + { + qDebug("AMBEGUI::handleMessage: AMBE::MsgReportDevices"); + AMBE::MsgReportDevices& cfg = (AMBE::MsgReportDevices&) message; + ui->ambeSerialDevices->clear(); + ui->statusText->setText("Updated all devices lists"); + + for (const auto& ambeDevice : cfg.getAvailableDevices()) { + ui->ambeSerialDevices->addItem(ambeDevice); + } + + ui->ambeDeviceRefs->clear(); + + for (const auto& inUseDevice : cfg.getUsedDevices()) { + ui->ambeDeviceRefs->addItem( + tr("%1 - %2|%3") + .arg(inUseDevice.m_devicePath) + .arg(inUseDevice.m_successCount) + .arg(inUseDevice.m_failureCount) + ); + } + + return true; + } + + return false; +} + +void AMBEGUI::handleInputMessages() +{ + Message* message; + + while ((message = getInputMessageQueue()->pop())) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +void AMBEGUI::populateSerialList() +{ + QList ambeSerialDevices; + m_ambe->getAMBEEngine()->scan(ambeSerialDevices); + ui->ambeSerialDevices->clear(); + + for (const auto& ambeDevice : ambeSerialDevices) { + ui->ambeSerialDevices->addItem(ambeDevice); + } +} + +void AMBEGUI::refreshInUseList() +{ + QList inUseDevices; + m_ambe->getAMBEEngine()->getDeviceRefs(inUseDevices); + ui->ambeDeviceRefs->clear(); + + for (const auto& inUseDevice : inUseDevices) + { + qDebug("AMBEGUI::refreshInUseList: %s", qPrintable(inUseDevice.m_devicePath)); + ui->ambeDeviceRefs->addItem( + tr("%1 - %2|%3") + .arg(inUseDevice.m_devicePath) + .arg(inUseDevice.m_successCount) + .arg(inUseDevice.m_failureCount) + ); + } +} +void AMBEGUI::on_importSerial_clicked() +{ + QListWidgetItem *serialItem = ui->ambeSerialDevices->currentItem(); + + if (!serialItem) + { + ui->statusText->setText("No selection"); + return; + } + + QString serialName = serialItem->text(); + QList foundItems = ui->ambeDeviceRefs->findItems(serialName, Qt::MatchFixedString|Qt::MatchCaseSensitive); + + if (foundItems.size() == 0) + { + if (m_ambe->getAMBEEngine()->registerController(serialName.toStdString())) + { + ui->ambeDeviceRefs->addItem(tr("%1 - 0|0").arg(serialName)); + ui->statusText->setText(tr("%1 added").arg(serialName)); + } + else + { + ui->statusText->setText(tr("Cannot open %1").arg(serialName)); + } + } + else + { + ui->statusText->setText("Device already in use"); + } +} + +void AMBEGUI::on_importAllSerial_clicked() +{ + int count = 0; + + for (int i = 0; i < ui->ambeSerialDevices->count(); i++) + { + const QListWidgetItem *serialItem = ui->ambeSerialDevices->item(i); + QString serialName = serialItem->text(); + QList foundItems = ui->ambeDeviceRefs->findItems(serialName, Qt::MatchFixedString|Qt::MatchCaseSensitive); + + if (foundItems.size() == 0) + { + if (m_ambe->getAMBEEngine()->registerController(serialName.toStdString())) + { + ui->ambeDeviceRefs->addItem(serialName); + count++; + } + } + } + + ui->statusText->setText(tr("%1 devices added").arg(count)); +} + +void AMBEGUI::on_removeAmbeDevice_clicked() +{ + QListWidgetItem *deviceItem = ui->ambeDeviceRefs->currentItem(); + + if (!deviceItem) + { + ui->statusText->setText("No selection"); + return; + } + + QString deviceName = deviceItem->text().split(" ").at(0); + m_ambe->getAMBEEngine()->releaseController(deviceName.toStdString()); + ui->statusText->setText(tr("%1 removed").arg(deviceName)); + refreshInUseList(); +} + +void AMBEGUI::on_refreshAmbeList_clicked() +{ + refreshInUseList(); + ui->statusText->setText("In use refreshed"); +} + +void AMBEGUI::on_refreshSerial_clicked() +{ + populateSerialList(); + ui->statusText->setText("Serial refreshed"); +} + +void AMBEGUI::on_clearAmbeList_clicked() +{ + if (ui->ambeDeviceRefs->count() == 0) + { + ui->statusText->setText("No active items"); + return; + } + + m_ambe->getAMBEEngine()->releaseAll(); + ui->ambeDeviceRefs->clear(); + ui->statusText->setText("All items released"); +} + +void AMBEGUI::on_importAddress_clicked() +{ + QString addressAndPort = ui->ambeAddressText->text(); + + QList foundItems = ui->ambeDeviceRefs->findItems(addressAndPort, Qt::MatchFixedString|Qt::MatchCaseSensitive); + + if (foundItems.size() == 0) + { + if (m_ambe->getAMBEEngine()->registerController(addressAndPort.toStdString())) + { + ui->ambeDeviceRefs->addItem(addressAndPort); + ui->statusText->setText(tr("%1 added").arg(addressAndPort)); + } + else + { + ui->statusText->setText(tr("Cannot open %1").arg(addressAndPort)); + } + } + else + { + ui->statusText->setText("Address already in use"); + } +} + +void AMBEGUI::makeUIConnections() +{ + QObject::connect(ui->importSerial, &QPushButton::clicked, this, &AMBEGUI::on_importSerial_clicked); + QObject::connect(ui->importAllSerial, &QPushButton::clicked, this, &AMBEGUI::on_importAllSerial_clicked); + QObject::connect(ui->removeAmbeDevice, &QPushButton::clicked, this, &AMBEGUI::on_removeAmbeDevice_clicked); + QObject::connect(ui->refreshAmbeList, &QPushButton::clicked, this, &AMBEGUI::on_refreshAmbeList_clicked); + QObject::connect(ui->refreshSerial, &QPushButton::clicked, this, &AMBEGUI::on_refreshSerial_clicked); + QObject::connect(ui->clearAmbeList, &QPushButton::clicked, this, &AMBEGUI::on_clearAmbeList_clicked); + QObject::connect(ui->importAddress, &QPushButton::clicked, this, &AMBEGUI::on_importAddress_clicked); +} diff --git a/plugins/feature/ambe/ambegui.h b/plugins/feature/ambe/ambegui.h new file mode 100644 index 000000000..838a887e9 --- /dev/null +++ b/plugins/feature/ambe/ambegui.h @@ -0,0 +1,93 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_AMBEGUI_H_ +#define INCLUDE_FEATURE_AMBEGUI_H_ + +#include "feature/featuregui.h" +#include "util/messagequeue.h" +#include "util/movingaverage.h" +#include "settings/rollupstate.h" + +#include "ambesettings.h" + +class PluginAPI; +class FeatureUISet; +class Feature; +class AMBE; +class DSPDeviceSourceEngine; +class DSPDeviceSinkEngine; + +namespace Ui { + class AMBEGUI; +} + +class AMBEGUI : public FeatureGUI +{ + Q_OBJECT +public: + static AMBEGUI* create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature); + virtual void destroy(); + + void resetToDefaults(); + QByteArray serialize() const; + bool deserialize(const QByteArray& data); + virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } + virtual void setWorkspaceIndex(int index); + virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; } + virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; } + virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; } + +protected: + void resizeEvent(QResizeEvent* size); + +private: + Ui::AMBEGUI* ui; + AMBE *m_ambe; + PluginAPI* m_pluginAPI; + FeatureUISet* m_featureUISet; + AMBESettings m_settings; + RollupState m_rollupState; + bool m_doApplySettings; + MessageQueue m_inputMessageQueue; + + explicit AMBEGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr); + virtual ~AMBEGUI(); + + void populateSerialList(); + void refreshInUseList(); + + void blockApplySettings(bool block) { m_doApplySettings = !block; } + void applySettings(bool force = false); + void displaySettings(); + bool handleMessage(const Message& message); + void makeUIConnections(); + +private slots: + void onMenuDialogCalled(const QPoint &p); + void onWidgetRolled(QWidget* widget, bool rollDown); + void handleInputMessages(); + void on_importSerial_clicked(); + void on_importAllSerial_clicked(); + void on_removeAmbeDevice_clicked(); + void on_refreshAmbeList_clicked(); + void on_refreshSerial_clicked(); + void on_clearAmbeList_clicked(); + void on_importAddress_clicked(); +}; + +#endif diff --git a/plugins/feature/ambe/ambegui.ui b/plugins/feature/ambe/ambegui.ui new file mode 100644 index 000000000..c225f95f2 --- /dev/null +++ b/plugins/feature/ambe/ambegui.ui @@ -0,0 +1,299 @@ + + + AMBEGUI + + + + 0 + 0 + 360 + 452 + + + + + 0 + 0 + + + + + 360 + 452 + + + + + 560 + 452 + + + + + Liberation Sans + 9 + + + + AMBE Decoder Controller + + + + + 0 + 0 + 358 + 450 + + + + Settings + + + + 3 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + AMBE server IP and port or direct input + + + + + + + + + + + AMBE server address as ip:port or direct input + + + + + + + + + + + + + + In use + + + + + + + Use server + + + + + + + :/arrow_down.png:/arrow_down.png + + + + + + + Remove selected device or server + + + + + + + :/bin.png:/bin.png + + + + + + + Remove all devices + + + + + + + :/sweep.png:/sweep.png + + + + + + + Refresh list of devices and servers in use + + + + + + + :/recycle.png:/recycle.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 16777215 + 140 + + + + List of devices/servers in use + + + + + + + + + + + Serial devices + + + + + + + Use serial device + + + + + + + :/arrow_up.png:/arrow_up.png + + + + + + + Use all serial devices + + + + + + + :/double_arrow_up.png:/double_arrow_up.png + + + + + + + Refresh AMBE serial devices list + + + + + + + :/recycle.png:/recycle.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 16777215 + 140 + + + + List of AMBE serial devices in the system + + + + + + + + + + + ... + + + + + + + + + + + RollupContents + QWidget +
gui/rollupcontents.h
+ 1 +
+
+ + + + +
diff --git a/plugins/feature/ambe/ambeplugin.cpp b/plugins/feature/ambe/ambeplugin.cpp new file mode 100644 index 000000000..495e8881a --- /dev/null +++ b/plugins/feature/ambe/ambeplugin.cpp @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + + +#include +#include "plugin/pluginapi.h" + +#ifndef SERVER_MODE +#include "ambegui.h" +#endif +#include "ambe.h" +#include "ambeplugin.h" +#include "ambewebapiadapter.h" + +const PluginDescriptor AMBEPlugin::m_pluginDescriptor = { + AMBE::m_featureId, + QStringLiteral("AMBE Controller"), + QStringLiteral("7.2.1"), + QStringLiteral("(c) Edouard Griffiths, F4EXB"), + QStringLiteral("https://github.com/f4exb/sdrangel"), + true, + QStringLiteral("https://github.com/f4exb/sdrangel") +}; + +AMBEPlugin::AMBEPlugin(QObject* parent) : + QObject(parent), + m_pluginAPI(nullptr) +{ +} + +const PluginDescriptor& AMBEPlugin::getPluginDescriptor() const +{ + return m_pluginDescriptor; +} + +void AMBEPlugin::initPlugin(PluginAPI* pluginAPI) +{ + m_pluginAPI = pluginAPI; + + // register Simple PTT feature + m_pluginAPI->registerFeature(AMBE::m_featureIdURI, AMBE::m_featureId, this); +} + +#ifdef SERVER_MODE +FeatureGUI* AMBEPlugin::createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const +{ + (void) featureUISet; + (void) feature; + return nullptr; +} +#else +FeatureGUI* AMBEPlugin::createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const +{ + return AMBEGUI::create(m_pluginAPI, featureUISet, feature); +} +#endif + +Feature* AMBEPlugin::createFeature(WebAPIAdapterInterface* webAPIAdapterInterface) const +{ + return new AMBE(webAPIAdapterInterface); +} + +FeatureWebAPIAdapter* AMBEPlugin::createFeatureWebAPIAdapter() const +{ + return new AMBEWebAPIAdapter(); +} diff --git a/sdrgui/gui/ambedevicesdialog.h b/plugins/feature/ambe/ambeplugin.h similarity index 58% rename from sdrgui/gui/ambedevicesdialog.h rename to plugins/feature/ambe/ambeplugin.h index d32009e5a..2d95587b7 100644 --- a/sdrgui/gui/ambedevicesdialog.h +++ b/plugins/feature/ambe/ambeplugin.h @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 F4EXB // -// written by Edouard Griffiths // +// Copyright (C) 2022 Edouard Griffiths, F4EXB // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -16,41 +15,34 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#ifndef SDRGUI_GUI_AMBEDEVICESDIALOG_H_ -#define SDRGUI_GUI_AMBEDEVICESDIALOG_H_ +#ifndef INCLUDE_FEATURE_AMBEPLUGIN_H +#define INCLUDE_FEATURE_AMBEPLUGIN_H -#include +#include +#include "plugin/plugininterface.h" -#include "export.h" -#include "ambe/ambeengine.h" +class FeatureGUI; +class WebAPIAdapterInterface; -class QListWidgetItem; - -namespace Ui { - class AMBEDevicesDialog; -} - -class SDRGUI_API AMBEDevicesDialog : public QDialog { - Q_OBJECT +class AMBEPlugin : public QObject, PluginInterface { + Q_OBJECT + Q_INTERFACES(PluginInterface) + Q_PLUGIN_METADATA(IID "sdrangel.feature.ambe") public: - explicit AMBEDevicesDialog(AMBEEngine* ambeEngine, QWidget* parent = nullptr); - ~AMBEDevicesDialog(); + explicit AMBEPlugin(QObject* parent = nullptr); + + const PluginDescriptor& getPluginDescriptor() const; + void initPlugin(PluginAPI* pluginAPI); + + virtual FeatureGUI* createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const; + virtual Feature* createFeature(WebAPIAdapterInterface *webAPIAdapterInterface) const; + virtual FeatureWebAPIAdapter* createFeatureWebAPIAdapter() const; private: - void populateSerialList(); - void refreshInUseList(); + static const PluginDescriptor m_pluginDescriptor; - Ui::AMBEDevicesDialog* ui; - AMBEEngine* m_ambeEngine; - -private slots: - void on_importSerial_clicked(); - void on_importAllSerial_clicked(); - void on_removeAmbeDevice_clicked(); - void on_refreshAmbeList_clicked(); - void on_clearAmbeList_clicked(); - void on_importAddress_clicked(); + PluginAPI* m_pluginAPI; }; -#endif // SDRGUI_GUI_AMBEDEVICESDIALOG_H_ +#endif // INCLUDE_FEATURE_AMBEPLUGIN_H diff --git a/plugins/feature/ambe/ambesettings.cpp b/plugins/feature/ambe/ambesettings.cpp new file mode 100644 index 000000000..13610c10e --- /dev/null +++ b/plugins/feature/ambe/ambesettings.cpp @@ -0,0 +1,114 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include + +#include "util/simpleserializer.h" +#include "settings/serializable.h" + +#include "ambesettings.h" + +AMBESettings::AMBESettings() : + m_rollupState(nullptr) +{ + resetToDefaults(); +} + +void AMBESettings::resetToDefaults() +{ + m_title = "AMBE Controller"; + m_rgbColor = QColor(255, 0, 0).rgb(); + m_useReverseAPI = false; + m_reverseAPIAddress = "127.0.0.1"; + m_reverseAPIPort = 8888; + m_reverseAPIFeatureSetIndex = 0; + m_reverseAPIFeatureIndex = 0; + m_workspaceIndex = 0; +} + +QByteArray AMBESettings::serialize() const +{ + SimpleSerializer s(1); + + s.writeString(1, m_title); + s.writeU32(2, m_rgbColor); + s.writeBool(7, m_useReverseAPI); + s.writeString(8, m_reverseAPIAddress); + s.writeU32(9, m_reverseAPIPort); + s.writeU32(10, m_reverseAPIFeatureSetIndex); + s.writeU32(11, m_reverseAPIFeatureIndex); + + if (m_rollupState) { + s.writeBlob(12, m_rollupState->serialize()); + } + + s.writeS32(18, m_workspaceIndex); + s.writeBlob(19, m_geometryBytes); + + return s.final(); +} + +bool AMBESettings::deserialize(const QByteArray& data) +{ + SimpleDeserializer d(data); + + if(!d.isValid()) + { + resetToDefaults(); + return false; + } + + if(d.getVersion() == 1) + { + QByteArray bytetmp; + uint32_t utmp; + QString strtmp; + + d.readString(1, &m_title, "Simple PTT"); + d.readU32(2, &m_rgbColor, QColor(255, 0, 0).rgb()); + d.readBool(7, &m_useReverseAPI, false); + d.readString(8, &m_reverseAPIAddress, "127.0.0.1"); + d.readU32(9, &utmp, 0); + + if ((utmp > 1023) && (utmp < 65535)) { + m_reverseAPIPort = utmp; + } else { + m_reverseAPIPort = 8888; + } + + d.readU32(10, &utmp, 0); + m_reverseAPIFeatureSetIndex = utmp > 99 ? 99 : utmp; + d.readU32(11, &utmp, 0); + m_reverseAPIFeatureIndex = utmp > 99 ? 99 : utmp; + + if (m_rollupState) + { + d.readBlob(12, &bytetmp); + m_rollupState->deserialize(bytetmp); + } + + d.readS32(18, &m_workspaceIndex, 0); + d.readBlob(19, &m_geometryBytes); + + return true; + } + else + { + resetToDefaults(); + return false; + } +} diff --git a/plugins/feature/ambe/ambesettings.h b/plugins/feature/ambe/ambesettings.h new file mode 100644 index 000000000..5201a2c8f --- /dev/null +++ b/plugins/feature/ambe/ambesettings.h @@ -0,0 +1,46 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_AMBESETTINGS_H_ +#define INCLUDE_FEATURE_AMBESETTINGS_H_ + +#include +#include + +class Serializable; + +struct AMBESettings +{ + QString m_title; + quint32 m_rgbColor; + bool m_useReverseAPI; + QString m_reverseAPIAddress; + uint16_t m_reverseAPIPort; + uint16_t m_reverseAPIFeatureSetIndex; + uint16_t m_reverseAPIFeatureIndex; + Serializable *m_rollupState; + int m_workspaceIndex; + QByteArray m_geometryBytes; + + AMBESettings(); + void resetToDefaults(); + QByteArray serialize() const; + bool deserialize(const QByteArray& data); + void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } +}; + +#endif // INCLUDE_FEATURE_AMBESETTINGS_H_ diff --git a/plugins/feature/ambe/ambewebapiadapter.cpp b/plugins/feature/ambe/ambewebapiadapter.cpp new file mode 100644 index 000000000..3d8c86ab1 --- /dev/null +++ b/plugins/feature/ambe/ambewebapiadapter.cpp @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "SWGFeatureSettings.h" +#include "ambe.h" +#include "ambewebapiadapter.h" + +AMBEWebAPIAdapter::AMBEWebAPIAdapter() +{} + +AMBEWebAPIAdapter::~AMBEWebAPIAdapter() +{} + +int AMBEWebAPIAdapter::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setAmbeSettings(new SWGSDRangel::SWGAMBESettings()); + response.getAmbeSettings()->init(); + AMBE::webapiFormatFeatureSettings(response, m_settings); + + return 200; +} + +int AMBEWebAPIAdapter::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) force; // no action + (void) errorMessage; + AMBE::webapiUpdateFeatureSettings(m_settings, featureSettingsKeys, response); + + return 200; +} diff --git a/plugins/feature/ambe/ambewebapiadapter.h b/plugins/feature/ambe/ambewebapiadapter.h new file mode 100644 index 000000000..d053cb9b0 --- /dev/null +++ b/plugins/feature/ambe/ambewebapiadapter.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_AMBE_WEBAPIADAPTER_H +#define INCLUDE_AMBE_WEBAPIADAPTER_H + +#include "feature/featurewebapiadapter.h" +#include "ambesettings.h" + +/** + * Standalone API adapter only for the settings + */ +class AMBEWebAPIAdapter : public FeatureWebAPIAdapter { +public: + AMBEWebAPIAdapter(); + virtual ~AMBEWebAPIAdapter(); + + virtual QByteArray serialize() const { return m_settings.serialize(); } + virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); } + + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + +private: + AMBESettings m_settings; +}; + +#endif // INCLUDE_AIS_WEBAPIADAPTER_H diff --git a/sdrbase/ambe/ambeworker.cpp b/plugins/feature/ambe/ambeworker.cpp similarity index 98% rename from sdrbase/ambe/ambeworker.cpp rename to plugins/feature/ambe/ambeworker.cpp index 37713daba..11c6f2ae3 100644 --- a/sdrbase/ambe/ambeworker.cpp +++ b/plugins/feature/ambe/ambeworker.cpp @@ -33,7 +33,9 @@ AMBEWorker::AMBEWorker() : m_upsamplerLastValue(0.0f), m_phase(0), m_upsampling(1), - m_volume(1.0f) + m_volume(1.0f), + m_successCount(0), + m_failureCount(0) { m_audioBuffer.resize(48000); m_audioBufferFill = 0; @@ -119,10 +121,13 @@ void AMBEWorker::handleInputMessages() m_audioBufferFill = 0; } + + m_successCount++; } else { qDebug("AMBEWorker::handleInputMessages: MsgMbeDecode: decode failed"); + m_failureCount++; } } diff --git a/sdrbase/ambe/ambeworker.h b/plugins/feature/ambe/ambeworker.h similarity index 96% rename from sdrbase/ambe/ambeworker.h rename to plugins/feature/ambe/ambeworker.h index e6136c139..b3879d7a4 100644 --- a/sdrbase/ambe/ambeworker.h +++ b/plugins/feature/ambe/ambeworker.h @@ -34,7 +34,7 @@ class AudioFifo; -class SDRBASE_API AMBEWorker : public QObject { +class AMBEWorker : public QObject { Q_OBJECT public: class MsgTest : public Message @@ -115,6 +115,8 @@ public: void stop(); bool isAvailable(); bool hasFifo(AudioFifo *audioFifo); + uint32_t getSuccessCount() const { return m_successCount; } + uint32_t getFailureCount() const { return m_failureCount; } void postTest() { @@ -151,6 +153,8 @@ private: float m_volume; float m_upsamplingFactors[7]; AudioCompressor m_compressor; + uint32_t m_successCount; + uint32_t m_failureCount; }; #endif // SDRBASE_AMBE_AMBEWORKER_H_ diff --git a/plugins/feature/ambe/readme.md b/plugins/feature/ambe/readme.md new file mode 100644 index 000000000..9b6bdf98e --- /dev/null +++ b/plugins/feature/ambe/readme.md @@ -0,0 +1,73 @@ +

AMBE controller

+ +

Introduction

+ +Control AMBE3000 serial a.k.a. DV serial devices or AMBE server addresses to use for AMBE digital voice processing. + +DV serial devices are supported using the [SerialDV](https://github.com/f4exb/serialDV) library that is a mandatory requirement for this feature to be compiled. Therefore you have to compile and install SerialDV in your system. Please refer to this project Readme.md to compile and install SerialDV. f you install it in a custom location say `/opt/install/serialdv` you will need to add this define to the cmake command: `-DSERIALDV_DIR=/opt/install/serialdv` + +To effectively use serial DV devices for AMBE decoding you will have to add at least one device to the list of AMBE devices (6) in use. + +Although such serial devices work with a serial interface at 400 kb in practice maybe for other reasons they are capable of handling only one conversation at a time. The software will allocate the device dynamically to a conversation with an inactivity timeout of 1 second so that conversations do not get interrupted constantly making the audio output too choppy. In practice you will have to have as many devices listed in (6) as the number of conversations you would like to be handled in parallel. + +--- +⚠ With kernel 4.4.52 and maybe other 4.4 versions the default for FTDI devices (that is in the ftdi_sio kernel module) is not to set it as low latency. This results in the ThumbDV dongle not working anymore because its response is too slow to sustain the normal AMBE packets flow. The solution is to force low latency by changing the variable for your device (ex: /dev/ttyUSB0) as follows: + +`echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer` or `sudo setserial /dev/ttyUSB0 low_latency` + +Newer kernels do not seem to have this issue. + +--- + +

Interface

+ +![AMBE controller GUI](../../../doc/img/AMBE_plugin.png) + + +

1: AMBE server address and port or direct input

+ +Use this freeflow text input box to specify either the address and port of an AMBE server in the form: <IPv4 address>:<port> or any directly attached physical device address. + +

2: Import above address or device

+ +Import the address or device specified in (1) into the list of used devices. The system will try to open the device or contact the server and will add it to the list only if successful. + +

3: Remove in use device or address

+ +When a device or address is selected in the in use list (6) push this button to remove it from the list. The corresponding resources will be released. + +

4: Refresh in use list

+ +Checks the list of devices or addresses currently in use and update the in use list (6). + +

5: Empty in use list

+ +Removes all devices or addresses in use. The in use list (6) is cleared consequently. This removes all AMBE devices related resources attached to the current instance of the SDRangel program. Therefore consecutive AMBE frames decoding will be handled by the mbelib library if available or no audio will be output. + +

6: In use list

+ +List of devices or addresses currently in use for AMBE frames decoding by this feature. + +Format is the device path or URL followed by a dash then the number of frames successfully decoded then a vertical bar then the number of frames that failed decoding. i.e: + +` - |` + +

7: Import serial device

+ +Imports a serial device scanned in the list of available AMBE 3000 serial devices (10) in the in use list. If this device is already in the in use list then nothing happens and this is reported in the status text (11) + +

8: Import all serial devices

+ +Imports all serial devices scanned in the list of available AMBE 3000 serial devices (9) in the in use list. If any device is already in the in use list then it is not added twice. + +

9: Refresh list of AMBE serial devices

+ +Scans available AMBE 3000 serial devices and updates the list. + +

10: List of AMBE 3000 serial devices

+ +List of AMBE 3000 connected to the system. Use button (9) to update the list. + +

11: Status text

+ +A brief text reports the result of the current action. diff --git a/plugins/feature/limerfe/CMakeLists.txt b/plugins/feature/limerfe/CMakeLists.txt new file mode 100644 index 000000000..6ed968ef8 --- /dev/null +++ b/plugins/feature/limerfe/CMakeLists.txt @@ -0,0 +1,63 @@ +project(limerfe) + +set(limerfe_SOURCES + limerfe.cpp + limerfesettings.cpp + limerfeusbcalib.cpp + limerfeplugin.cpp + limerfewebapiadapter.cpp +) + +set(limerfe_HEADERS + limerfe.h + limerfesettings.h + limerfeusbcalib.h + limerfeplugin.h + limerfewebapiadapter.h +) + +include_directories( + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${LIMESUITE_INCLUDE_DIR} +) + +if(NOT SERVER_MODE) + set(limerfe_SOURCES + ${limerfe_SOURCES} + limerfegui.cpp + limerfegui.ui + ) + set(limerfe_HEADERS + ${limerfe_HEADERS} + limerfegui.h + ) + + set(TARGET_NAME featurelimerfe) + set(TARGET_LIB "Qt5::Widgets") + set(TARGET_LIB_GUI "sdrgui") + set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) +else() + set(TARGET_NAME featurelimerfesrv) + set(TARGET_LIB "") + set(TARGET_LIB_GUI "") + set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) +endif() + +add_library(${TARGET_NAME} SHARED + ${limerfe_SOURCES} +) + +target_link_libraries(${TARGET_NAME} + Qt5::Core + ${TARGET_LIB} + sdrbase + ${TARGET_LIB_GUI} + ${LIMESUITE_LIBRARY} +) + +install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) + +# Install debug symbols +if (WIN32) + install(FILES $ CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${INSTALL_FOLDER} ) +endif() diff --git a/plugins/feature/limerfe/limerfe.cpp b/plugins/feature/limerfe/limerfe.cpp new file mode 100644 index 000000000..bf49c64bd --- /dev/null +++ b/plugins/feature/limerfe/limerfe.cpp @@ -0,0 +1,1087 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include "SWGDeviceState.h" +#include "SWGErrorResponse.h" +#include "SWGFeatureSettings.h" +#include "SWGFeatureReport.h" +#include "SWGFeatureActions.h" + +#include "util/simpleserializer.h" +#include "util/serialutil.h" +#include "settings/serializable.h" +#include "webapi/webapiadapterinterface.h" + +#include "limerfe.h" + +MESSAGE_CLASS_DEFINITION(LimeRFE::MsgConfigureLimeRFE, Message) +MESSAGE_CLASS_DEFINITION(LimeRFE::MsgReportSetRx, Message) +MESSAGE_CLASS_DEFINITION(LimeRFE::MsgReportSetTx, Message) + +const char* const LimeRFE::m_featureIdURI = "sdrangel.feature.limerfe"; +const char* const LimeRFE::m_featureId = "LimeRFE"; + +const std::map LimeRFE::m_errorCodesMap = { + { 0, "OK"}, + {-4, "Error synchronizing communication"}, + {-3, "Non-configurable GPIO pin specified. Only pins 4 and 5 are configurable."}, + {-2, "Problem with .ini configuration file"}, + {-1, "Communication error"}, + { 1, "Wrong TX connector - not possible to route TX of the selecrted channel to the specified port"}, + { 2, "Wrong RX connector - not possible to route RX of the selecrted channel to the specified port"}, + { 3, "Mode TXRX not allowed - when the same port is selected for RX and TX, it is not allowed to use mode RX & TX"}, + { 4, "Wrong mode for cellular channel - Cellular FDD bands (1, 2, 3, and 7) are only allowed mode RX & TX, while TDD band 38 is allowed only RX or TX mode"}, + { 5, "Cellular channels must be the same both for RX and TX"}, + { 6, "Requested channel code is wrong"} +}; + +LimeRFE::LimeRFE(WebAPIAdapterInterface *webAPIAdapterInterface) : + Feature(m_featureIdURI, webAPIAdapterInterface), + m_webAPIAdapterInterface(webAPIAdapterInterface), + m_rfeDevice(nullptr) +{ + setObjectName(m_featureId); + m_state = StIdle; + m_errorMessage = "LimeRFE error"; + m_networkManager = new QNetworkAccessManager(); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeRFE::networkManagerFinished + ); + listComPorts(); +} + +LimeRFE::~LimeRFE() +{ + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeRFE::networkManagerFinished + ); + delete m_networkManager; + closeDevice(); +} + +void LimeRFE::start() +{ + qDebug("LimeRFE::start"); + m_state = StRunning; +} + +void LimeRFE::stop() +{ + qDebug("LimeRFE::stop"); + m_state = StIdle; +} + +void LimeRFE::listComPorts() +{ + m_comPorts.clear(); + std::vector comPorts; + SerialUtil::getComPorts(comPorts, "ttyUSB[0-9]+"); // regex is for Linux only + + for (std::vector::const_iterator it = comPorts.begin(); it != comPorts.end(); ++it) { + m_comPorts.push_back(QString(it->c_str())); + } +} + +void LimeRFE::applySettings(const LimeRFESettings& settings, bool force) +{ + (void) force; + m_settings = settings; +} + +bool LimeRFE::handleMessage(const Message& cmd) +{ + if (MsgConfigureLimeRFE::match(cmd)) + { + MsgConfigureLimeRFE& cfg = (MsgConfigureLimeRFE&) cmd; + qDebug() << "LimeRFE::handleMessage: MsgConfigureLimeRFE"; + applySettings(cfg.getSettings(), cfg.getForce()); + + return true; + } + + return false; +} + +QByteArray LimeRFE::serialize() const +{ + SimpleSerializer s(1); + s.writeBlob(1, m_settings.serialize()); + return s.final(); +} + +bool LimeRFE::deserialize(const QByteArray& data) +{ + SimpleDeserializer d(data); + + if (!d.isValid()) + { + m_settings.resetToDefaults(); + return false; + } + + if (d.getVersion() == 1) + { + QByteArray bytetmp; + d.readBlob(1, &bytetmp); + + if (m_settings.deserialize(bytetmp)) + { + MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(m_settings, true); + m_inputMessageQueue.push(msg); + return true; + } + else + { + m_settings.resetToDefaults(); + MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(m_settings, true); + m_inputMessageQueue.push(msg); + return false; + } + } + else + { + return false; + } +} + +int LimeRFE::openDevice(const std::string& serialDeviceName) +{ + closeDevice(); + + rfe_dev_t *rfeDevice = RFE_Open(serialDeviceName.c_str(), nullptr); + + if (rfeDevice != (void *) -1) + { + m_rfeDevice = rfeDevice; + return 0; + } + else + { + return -1; + } +} + +void LimeRFE::closeDevice() +{ + if (m_rfeDevice) + { + RFE_Close(m_rfeDevice); + m_rfeDevice = nullptr; + } +} + +int LimeRFE::configure() +{ + if (!m_rfeDevice) { + return -1; + } + + qDebug() << "LimeRFE::configure: " + << "attValue: " << (int) m_rfeBoardState.attValue + << "channelIDRX: " << (int) m_rfeBoardState.channelIDRX + << "channelIDTX: " << (int) m_rfeBoardState.channelIDTX + << "mode: " << (int) m_rfeBoardState.mode + << "notchOnOff: " << (int) m_rfeBoardState.notchOnOff + << "selPortRX: " << (int) m_rfeBoardState.selPortRX + << "selPortTX: " << (int) m_rfeBoardState.selPortTX + << "enableSWR: " << (int) m_rfeBoardState.enableSWR + << "sourceSWR: " << (int) m_rfeBoardState.sourceSWR; + + int rc = RFE_ConfigureState(m_rfeDevice, m_rfeBoardState); + + if (rc != 0) { + qInfo("LimeRFE::configure: %s", getError(rc).c_str()); + } else { + qDebug() << "LimeRFE::configure: done"; + } + + return rc; +} + +int LimeRFE::getState() +{ + if (!m_rfeDevice) { + return -1; + } + + int rc = RFE_GetState(m_rfeDevice, &m_rfeBoardState); + + qDebug() << "LimeRFE::getState: " + << "attValue: " << (int) m_rfeBoardState.attValue + << "channelIDRX: " << (int) m_rfeBoardState.channelIDRX + << "channelIDTX: " << (int) m_rfeBoardState.channelIDTX + << "mode: " << (int) m_rfeBoardState.mode + << "notchOnOff: " << (int) m_rfeBoardState.notchOnOff + << "selPortRX: " << (int) m_rfeBoardState.selPortRX + << "selPortTX: " << (int) m_rfeBoardState.selPortTX + << "enableSWR: " << (int) m_rfeBoardState.enableSWR + << "sourceSWR: " << (int) m_rfeBoardState.sourceSWR; + + if (rc != 0) { + qInfo("LimeRFE::getState: %s", getError(rc).c_str()); + } + + if (m_rfeBoardState.mode == RFE_MODE_RX) + { + m_rxOn = true; + m_txOn = false; + } + else if (m_rfeBoardState.mode == RFE_MODE_TX) + { + m_rxOn = false; + m_txOn = true; + } + else if (m_rfeBoardState.mode == RFE_MODE_NONE) + { + m_rxOn = false; + m_txOn = false; + } + else if (m_rfeBoardState.mode == RFE_MODE_TXRX) + { + m_rxOn = true; + m_txOn = true; + } + + return rc; +} + +std::string LimeRFE::getError(int errorCode) +{ + std::map::const_iterator it = m_errorCodesMap.find(errorCode); + + if (it == m_errorCodesMap.end()) { + return "Unknown error"; + } else { + return it->second; + } +} + +int LimeRFE::setRx(bool rxOn) +{ + if (!m_rfeDevice) { + return -1; + } + + int mode = RFE_MODE_NONE; + + if (rxOn) + { + if (m_txOn) { + mode = RFE_MODE_TXRX; + } else { + mode = RFE_MODE_RX; + } + } + else + { + if (m_txOn) { + mode = RFE_MODE_TX; + } + } + + qDebug("LimeRFE::setRx: switch %s mode: %d", rxOn ? "on" : "off", mode); + int rc = RFE_Mode(m_rfeDevice, mode); + + if (rc == 0) { + m_rxOn = rxOn; + } else { + qInfo("LimeRFE::setRx: %s", getError(rc).c_str()); + } + + return rc; +} + +int LimeRFE::setTx(bool txOn) +{ + if (!m_rfeDevice) { + return -1; + } + + int mode = RFE_MODE_NONE; + + if (txOn) + { + if (m_rxOn) { + mode = RFE_MODE_TXRX; + } else { + mode = RFE_MODE_TX; + } + } + else + { + if (m_rxOn) { + mode = RFE_MODE_RX; + } + } + + qDebug("LimeRFE::setTx: switch %s mode: %d", txOn ? "on" : "off", mode); + int rc = RFE_Mode(m_rfeDevice, mode); + + if (rc == 0) { + m_txOn = txOn; + } else { + qInfo("LimeRFE::setTx: %s", getError(rc).c_str()); + } + + return rc; +} + +bool LimeRFE::turnDevice(int deviceSetIndex, bool on) +{ + qDebug("LimeRFE::turnDevice %d: %s", deviceSetIndex, on ? "on" : "off"); + SWGSDRangel::SWGDeviceState response; + SWGSDRangel::SWGErrorResponse error; + int httpCode; + + if (on) { + httpCode = m_webAPIAdapterInterface->devicesetDeviceRunPost(deviceSetIndex, response, error); + } else { + httpCode = m_webAPIAdapterInterface->devicesetDeviceRunDelete(deviceSetIndex, response, error); + } + + if (httpCode/100 == 2) + { + qDebug("LimeRFE::turnDevice: %s success", on ? "on" : "off"); + return true; + } + else + { + qWarning("LimeRFE::turnDevice: error: %s", qPrintable(*error.getMessage())); + return false; + } +} + +int LimeRFE::getFwdPower(int& powerDB) +{ + if (!m_rfeDevice) { + return -1; + } + + int power; + int rc = RFE_ReadADC(m_rfeDevice, RFE_ADC1, &power); + + if (rc == 0) { + powerDB = power; + } + + return rc; +} + +int LimeRFE::getRefPower(int& powerDB) +{ + if (!m_rfeDevice) { + return -1; + } + + int power; + int rc = RFE_ReadADC(m_rfeDevice, RFE_ADC2, &power); + + if (rc == 0) { + powerDB = power; + } + + return rc; +} + +void LimeRFE::settingsToState(const LimeRFESettings& settings) +{ + if (settings.m_rxChannels == LimeRFESettings::ChannelGroups::ChannelsCellular) + { + if (settings.m_rxCellularChannel == LimeRFESettings::CellularChannel::CellularBand1) + { + m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND01; + m_rfeBoardState.mode = RFE_MODE_TXRX; + } + else if (settings.m_rxCellularChannel == LimeRFESettings::CellularChannel::CellularBand2) + { + m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND02; + m_rfeBoardState.mode = RFE_MODE_TXRX; + } + else if (settings.m_rxCellularChannel == LimeRFESettings::CellularChannel::CellularBand3) + { + m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND03; + m_rfeBoardState.mode = RFE_MODE_TXRX; + } + else if (settings.m_rxCellularChannel == LimeRFESettings::CellularChannel::CellularBand38) + { + m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND38; + } + else if (settings.m_rxCellularChannel == LimeRFESettings::CellularChannel::CellularBand7) + { + m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND07; + m_rfeBoardState.mode = RFE_MODE_TXRX; + } + + m_rfeBoardState.selPortRX = RFE_PORT_1; + m_rfeBoardState.selPortTX = RFE_PORT_1; + m_rfeBoardState.channelIDTX = m_rfeBoardState.channelIDRX; + } + else + { + if (settings.m_rxChannels == LimeRFESettings::ChannelGroups::ChannelsWideband) + { + if (settings.m_rxWidebandChannel == LimeRFESettings::WidebandChannel::WidebandLow) { + m_rfeBoardState.channelIDRX = RFE_CID_WB_1000; + } else if (settings.m_rxWidebandChannel == LimeRFESettings::WidebandChannel::WidebandHigh) { + m_rfeBoardState.channelIDRX = RFE_CID_WB_4000; + } + } + else if (settings.m_rxChannels == LimeRFESettings::ChannelGroups::ChannelsHAM) + { + if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_30M) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_0030; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_50_70MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_0070; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_144_146MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_0145; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_220_225MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_0220; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_430_440MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_0435; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_902_928MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_0920; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_1240_1325MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_1280; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_2300_2450MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_2400; + } else if (settings.m_rxHAMChannel == LimeRFESettings::HAMChannel::HAM_3300_3500MHz) { + m_rfeBoardState.channelIDRX = RFE_CID_HAM_3500; + } + } + + if (settings.m_rxPort == LimeRFESettings::RxPort::RxPortJ3) { + m_rfeBoardState.selPortRX = RFE_PORT_1; + } else if (settings.m_rxPort == LimeRFESettings::RxPort::RxPortJ5) { + m_rfeBoardState.selPortRX = RFE_PORT_3; + } + + if (settings.m_txRxDriven) + { + m_rfeBoardState.channelIDTX = m_rfeBoardState.channelIDRX; + } + else + { + if (settings.m_txChannels == LimeRFESettings::ChannelGroups::ChannelsWideband) + { + if (settings.m_txWidebandChannel == LimeRFESettings::WidebandChannel::WidebandLow) { + m_rfeBoardState.channelIDTX = RFE_CID_WB_1000; + } else if (settings.m_txWidebandChannel == LimeRFESettings::WidebandChannel::WidebandHigh) { + m_rfeBoardState.channelIDTX = RFE_CID_WB_4000; + } + } + else if (settings.m_txChannels == LimeRFESettings::ChannelGroups::ChannelsHAM) + { + if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_30M) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_0030; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_50_70MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_0070; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_144_146MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_0145; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_220_225MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_0220; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_430_440MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_0435; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_902_928MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_0920; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_1240_1325MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_1280; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_2300_2450MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_2400; + } else if (settings.m_txHAMChannel == LimeRFESettings::HAMChannel::HAM_3300_3500MHz) { + m_rfeBoardState.channelIDTX = RFE_CID_HAM_3500; + } + } + } + + if (settings.m_txPort == LimeRFESettings::TxPort::TxPortJ3) { + m_rfeBoardState.selPortTX = RFE_PORT_1; + } else if (settings.m_txPort == LimeRFESettings::TxPort::TxPortJ4) { + m_rfeBoardState.selPortTX = RFE_PORT_2; + } else if (settings.m_txPort == LimeRFESettings::TxPort::TxPortJ5) { + m_rfeBoardState.selPortTX = RFE_PORT_3; + } + } + + m_rfeBoardState.attValue = settings.m_attenuationFactor > 7 ? 7 : settings.m_attenuationFactor; + m_rfeBoardState.notchOnOff = settings.m_amfmNotch; + m_rfeBoardState.enableSWR = settings.m_swrEnable ? RFE_SWR_ENABLE : RFE_SWR_DISABLE; + + if (settings.m_swrSource == LimeRFESettings::SWRSource::SWRExternal) { + m_rfeBoardState.sourceSWR = RFE_SWR_SRC_EXT; + } else if (settings.m_swrSource == LimeRFESettings::SWRSource::SWRCellular) { + m_rfeBoardState.sourceSWR = RFE_SWR_SRC_CELL; + } +} + +void LimeRFE::stateToSettings(LimeRFESettings& settings) +{ + if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND01) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_rxCellularChannel = LimeRFESettings::CellularChannel::CellularBand1; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND02) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_rxCellularChannel = LimeRFESettings::CellularChannel::CellularBand2; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND03) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_rxCellularChannel = LimeRFESettings::CellularChannel::CellularBand3; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND07) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_rxCellularChannel = LimeRFESettings::CellularChannel::CellularBand7; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND38) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_rxCellularChannel = LimeRFESettings::CellularChannel::CellularBand38; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_WB_1000) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsWideband; + settings.m_rxWidebandChannel = LimeRFESettings::WidebandChannel::WidebandLow; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_WB_4000) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsWideband; + settings.m_rxWidebandChannel = LimeRFESettings::WidebandChannel::WidebandHigh; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0030) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_30M; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0070) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_50_70MHz; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0145) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_144_146MHz; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0220) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_220_225MHz; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0435) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_430_440MHz; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0920) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_902_928MHz; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_1280) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_1240_1325MHz; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_2400) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_2300_2450MHz; + } + else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_3500) + { + settings.m_rxChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_rxHAMChannel = LimeRFESettings::HAMChannel::HAM_3300_3500MHz; + } + + if (m_rfeBoardState.selPortRX == RFE_PORT_1) { + settings.m_rxPort = LimeRFESettings::RxPort::RxPortJ3; + } else if (m_rfeBoardState.selPortRX == RFE_PORT_3) { + settings.m_rxPort = LimeRFESettings::RxPort::RxPortJ5; + } + + if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND01) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_txCellularChannel = LimeRFESettings::CellularChannel::CellularBand1; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND02) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_txCellularChannel = LimeRFESettings::CellularChannel::CellularBand2; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND03) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_txCellularChannel = LimeRFESettings::CellularChannel::CellularBand3; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND07) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_txCellularChannel = LimeRFESettings::CellularChannel::CellularBand7; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND38) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsCellular; + settings.m_txCellularChannel = LimeRFESettings::CellularChannel::CellularBand38; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_WB_1000) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsWideband; + settings.m_txWidebandChannel = LimeRFESettings::WidebandChannel::WidebandLow; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_WB_4000) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsWideband; + settings.m_txWidebandChannel = LimeRFESettings::WidebandChannel::WidebandHigh; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0030) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_30M; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0070) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_50_70MHz; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0145) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_144_146MHz; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0220) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_220_225MHz; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0435) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_430_440MHz; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0920) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_902_928MHz; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_1280) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_1240_1325MHz; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_2400) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_2300_2450MHz; + } + else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_3500) + { + settings.m_txChannels = LimeRFESettings::ChannelGroups::ChannelsHAM; + settings.m_txHAMChannel = LimeRFESettings::HAMChannel::HAM_3300_3500MHz; + } + + if (m_rfeBoardState.selPortTX == RFE_PORT_1) { + settings.m_txPort = LimeRFESettings::TxPort::TxPortJ3; + } else if (m_rfeBoardState.selPortTX == RFE_PORT_2) { + settings.m_txPort = LimeRFESettings::TxPort::TxPortJ4; + } else if (m_rfeBoardState.selPortTX == RFE_PORT_3) { + settings.m_txPort = LimeRFESettings::TxPort::TxPortJ5; + } + + settings.m_attenuationFactor = m_rfeBoardState.attValue; + settings.m_amfmNotch = m_rfeBoardState.notchOnOff == RFE_NOTCH_ON; + settings.m_swrEnable = m_rfeBoardState.enableSWR == RFE_SWR_ENABLE; + settings.m_swrSource = m_rfeBoardState.sourceSWR == RFE_SWR_SRC_CELL ? + LimeRFESettings::SWRSource::SWRCellular : + LimeRFESettings::SWRSource::SWRExternal; +} + +void LimeRFE::networkManagerFinished(QNetworkReply *reply) +{ + QNetworkReply::NetworkError replyError = reply->error(); + + if (replyError) + { + qWarning() << "LimeRFE::networkManagerFinished:" + << " error(" << (int) replyError + << "): " << replyError + << ": " << reply->errorString(); + } + else + { + QString answer = reply->readAll(); + answer.chop(1); // remove last \n + qDebug("LimeRFE::networkManagerFinished: reply:\n%s", answer.toStdString().c_str()); + } + + reply->deleteLater(); +} + +int LimeRFE::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setLimeRfeSettings(new SWGSDRangel::SWGLimeRFESettings()); + response.getLimeRfeSettings()->init(); + webapiFormatFeatureSettings(response, m_settings); + return 200; +} + +int LimeRFE::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + LimeRFESettings settings = m_settings; + webapiUpdateFeatureSettings(settings, featureSettingsKeys, response); + + MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(settings, force); + m_inputMessageQueue.push(msg); + + qDebug("LimeRFE::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue); + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureLimeRFE *msgToGUI = MsgConfigureLimeRFE::create(settings, true); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatFeatureSettings(response, settings); + + return 200; +} + +int LimeRFE::webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage) +{ + response.setLimeRfeReport(new SWGSDRangel::SWGLimeRFEReport()); + response.getLimeRfeReport()->init(); + return webapiFormatFeatureReport(response, errorMessage); +} + +int LimeRFE::webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage) +{ + SWGSDRangel::SWGLimeRFEActions *swgLimeRFEActions = query.getLimeRfeActions(); + + if (swgLimeRFEActions) + { + bool unknownAction = true; + int channel = -1; + int deviceSetIndex = -1; + + if (featureActionsKeys.contains("selectChannel")) + { + channel = swgLimeRFEActions->getSelectChannel(); + unknownAction = false; + } + + if (featureActionsKeys.contains("deviceSetIndex")) + { + deviceSetIndex = swgLimeRFEActions->getDeviceSetIndex(); + unknownAction = false; + } + + if (featureActionsKeys.contains("openCloseDevice") && (swgLimeRFEActions->getOpenCloseDevice() != 0)) + { + int rc = openDevice(m_settings.m_devicePath.toStdString()); + unknownAction = false; + + if (rc != 0) + { + errorMessage = QString("Open %1: %2").arg(m_settings.m_devicePath).arg(getError(rc).c_str()); + return 500; + } + } + + if (featureActionsKeys.contains("getState") && (swgLimeRFEActions->getGetState() != 0)) + { + int rc = getState(); + unknownAction = false; + + if (rc != 0) + { + errorMessage = QString("Get state %1: %2").arg(m_settings.m_devicePath).arg(getError(rc).c_str()); + return 500; + } + } + + if (featureActionsKeys.contains("fromToSettings") && (swgLimeRFEActions->getFromToSettings() != 0)) + { + settingsToState(m_settings); + unknownAction = false; + } + + if ((channel >= 0) && featureActionsKeys.contains("switchChannel")) + { + if (channel == 0) + { + bool on = swgLimeRFEActions->getSwitchChannel() != 0; + int rc = setRx(on); + + if (rc != 0) + { + errorMessage = QString("Set Rx %1 %2: %3").arg(m_settings.m_devicePath).arg(on).arg(getError(rc).c_str()); + return 500; + } + + if (getMessageQueueToGUI()) + { + MsgReportSetRx *msg = MsgReportSetRx::create(on); + getMessageQueueToGUI()->push(msg); + } + } + else + { + bool on = swgLimeRFEActions->getSwitchChannel() != 0; + int rc = setTx(on); + + if (rc != 0) + { + errorMessage = QString("Set Tx %1 %2: %3").arg(m_settings.m_devicePath).arg(on).arg(getError(rc).c_str()); + return 500; + } + + if (getMessageQueueToGUI()) + { + MsgReportSetTx *msg = MsgReportSetTx::create(on); + getMessageQueueToGUI()->push(msg); + } + } + + if (deviceSetIndex >= 0) { + turnDevice(deviceSetIndex, swgLimeRFEActions->getSwitchChannel() != 0); + } + + unknownAction = false; + } + + if (featureActionsKeys.contains("fromToSettings") && (swgLimeRFEActions->getFromToSettings() == 0)) + { + stateToSettings(m_settings); + unknownAction = false; + + if (getMessageQueueToGUI()) + { + MsgConfigureLimeRFE *msg = MsgConfigureLimeRFE::create(m_settings, false); + getMessageQueueToGUI()->push(msg); + } + } + + if (featureActionsKeys.contains("openCloseDevice") && (swgLimeRFEActions->getOpenCloseDevice() == 0)) + { + closeDevice(); + unknownAction = false; + } + + if (unknownAction) + { + errorMessage = "Unknown action"; + return 400; + } + else + { + return 202; + } + } + else + { + errorMessage = "Missing SimplePTTActions in query"; + return 400; + } +} + +void LimeRFE::webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const LimeRFESettings& settings) +{ + if (response.getLimeRfeSettings()->getTitle()) { + *response.getLimeRfeSettings()->getTitle() = settings.m_title; + } else { + response.getLimeRfeSettings()->setTitle(new QString(settings.m_title)); + } + + response.getLimeRfeSettings()->setRgbColor(settings.m_rgbColor); + response.getLimeRfeSettings()->setDevicePath(new QString(settings.m_devicePath)); + response.getLimeRfeSettings()->setRxChannels((int) settings.m_rxChannels); + response.getLimeRfeSettings()->setRxWidebandChannel((int) settings.m_rxWidebandChannel); + response.getLimeRfeSettings()->setRxHamChannel((int) settings.m_rxHAMChannel); + response.getLimeRfeSettings()->setRxCellularChannel((int) settings.m_rxCellularChannel); + response.getLimeRfeSettings()->setRxPort((int) settings.m_rxPort); + response.getLimeRfeSettings()->setAmfmNotch(settings.m_amfmNotch ? 1 : 0); + response.getLimeRfeSettings()->setAttenuationFactor(settings.m_attenuationFactor); + response.getLimeRfeSettings()->setTxChannels((int) settings.m_txChannels); + response.getLimeRfeSettings()->setTxWidebandChannel((int) settings.m_txWidebandChannel); + response.getLimeRfeSettings()->setTxHamChannel((int) settings.m_txHAMChannel); + response.getLimeRfeSettings()->setTxCellularChannel((int) settings.m_txCellularChannel); + response.getLimeRfeSettings()->setTxPort((int) settings.m_txPort); + response.getLimeRfeSettings()->setSwrEnable(settings.m_swrEnable ? 1 : 0); + response.getLimeRfeSettings()->setSwrSource((int) settings.m_swrSource); + response.getLimeRfeSettings()->setTxRxDriven(settings.m_txRxDriven ? 1 : 0); + + response.getLimeRfeSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); + + if (response.getLimeRfeSettings()->getReverseApiAddress()) { + *response.getLimeRfeSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress; + } else { + response.getLimeRfeSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress)); + } + + response.getLimeRfeSettings()->setReverseApiPort(settings.m_reverseAPIPort); + response.getLimeRfeSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex); + response.getLimeRfeSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex); + + if (settings.m_rollupState) + { + if (response.getLimeRfeSettings()->getRollupState()) + { + settings.m_rollupState->formatTo(response.getLimeRfeSettings()->getRollupState()); + } + else + { + SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState(); + settings.m_rollupState->formatTo(swgRollupState); + response.getLimeRfeSettings()->setRollupState(swgRollupState); + } + } +} + +void LimeRFE::webapiUpdateFeatureSettings( + LimeRFESettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response) +{ + if (featureSettingsKeys.contains("title")) { + settings.m_title = *response.getLimeRfeSettings()->getTitle(); + } + if (featureSettingsKeys.contains("rgbColor")) { + settings.m_rgbColor = response.getLimeRfeSettings()->getRgbColor(); + } + if (featureSettingsKeys.contains("devicePath")) { + settings.m_devicePath = *response.getLimeRfeSettings()->getDevicePath(); + } + if (featureSettingsKeys.contains("rxChannels")) { + settings.m_rxChannels = (LimeRFESettings::ChannelGroups) response.getLimeRfeSettings()->getRxChannels(); + } + if (featureSettingsKeys.contains("rxWidebandChannel")) { + settings.m_rxWidebandChannel = (LimeRFESettings::WidebandChannel) response.getLimeRfeSettings()->getRxWidebandChannel(); + } + if (featureSettingsKeys.contains("rxHAMChannel")) { + settings.m_rxHAMChannel = (LimeRFESettings::HAMChannel) response.getLimeRfeSettings()->getRxHamChannel(); + } + if (featureSettingsKeys.contains("rxCellularChannel")) { + settings.m_rxCellularChannel = (LimeRFESettings::CellularChannel) response.getLimeRfeSettings()->getRxCellularChannel(); + } + if (featureSettingsKeys.contains("rxPort")) { + settings.m_rxPort = (LimeRFESettings::RxPort) response.getLimeRfeSettings()->getRxPort(); + } + if (featureSettingsKeys.contains("amfmNotch")) { + settings.m_amfmNotch = response.getLimeRfeSettings()->getAmfmNotch() != 0; + } + if (featureSettingsKeys.contains("attenuationFactor")) { + settings.m_attenuationFactor = response.getLimeRfeSettings()->getAttenuationFactor(); + } + if (featureSettingsKeys.contains("txChannels")) { + settings.m_txChannels = (LimeRFESettings::ChannelGroups) response.getLimeRfeSettings()->getTxChannels(); + } + if (featureSettingsKeys.contains("txWidebandChannel")) { + settings.m_txWidebandChannel = (LimeRFESettings::WidebandChannel) response.getLimeRfeSettings()->getTxWidebandChannel(); + } + if (featureSettingsKeys.contains("txHAMChannel")) { + settings.m_txHAMChannel = (LimeRFESettings::HAMChannel) response.getLimeRfeSettings()->getTxHamChannel(); + } + if (featureSettingsKeys.contains("txCellularChannel")) { + settings.m_txCellularChannel = (LimeRFESettings::CellularChannel) response.getLimeRfeSettings()->getTxCellularChannel(); + } + if (featureSettingsKeys.contains("txPort")) { + settings.m_txPort = (LimeRFESettings::TxPort) response.getLimeRfeSettings()->getTxPort(); + } + if (featureSettingsKeys.contains("swrEnable")) { + settings.m_swrEnable = response.getLimeRfeSettings()->getSwrEnable() != 0; + } + if (featureSettingsKeys.contains("swrSource")) { + settings.m_swrSource = (LimeRFESettings::SWRSource) response.getLimeRfeSettings()->getSwrSource(); + } + if (featureSettingsKeys.contains("txRxDriven")) { + settings.m_txRxDriven = response.getLimeRfeSettings()->getTxRxDriven() != 0; + } + if (featureSettingsKeys.contains("useReverseAPI")) { + settings.m_useReverseAPI = response.getLimeRfeSettings()->getUseReverseApi() != 0; + } + if (featureSettingsKeys.contains("reverseAPIAddress")) { + settings.m_reverseAPIAddress = *response.getLimeRfeSettings()->getReverseApiAddress(); + } + if (featureSettingsKeys.contains("reverseAPIPort")) { + settings.m_reverseAPIPort = response.getLimeRfeSettings()->getReverseApiPort(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureSetIndex")) { + settings.m_reverseAPIFeatureSetIndex = response.getLimeRfeSettings()->getReverseApiFeatureSetIndex(); + } + if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) { + settings.m_reverseAPIFeatureIndex = response.getLimeRfeSettings()->getReverseApiFeatureIndex(); + } + if (settings.m_rollupState && featureSettingsKeys.contains("rollupState")) { + settings.m_rollupState->updateFrom(featureSettingsKeys, response.getLimeRfeSettings()->getRollupState()); + } +} + +int LimeRFE::webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response, QString& errorMessage) +{ + response.getLimeRfeReport()->setRxOn(m_rxOn ? 1 : 0); + response.getLimeRfeReport()->setTxOn(m_txOn ? 1 : 0); + + int fwdPower; + int rc = getFwdPower(fwdPower); + + if (rc != 0) + { + errorMessage = QString("Error getting forward power from LimeRFE device %1: %2") + .arg(m_settings.m_devicePath).arg(getError(rc).c_str()); + return 500; + } + + int refPower; + rc = getRefPower(refPower); + + if (rc != 0) + { + errorMessage = QString("Error getting reflected power from LimeRFE device %1: %2") + .arg(m_settings.m_devicePath).arg(getError(rc).c_str()); + return 500; + } + + response.getLimeRfeReport()->setForwardPower(fwdPower); + response.getLimeRfeReport()->setReflectedPower(refPower); + return 200; +} diff --git a/plugins/feature/limerfe/limerfe.h b/plugins/feature/limerfe/limerfe.h new file mode 100644 index 000000000..4f8e168e6 --- /dev/null +++ b/plugins/feature/limerfe/limerfe.h @@ -0,0 +1,185 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_LIMERFE_H_ +#define INCLUDE_FEATURE_LIMERFE_H_ + +#include + +#include +#include +#include "lime/limeRFE.h" + +#include "feature/feature.h" +#include "util/message.h" + +#include "limerfesettings.h" + +class QNetworkReply; +class QNetworkAccessManager; + +class LimeRFE : public Feature +{ + Q_OBJECT +public: + class MsgConfigureLimeRFE : public Message { + MESSAGE_CLASS_DECLARATION + + public: + const LimeRFESettings& getSettings() const { return m_settings; } + bool getForce() const { return m_force; } + + static MsgConfigureLimeRFE* create(const LimeRFESettings& settings, bool force) { + return new MsgConfigureLimeRFE(settings, force); + } + + private: + LimeRFESettings m_settings; + bool m_force; + + MsgConfigureLimeRFE(const LimeRFESettings& settings, bool force) : + Message(), + m_settings(settings), + m_force(force) + { } + }; + + class MsgReportSetRx : public Message { + MESSAGE_CLASS_DECLARATION + + public: + bool isOn() const { return m_on; } + + static MsgReportSetRx* create(bool on) { + return new MsgReportSetRx(on); + } + + private: + bool m_on; + + MsgReportSetRx(bool on) : + Message(), + m_on(on) + { } + }; + + class MsgReportSetTx : public Message { + MESSAGE_CLASS_DECLARATION + + public: + bool isOn() const { return m_on; } + + static MsgReportSetTx* create(bool on) { + return new MsgReportSetTx(on); + } + + private: + bool m_on; + + MsgReportSetTx(bool on) : + Message(), + m_on(on) + { } + }; + + LimeRFE(WebAPIAdapterInterface *webAPIAdapterInterface); + virtual ~LimeRFE(); + virtual void destroy() { delete this; } + virtual bool handleMessage(const Message& cmd); + + virtual void getIdentifier(QString& id) const { id = objectName(); } + virtual QString getIdentifier() const { return objectName(); } + virtual void getTitle(QString& title) const { title = m_settings.m_title; } + + virtual QByteArray serialize() const; + virtual bool deserialize(const QByteArray& data); + + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiReportGet( + SWGSDRangel::SWGFeatureReport& response, + QString& errorMessage); + + virtual int webapiActionsPost( + const QStringList& featureActionsKeys, + SWGSDRangel::SWGFeatureActions& query, + QString& errorMessage); + + static void webapiFormatFeatureSettings( + SWGSDRangel::SWGFeatureSettings& response, + const LimeRFESettings& settings); + + static void webapiUpdateFeatureSettings( + LimeRFESettings& settings, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response); + + int openDevice(const std::string& serialDeviceName); + void closeDevice(); + + const QStringList& getComPorts() { return m_comPorts; } + int configure(); + int getState(); + static std::string getError(int errorCode); + int setRx(bool rxOn); + int setTx(bool txOn); + bool getRx() const { return m_rxOn; }; + bool getTx() const { return m_txOn; }; + bool turnDevice(int deviceSetIndex, bool on); + int getFwdPower(int& powerDB); + int getRefPower(int& powerDB); + + void settingsToState(const LimeRFESettings& settings); + void stateToSettings(LimeRFESettings& settings); + + static const char* const m_featureIdURI; + static const char* const m_featureId; + +private: + LimeRFESettings m_settings; + bool m_rxOn; + bool m_txOn; + + QNetworkAccessManager *m_networkManager; + QNetworkRequest m_networkRequest; + WebAPIAdapterInterface *m_webAPIAdapterInterface; + + rfe_dev_t *m_rfeDevice; + rfe_boardState m_rfeBoardState; + static const std::map m_errorCodesMap; + QStringList m_comPorts; + + void start(); + void stop(); + void listComPorts(); + void applySettings(const LimeRFESettings& settings, bool force = false); + int webapiFormatFeatureReport(SWGSDRangel::SWGFeatureReport& response, QString& errorMessage); + +private slots: + void networkManagerFinished(QNetworkReply *reply); + +}; + +#endif diff --git a/plugins/feature/limerfe/limerfegui.cpp b/plugins/feature/limerfe/limerfegui.cpp new file mode 100644 index 000000000..ef3454a05 --- /dev/null +++ b/plugins/feature/limerfe/limerfegui.cpp @@ -0,0 +1,1055 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "feature/featureuiset.h" +#include "gui/basicfeaturesettingsdialog.h" +#include "gui/crightclickenabler.h" +#include "util/db.h" +#include "dsp/dspengine.h" +#include "dsp/dspdevicesourceengine.h" +#include "dsp/dspdevicesinkengine.h" +#include "device/deviceset.h" +#include "maincore.h" + +#include "limerfeusbcalib.h" +#include "ui_limerfegui.h" +#include "limerfe.h" +#include "limerfegui.h" + +LimeRFEGUI* LimeRFEGUI::create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature) +{ + LimeRFEGUI* gui = new LimeRFEGUI(pluginAPI, featureUISet, feature); + return gui; +} + +void LimeRFEGUI::destroy() +{ + delete this; +} + +void LimeRFEGUI::resetToDefaults() +{ + m_settings.resetToDefaults(); + displaySettings(); + applySettings(true); +} + +QByteArray LimeRFEGUI::serialize() const +{ + return m_settings.serialize(); +} + +bool LimeRFEGUI::deserialize(const QByteArray& data) +{ + if (m_settings.deserialize(data)) + { + m_feature->setWorkspaceIndex(m_settings.m_workspaceIndex); + displaySettings(); + return true; + } + else + { + resetToDefaults(); + return false; + } +} + +void LimeRFEGUI::setWorkspaceIndex(int index) +{ + m_settings.m_workspaceIndex = index; + m_feature->setWorkspaceIndex(index); +} + +void LimeRFEGUI::resizeEvent(QResizeEvent* size) +{ + int maxWidth = getRollupContents()->maximumWidth(); + int minHeight = getRollupContents()->minimumHeight() + getAdditionalHeight(); + resize(width() < maxWidth ? width() : maxWidth, minHeight); + size->accept(); +} + +void LimeRFEGUI::onWidgetRolled(QWidget* widget, bool rollDown) +{ + (void) widget; + (void) rollDown; + + getRollupContents()->saveState(m_rollupState); + applySettings(); +} + +void LimeRFEGUI::onMenuDialogCalled(const QPoint &p) +{ + if (m_contextMenuType == ContextMenuChannelSettings) + { + BasicFeatureSettingsDialog dialog(this); + dialog.setTitle(m_settings.m_title); + dialog.setUseReverseAPI(m_settings.m_useReverseAPI); + dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress); + dialog.setReverseAPIPort(m_settings.m_reverseAPIPort); + dialog.setReverseAPIFeatureSetIndex(m_settings.m_reverseAPIFeatureSetIndex); + dialog.setReverseAPIFeatureIndex(m_settings.m_reverseAPIFeatureIndex); + dialog.setDefaultTitle(m_displayedName); + + dialog.move(p); + dialog.exec(); + + m_settings.m_title = dialog.getTitle(); + m_settings.m_useReverseAPI = dialog.useReverseAPI(); + m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress(); + m_settings.m_reverseAPIPort = dialog.getReverseAPIPort(); + m_settings.m_reverseAPIFeatureSetIndex = dialog.getReverseAPIFeatureSetIndex(); + m_settings.m_reverseAPIFeatureIndex = dialog.getReverseAPIFeatureIndex(); + + setTitle(m_settings.m_title); + setTitleColor(m_settings.m_rgbColor); + + applySettings(); + } + + resetContextMenuType(); +} + +LimeRFEGUI::LimeRFEGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent) : + FeatureGUI(parent), + ui(new Ui::LimeRFEGUI), + m_pluginAPI(pluginAPI), + m_featureUISet(featureUISet), + m_rxOn(false), + m_txOn(false), + m_doApplySettings(true), + m_rxTxToggle(false), + m_currentPowerCorrection(0.0), + m_avgPower(false), + m_deviceSetSync(false) +{ + m_feature = feature; + setAttribute(Qt::WA_DeleteOnClose, true); + m_helpURL = "plugins/feature/limerfe/readme.md"; + RollupContents *rollupContents = getRollupContents(); + ui->setupUi(rollupContents); + setSizePolicy(rollupContents->sizePolicy()); + rollupContents->arrangeRollups(); + connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + + m_limeRFE = reinterpret_cast(feature); + m_limeRFE->setMessageQueueToGUI(&m_inputMessageQueue); + + for (const auto& comPortName : m_limeRFE->getComPorts()) { + ui->device->addItem(comPortName); + } + + m_settings.setRollupState(&m_rollupState); + + connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &))); + connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); + + updateDeviceSetList(); + displaySettings(); + highlightApplyButton(false); + m_timer.setInterval(500); + makeUIConnections(); +} + +LimeRFEGUI::~LimeRFEGUI() +{ + delete ui; +} + +void LimeRFEGUI::applySettings(bool force) +{ + if (m_doApplySettings) + { + LimeRFE::MsgConfigureLimeRFE* message = LimeRFE::MsgConfigureLimeRFE::create( m_settings, force); + m_limeRFE->getInputMessageQueue()->push(message); + } +} + +void LimeRFEGUI::displaySettings() +{ + setTitleColor(m_settings.m_rgbColor); + setWindowTitle(m_settings.m_title); + setTitle(m_settings.m_title); + blockApplySettings(true); + setRxChannels(); + ui->rxPort->setCurrentIndex(m_settings.m_rxPort); + ui->attenuation->setCurrentIndex(m_settings.m_attenuationFactor); + ui->amFmNotchFilter->setChecked(m_settings.m_amfmNotch); + setTxChannels(); + ui->txPort->setCurrentIndex(m_settings.m_txPort); + ui->txFollowsRx->setChecked(m_settings.m_txRxDriven); + ui->rxTxToggle->setChecked(m_rxTxToggle); + displayMode(); + displayPower(); + blockApplySettings(false); +} + +void LimeRFEGUI::displayMode() +{ + QString s; + + if (m_rxOn) + { + if (m_txOn) { + s = "Rx/Tx"; + } else { + s = "Rx"; + } + } + else + { + if (m_txOn) { + s = "Tx"; + } else { + s = "None"; + } + } + + ui->modeText->setText(s); + + ui->modeRx->blockSignals(true); + ui->modeTx->blockSignals(true); + + if (m_rxOn) { + ui->modeRx->setStyleSheet("QToolButton { background-color : green; }"); + } else { + ui->modeRx->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); + } + + if (m_txOn) { + ui->modeTx->setStyleSheet("QToolButton { background-color : red; }"); + } else { + ui->modeTx->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); + } + + ui->modeRx->setChecked(m_rxOn); + ui->modeTx->setChecked(m_txOn); + + ui->modeRx->blockSignals(false); + ui->modeTx->blockSignals(false); +} + +void LimeRFEGUI::displayPower() +{ + ui->powerEnable->blockSignals(true); + ui->powerSource->blockSignals(true); + + ui->powerEnable->setChecked(m_settings.m_swrEnable); + ui->powerSource->setCurrentIndex((int) m_settings.m_swrSource); + + ui->powerEnable->blockSignals(false); + ui->powerSource->blockSignals(false); +} + +void LimeRFEGUI::refreshPower() +{ + int fwdPower, refPower; + int rc = m_limeRFE->getFwdPower(fwdPower); + + if (rc != 0) + { + ui->statusText->setText(m_limeRFE->getError(rc).c_str()); + return; + } + + rc = m_limeRFE->getRefPower(refPower); + + if (rc != 0) + { + ui->statusText->setText(m_limeRFE->getError(rc).c_str()); + return; + } + + double fwdPowerDB = fwdPower / 10.0; + double refPowerDB = refPower / 10.0; + double retLossDB = fwdPowerDB - refPowerDB; + + ui->powerFwdText->setText(QString::number(fwdPowerDB, 'f', 1)); + ui->powerRefText->setText(QString::number(refPowerDB, 'f', 1)); + ui->returnLossText->setText(QString::number(retLossDB, 'f', 1)); + + double denom = CalcDb::powerFromdB(retLossDB/2.0) - 1.0; + + if (denom == 0.0) + { + ui->swrText->setText("---"); + } + else + { + double vswr = (CalcDb::powerFromdB(retLossDB/2.0) + 1.0) / denom; + vswr = vswr < 0.0 ? 0.0 : vswr > 99.999 ? 99.999 : vswr; + ui->swrText->setText(QString::number(vswr, 'f', 3)); + } + + updateAbsPower(m_currentPowerCorrection); +} + +void LimeRFEGUI::setRxChannels() +{ + ui->rxChannel->blockSignals(true); + ui->rxPort->blockSignals(true); + ui->rxChannel->clear(); + ui->rxPort->clear(); + + if (m_settings.m_rxChannels == LimeRFESettings::ChannelsWideband) + { + ui->rxChannel->addItem("1-1000MHz"); + ui->rxChannel->addItem("1-4GHz"); + ui->rxChannel->setCurrentIndex((int) m_settings.m_rxWidebandChannel); + ui->rxPort->addItem("TX/RX (J3)"); + ui->rxPort->addItem("TX/RX 30M (J5)"); + ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); + ui->txFollowsRx->setEnabled(true); + ui->rxPort->setEnabled(true); + } + else if (m_settings.m_rxChannels == LimeRFESettings::ChannelsHAM) + { + ui->rxChannel->addItem("<30MHz"); + ui->rxChannel->addItem("50-70MHz"); + ui->rxChannel->addItem("144-146MHz"); + ui->rxChannel->addItem("220-225MHz"); + ui->rxChannel->addItem("430-440MHz"); + ui->rxChannel->addItem("902-928MHz"); + ui->rxChannel->addItem("1240-1325MHz"); + ui->rxChannel->addItem("2300-2450MHz"); + ui->rxChannel->addItem("3300-3500MHz"); + ui->rxChannel->setCurrentIndex((int) m_settings.m_rxHAMChannel); + ui->txFollowsRx->setEnabled(true); + + switch(m_settings.m_rxHAMChannel) + { + case LimeRFESettings::HAM_30M: + case LimeRFESettings::HAM_50_70MHz: + case LimeRFESettings::HAM_144_146MHz: + case LimeRFESettings::HAM_220_225MHz: + case LimeRFESettings::HAM_430_440MHz: + ui->rxPort->addItem("TX/RX (J3)"); + ui->rxPort->addItem("TX/RX 30M (J5)"); + ui->rxPort->setEnabled(true); + ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); + break; + case LimeRFESettings::HAM_902_928MHz: + case LimeRFESettings::HAM_1240_1325MHz: + case LimeRFESettings::HAM_2300_2450MHz: + case LimeRFESettings::HAM_3300_3500MHz: + ui->rxPort->addItem("TX/RX (J3)"); + ui->rxPort->setEnabled(false); + m_settings.m_rxPort = LimeRFESettings::RxPortJ3; + ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); + break; + default: + break; + } + } + else if (m_settings.m_rxChannels == LimeRFESettings::ChannelsCellular) + { + ui->rxChannel->addItem("Band1"); + ui->rxChannel->addItem("Band2"); + ui->rxChannel->addItem("Band3"); + ui->rxChannel->addItem("Band7"); + ui->rxChannel->addItem("Band38"); + ui->rxChannel->setCurrentIndex((int) m_settings.m_rxCellularChannel); + ui->rxPort->addItem("TX/RX (J3)"); + ui->rxPort->setEnabled(false); + m_settings.m_rxPort = LimeRFESettings::RxPortJ3; + ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); + m_settings.m_txRxDriven = true; + ui->txFollowsRx->setEnabled(false); + ui->txFollowsRx->setChecked(m_settings.m_txRxDriven); + } + + ui->rxChannelGroup->setCurrentIndex((int) m_settings.m_rxChannels); + ui->rxPort->blockSignals(false); + ui->rxChannel->blockSignals(false); +} + +void LimeRFEGUI::setTxChannels() +{ + ui->txChannel->blockSignals(true); + ui->txPort->blockSignals(true); + ui->powerCorrValue->blockSignals(true); + + ui->txChannel->clear(); + ui->txPort->clear(); + + if (m_settings.m_txChannels == LimeRFESettings::ChannelsWideband) + { + ui->txChannel->addItem("1-1000MHz"); + ui->txChannel->addItem("1-4GHz"); + ui->txChannel->setCurrentIndex((int) m_settings.m_txWidebandChannel); + ui->txPort->addItem("TX/RX (J3)"); + ui->txPort->addItem("TX (J4)"); + ui->txPort->setCurrentIndex((int) m_settings.m_txPort); + ui->txPort->setEnabled(true); + } + else if (m_settings.m_txChannels == LimeRFESettings::ChannelsHAM) + { + ui->txChannel->addItem("<30MHz"); + ui->txChannel->addItem("50-70MHz"); + ui->txChannel->addItem("144-146MHz"); + ui->txChannel->addItem("220-225MHz"); + ui->txChannel->addItem("430-440MHz"); + ui->txChannel->addItem("902-928MHz"); + ui->txChannel->addItem("1240-1325MHz"); + ui->txChannel->addItem("2300-2450MHz"); + ui->txChannel->addItem("3300-3500MHz"); + ui->txChannel->setCurrentIndex((int) m_settings.m_txHAMChannel); + + switch(m_settings.m_txHAMChannel) + { + case LimeRFESettings::HAM_30M: + case LimeRFESettings::HAM_50_70MHz: + ui->txPort->addItem("TX/RX (J3)"); + ui->txPort->addItem("TX (J4)"); + ui->txPort->addItem("TX/RX 30M (J5)"); + ui->txPort->setEnabled(false); + m_settings.m_txPort = LimeRFESettings::TxPortJ5; + ui->txPort->setCurrentIndex((int) m_settings.m_txPort); + break; + case LimeRFESettings::HAM_144_146MHz: + case LimeRFESettings::HAM_220_225MHz: + case LimeRFESettings::HAM_430_440MHz: + case LimeRFESettings::HAM_902_928MHz: + case LimeRFESettings::HAM_1240_1325MHz: + case LimeRFESettings::HAM_2300_2450MHz: + case LimeRFESettings::HAM_3300_3500MHz: + ui->txPort->addItem("TX/RX (J3)"); + ui->txPort->addItem("TX (J4)"); + ui->txPort->setCurrentIndex(m_settings.m_txPort < 2 ? m_settings.m_txPort : 1); + ui->txPort->setEnabled(true); + break; + default: + break; + } + } + else if (m_settings.m_txChannels == LimeRFESettings::ChannelsCellular) + { + ui->txChannel->addItem("Band1"); + ui->txChannel->addItem("Band2"); + ui->txChannel->addItem("Band3"); + ui->txChannel->addItem("Band7"); + ui->txChannel->addItem("Band38"); + ui->txChannel->setCurrentIndex((int) m_settings.m_txCellularChannel); + ui->txPort->addItem("TX/RX (J3)"); + m_settings.m_txPort = LimeRFESettings::TxPortJ3; + ui->txPort->setEnabled(false); + ui->txPort->setCurrentIndex((int) m_settings.m_txPort); + } + + ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels); + m_currentPowerCorrection = getPowerCorrection(); + ui->powerCorrValue->setText(QString::number(m_currentPowerCorrection, 'f', 1)); + updateAbsPower(m_currentPowerCorrection); + + ui->powerCorrValue->blockSignals(false); + ui->txPort->blockSignals(false); + ui->txChannel->blockSignals(false); +} + +int LimeRFEGUI::getPowerCorectionIndex() +{ + LimeRFEUSBCalib::ChannelRange range; + + switch (m_settings.m_txChannels) + { + case LimeRFESettings::ChannelsWideband: + { + switch (m_settings.m_txWidebandChannel) + { + case LimeRFESettings::WidebandLow: + range = LimeRFEUSBCalib::WidebandLow; + break; + case LimeRFESettings::WidebandHigh: + range = LimeRFEUSBCalib::WidebandHigh; + break; + default: + return -1; + break; + } + break; + } + case LimeRFESettings::ChannelsHAM: + { + switch (m_settings.m_txHAMChannel) + { + case LimeRFESettings::HAM_30M: + range = LimeRFEUSBCalib::HAM_30MHz; + break; + case LimeRFESettings::HAM_50_70MHz: + range = LimeRFEUSBCalib::HAM_50_70MHz; + break; + case LimeRFESettings::HAM_144_146MHz: + range = LimeRFEUSBCalib::HAM_144_146MHz; + break; + case LimeRFESettings::HAM_220_225MHz: + range = LimeRFEUSBCalib::HAM_220_225MHz; + break; + case LimeRFESettings::HAM_430_440MHz: + range = LimeRFEUSBCalib::HAM_430_440MHz; + break; + case LimeRFESettings::HAM_902_928MHz: + range = LimeRFEUSBCalib::HAM_902_928MHz; + break; + case LimeRFESettings::HAM_1240_1325MHz: + range = LimeRFEUSBCalib::HAM_1240_1325MHz; + break; + case LimeRFESettings::HAM_2300_2450MHz: + range = LimeRFEUSBCalib::HAM_2300_2450MHz; + break; + case LimeRFESettings::HAM_3300_3500MHz: + range = LimeRFEUSBCalib::HAM_3300_3500MHz; + break; + default: + return -1; + break; + } + break; + } + case LimeRFESettings::ChannelsCellular: + { + switch (m_settings.m_txCellularChannel) + { + case LimeRFESettings::CellularBand1: + range = LimeRFEUSBCalib::CellularBand1; + break; + case LimeRFESettings::CellularBand2: + range = LimeRFEUSBCalib::CellularBand2; + break; + case LimeRFESettings::CellularBand3: + range = LimeRFEUSBCalib::CellularBand3; + break; + case LimeRFESettings::CellularBand7: + range = LimeRFEUSBCalib::CellularBand7; + break; + case LimeRFESettings::CellularBand38: + range = LimeRFEUSBCalib::CellularBand38; + break; + default: + return -1; + break; + } + break; + } + default: + return -1; + break; + } + + return (int) range; +} + +double LimeRFEGUI::getPowerCorrection() +{ + int index = getPowerCorectionIndex(); + + QMap::const_iterator it = m_settings.m_calib.m_calibrations.find(index); + + if (it != m_settings.m_calib.m_calibrations.end()) { + return it.value(); + } else { + return 0.0; + } +} + +void LimeRFEGUI::setPowerCorrection(double dbValue) +{ + int index = getPowerCorectionIndex(); + + if (index < 0) { + return; + } + + m_settings.m_calib.m_calibrations[index] = dbValue; +} + +void LimeRFEGUI::updateAbsPower(double powerCorrDB) +{ + bool ok; + double power = ui->powerFwdText->text().toDouble(&ok); + + if (ok) + { + double powerCorrected = power + powerCorrDB; + double powerDisplayed = powerCorrected; + + if (m_avgPower) + { + m_powerMovingAverage(powerCorrected); + powerDisplayed = m_powerMovingAverage.asDouble(); + } + + ui->powerAbsDbText->setText(tr("%1 dBm").arg(QString::number(powerDisplayed, 'f', 1))); + double powerWatts = CalcDb::powerFromdB(powerDisplayed - 30.0); + powerWatts = powerWatts > 8.0 ? 8.0 : powerWatts; + ui->powerAbsWText->setText(tr("%1 W").arg(QString::number(powerWatts, 'f', 3))); + } +} + +void LimeRFEGUI::updateDeviceSetList() +{ + MainCore *mainCore = MainCore::instance(); + std::vector& deviceSets = mainCore->getDeviceSets(); + std::vector::const_iterator it = deviceSets.begin(); + + ui->deviceSetRx->blockSignals(true); + ui->deviceSetTx->blockSignals(true); + + // Save current positions + int rxIndex = ui->deviceSetRx->currentIndex(); + int txIndex = ui->deviceSetTx->currentIndex(); + + ui->deviceSetRx->clear(); + ui->deviceSetTx->clear(); + unsigned int deviceSetIndex = 0; + + for (; it != deviceSets.end(); ++it, deviceSetIndex++) + { + DSPDeviceSourceEngine *deviceSourceEngine = (*it)->m_deviceSourceEngine; + DSPDeviceSinkEngine *deviceSinkEngine = (*it)->m_deviceSinkEngine; + + if (deviceSourceEngine) { + ui->deviceSetRx->addItem(QString("R:%1").arg(deviceSetIndex), deviceSetIndex); + } else if (deviceSinkEngine) { + ui->deviceSetTx->addItem(QString("T:%1").arg(deviceSetIndex), deviceSetIndex); + } + } + + // Restore current positions (if possible) + ui->deviceSetRx->setCurrentIndex(rxIndex < 0 ? 0 : rxIndex); + ui->deviceSetTx->setCurrentIndex(txIndex < 0 ? 0 : txIndex); + + ui->deviceSetRx->blockSignals(false); + ui->deviceSetTx->blockSignals(false); +} + +void LimeRFEGUI::highlightApplyButton(bool highlight) +{ + if (highlight) { + ui->apply->setStyleSheet("QPushButton { background-color : green; }"); + } else { + ui->apply->setStyleSheet("QPushButton { background:rgb(64, 64, 64); }"); + } +} + +void LimeRFEGUI::on_openDevice_clicked() +{ + int rc = m_limeRFE->openDevice(ui->device->currentText().toStdString()); + ui->statusText->append(QString("Open %1: %2").arg(ui->device->currentText()).arg(m_limeRFE->getError(rc).c_str())); + + if (rc != 0) { + return; + } + + rc = m_limeRFE->getState(); + ui->statusText->append(QString("Get state: %1").arg(m_limeRFE->getError(rc).c_str())); +} + +void LimeRFEGUI::on_closeDevice_clicked() +{ + ui->statusText->clear(); + m_limeRFE->closeDevice(); + ui->statusText->setText("Closed"); +} + +void LimeRFEGUI::on_deviceToGUI_clicked() +{ + int rc = m_limeRFE->getState(); + + if (rc != 0) + { + ui->statusText->setText(m_limeRFE->getError(rc).c_str()); + return; + } + + m_limeRFE->stateToSettings(m_settings); + m_rxOn = m_limeRFE->getRx(); + m_txOn = m_limeRFE->getTx(); + displaySettings(); + highlightApplyButton(false); +} + +void LimeRFEGUI::on_rxChannelGroup_currentIndexChanged(int index) +{ + m_settings.m_rxChannels = (LimeRFESettings::ChannelGroups) index; + setRxChannels(); + + if (m_settings.m_txRxDriven) + { + m_settings.m_txChannels = m_settings.m_rxChannels; + ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels); + } + + highlightApplyButton(true); +} + +void LimeRFEGUI::on_rxChannel_currentIndexChanged(int index) +{ + if (m_settings.m_rxChannels == LimeRFESettings::ChannelsWideband) { + m_settings.m_rxWidebandChannel = (LimeRFESettings::WidebandChannel) index; + } else if (m_settings.m_rxChannels == LimeRFESettings::ChannelsHAM) { + m_settings.m_rxHAMChannel = (LimeRFESettings::HAMChannel) index; + } else if (m_settings.m_rxChannels == LimeRFESettings::ChannelsCellular) { + m_settings.m_rxCellularChannel = (LimeRFESettings::CellularChannel) index; + } + + setRxChannels(); + + if (m_settings.m_txRxDriven) + { + m_settings.m_txWidebandChannel = m_settings.m_rxWidebandChannel; + m_settings.m_txHAMChannel = m_settings.m_rxHAMChannel; + m_settings.m_txCellularChannel = m_settings.m_rxCellularChannel; + setTxChannels(); + } + + highlightApplyButton(true); +} + +void LimeRFEGUI::on_rxPort_currentIndexChanged(int index) +{ + m_settings.m_rxPort = (LimeRFESettings::RxPort) index; + highlightApplyButton(true); +} + +void LimeRFEGUI::on_txFollowsRx_clicked() +{ + bool checked = ui->txFollowsRx->isChecked(); + m_settings.m_txRxDriven = checked; + ui->txChannelGroup->setEnabled(!checked); + ui->txChannel->setEnabled(!checked); + m_settings.m_txChannels = m_settings.m_rxChannels; + m_settings.m_txWidebandChannel = m_settings.m_rxWidebandChannel; + m_settings.m_txHAMChannel = m_settings.m_rxHAMChannel; + m_settings.m_txCellularChannel = m_settings.m_rxCellularChannel; + ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels); + + if (checked) { + highlightApplyButton(true); + } +} + +void LimeRFEGUI::on_txChannelGroup_currentIndexChanged(int index) +{ + m_settings.m_txChannels = (LimeRFESettings::ChannelGroups) index; + setTxChannels(); + highlightApplyButton(true); +} + +void LimeRFEGUI::on_txChannel_currentIndexChanged(int index) +{ + if (m_settings.m_txChannels == LimeRFESettings::ChannelsWideband) { + m_settings.m_txWidebandChannel = (LimeRFESettings::WidebandChannel) index; + } else if (m_settings.m_txChannels == LimeRFESettings::ChannelsHAM) { + m_settings.m_txHAMChannel = (LimeRFESettings::HAMChannel) index; + } else if (m_settings.m_txChannels == LimeRFESettings::ChannelsCellular) { + m_settings.m_txCellularChannel = (LimeRFESettings::CellularChannel) index; + } + + setTxChannels(); + highlightApplyButton(true); +} + +void LimeRFEGUI::on_txPort_currentIndexChanged(int index) +{ + m_settings.m_txPort = (LimeRFESettings::TxPort) index; + highlightApplyButton(true); +} + +void LimeRFEGUI::on_powerEnable_clicked() +{ + m_settings.m_swrEnable = ui->powerEnable->isChecked(); + highlightApplyButton(true); +} + +void LimeRFEGUI::on_powerSource_currentIndexChanged(int index) +{ + m_settings.m_swrSource = (LimeRFESettings::SWRSource) index; + highlightApplyButton(true); +} + +void LimeRFEGUI::on_powerRefresh_clicked() +{ + refreshPower(); +} + +void LimeRFEGUI::on_powerAutoRefresh_toggled(bool checked) +{ + if (checked) + { + connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); + m_timer.start(); + } + else + { + m_timer.stop(); + disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); + } +} + +void LimeRFEGUI::on_powerAbsAvg_clicked() +{ + m_avgPower = ui->powerAbsAvg->isChecked(); +} + +void LimeRFEGUI::on_powerCorrValue_textEdited(const QString &text) +{ + bool ok; + double powerCorrection = text.toDouble(&ok); + + if (ok) + { + setPowerCorrection(powerCorrection); + m_currentPowerCorrection = powerCorrection; + updateAbsPower(powerCorrection); + } +} + +void LimeRFEGUI::on_deviceSetRefresh_clicked() +{ + updateDeviceSetList(); +} + +void LimeRFEGUI::on_deviceSetSync_clicked() +{ + m_deviceSetSync = ui->deviceSetSync->isChecked(); + + if (m_deviceSetSync) { + syncRxTx(); + } +} + +void LimeRFEGUI::syncRxTx() +{ + if (!m_txOn) { + stopStartTx(m_txOn); + } + + stopStartRx(m_rxOn); + + if (m_txOn) { + stopStartTx(m_txOn); + } +} + +void LimeRFEGUI::stopStartRx(bool start) +{ + if (ui->deviceSetRx->currentIndex() < 0) { + return; + } + + int deviceSetIndex = ui->deviceSetRx->currentData().toInt(); + m_limeRFE->turnDevice(deviceSetIndex, start); +} + +void LimeRFEGUI::stopStartTx(bool start) +{ + if (ui->deviceSetTx->currentIndex() < 0) { + return; + } + + int deviceSetIndex = ui->deviceSetTx->currentData().toInt(); + m_limeRFE->turnDevice(deviceSetIndex, start); +} + +void LimeRFEGUI::on_modeRx_toggled(bool checked) +{ + int rc; + ui->statusText->clear(); + m_rxOn = checked; + + if (m_rxTxToggle) + { + m_txOn = !checked; + + if (checked) // Rx on + { + rc = m_limeRFE->setTx(false); // stop Tx first + ui->statusText->append(QString("Stop TX: %1").arg(m_limeRFE->getError(rc).c_str())); + } + + rc = m_limeRFE->setRx(m_rxOn); // Rx on or off + ui->statusText->append(QString("RX: %1").arg(m_limeRFE->getError(rc).c_str())); + + if (!checked) // Rx off + { + rc = m_limeRFE->setTx(true); // start Tx next + ui->statusText->append(QString("Start TX: %1").arg(m_limeRFE->getError(rc).c_str())); + } + } + else + { + rc = m_limeRFE->setRx(m_rxOn); + ui->statusText->setText(m_limeRFE->getError(rc).c_str()); + } + + if (m_deviceSetSync) { + syncRxTx(); + } + + displayMode(); +} + +void LimeRFEGUI::on_modeTx_toggled(bool checked) +{ + int rc; + ui->statusText->clear(); + m_txOn = checked; + + if (m_rxTxToggle) + { + m_rxOn = !checked; + + if (checked) // Tx on + { + rc = m_limeRFE->setRx(false); // stop Rx first + ui->statusText->append(QString("Stop RX: %1").arg(m_limeRFE->getError(rc).c_str())); + } + + rc = m_limeRFE->setTx(m_txOn); // Tx on or off + ui->statusText->append(QString("TX: %1").arg(m_limeRFE->getError(rc).c_str())); + + if (!checked) // Tx off + { + rc = m_limeRFE->setRx(true); // start Rx next + ui->statusText->append(QString("Start RX: %1").arg(m_limeRFE->getError(rc).c_str())); + } + } + else + { + rc = m_limeRFE->setTx(m_txOn); + ui->statusText->setText(m_limeRFE->getError(rc).c_str()); + } + + if (m_deviceSetSync) { + syncRxTx(); + } + + displayMode(); +} + +void LimeRFEGUI::on_rxTxToggle_clicked() +{ + m_rxTxToggle = ui->rxTxToggle->isChecked(); + + if (m_rxTxToggle && m_rxOn && m_txOn) + { + m_txOn = false; + int rc = m_limeRFE->setTx(m_txOn); + ui->statusText->setText(m_limeRFE->getError(rc).c_str()); + displayMode(); + + if (m_deviceSetSync) { + syncRxTx(); + } + } +} + +void LimeRFEGUI::on_attenuation_currentIndexChanged(int index) +{ + m_settings.m_attenuationFactor = index; + highlightApplyButton(true); +} + +void LimeRFEGUI::on_amFmNotchFilter_clicked() +{ + m_settings.m_amfmNotch = ui->amFmNotchFilter->isChecked(); + highlightApplyButton(true); +} + +void LimeRFEGUI::on_apply_clicked() +{ + ui->statusText->clear(); + m_limeRFE->settingsToState(m_settings); + int rc = m_limeRFE->configure(); + ui->statusText->setText(m_limeRFE->getError(rc).c_str()); + highlightApplyButton(false); +} + +void LimeRFEGUI::tick() +{ + refreshPower(); +} + +bool LimeRFEGUI::handleMessage(const Message& message) +{ + if (LimeRFE::MsgConfigureLimeRFE::match(message)) + { + qDebug("LimeRFEGUI::handleMessage: LimeRFE::MsgConfigureLimeRFE"); + const LimeRFE::MsgConfigureLimeRFE& cfg = (LimeRFE::MsgConfigureLimeRFE&) message; + m_settings = cfg.getSettings(); + displaySettings(); + highlightApplyButton(cfg.getForce()); + return true; + } + else if (LimeRFE::MsgReportSetRx::match(message)) + { + bool on = ((LimeRFE::MsgReportSetRx&) message).isOn(); + qDebug("LimeRFEGUI::handleMessage: LimeRFE::MsgReportSetRx: %s", on ? "on" : "off"); + m_rxOn = on; + displaySettings(); + return true; + } + else if (LimeRFE::MsgReportSetTx::match(message)) + { + bool on = ((LimeRFE::MsgReportSetTx&) message).isOn(); + qDebug("LimeRFEGUI::handleMessage: LimeRFE::MsgReportSetTx: %s", on ? "on" : "off"); + m_txOn = on; + displaySettings(); + return true; + } + + return false; +} + +void LimeRFEGUI::handleInputMessages() +{ + Message* message; + + while ((message = getInputMessageQueue()->pop())) + { + if (handleMessage(*message)) { + delete message; + } + } +} + +void LimeRFEGUI::makeUIConnections() +{ + QObject::connect(ui->openDevice, &QPushButton::clicked, this, &LimeRFEGUI::on_openDevice_clicked); + QObject::connect(ui->closeDevice, &QPushButton::clicked, this, &LimeRFEGUI::on_closeDevice_clicked); + QObject::connect(ui->deviceToGUI, &QPushButton::clicked, this, &LimeRFEGUI::on_deviceToGUI_clicked); + QObject::connect(ui->rxChannelGroup, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_rxChannelGroup_currentIndexChanged); + QObject::connect(ui->rxChannel, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_rxChannel_currentIndexChanged); + QObject::connect(ui->rxPort, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_rxPort_currentIndexChanged); + QObject::connect(ui->attenuation, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_attenuation_currentIndexChanged); + QObject::connect(ui->amFmNotchFilter, &QCheckBox::clicked, this, &LimeRFEGUI::on_amFmNotchFilter_clicked); + QObject::connect(ui->txFollowsRx, &QCheckBox::clicked, this, &LimeRFEGUI::on_txFollowsRx_clicked); + QObject::connect(ui->txChannelGroup, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_txChannelGroup_currentIndexChanged); + QObject::connect(ui->txChannel, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_txChannel_currentIndexChanged); + QObject::connect(ui->txPort, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_txPort_currentIndexChanged); + QObject::connect(ui->powerEnable, &QCheckBox::clicked, this, &LimeRFEGUI::on_powerEnable_clicked); + QObject::connect(ui->powerSource, QOverload::of(&QComboBox::currentIndexChanged), this, &LimeRFEGUI::on_powerSource_currentIndexChanged); + QObject::connect(ui->powerRefresh, &QPushButton::clicked, this, &LimeRFEGUI::on_powerRefresh_clicked); + QObject::connect(ui->powerAutoRefresh, &ButtonSwitch::toggled, this, &LimeRFEGUI::on_powerAutoRefresh_toggled); + QObject::connect(ui->powerAbsAvg, &QCheckBox::clicked, this, &LimeRFEGUI::on_powerAbsAvg_clicked); + QObject::connect(ui->powerCorrValue, &QLineEdit::textEdited, this, &LimeRFEGUI::on_powerCorrValue_textEdited); + QObject::connect(ui->modeRx, &QToolButton::toggled, this, &LimeRFEGUI::on_modeRx_toggled); + QObject::connect(ui->modeTx, &QToolButton::toggled, this, &LimeRFEGUI::on_modeTx_toggled); + QObject::connect(ui->rxTxToggle, &QCheckBox::clicked, this, &LimeRFEGUI::on_rxTxToggle_clicked); + QObject::connect(ui->deviceSetRefresh, &QPushButton::clicked, this, &LimeRFEGUI::on_deviceSetRefresh_clicked); + QObject::connect(ui->deviceSetSync, &QCheckBox::clicked, this, &LimeRFEGUI::on_deviceSetSync_clicked); + QObject::connect(ui->apply, &QPushButton::clicked, this, &LimeRFEGUI::on_apply_clicked); +} diff --git a/sdrgui/limerfegui/limerfeusbdialog.h b/plugins/feature/limerfe/limerfegui.h similarity index 65% rename from sdrgui/limerfegui/limerfeusbdialog.h rename to plugins/feature/limerfe/limerfegui.h index 7fc32c8d0..17448886f 100644 --- a/sdrgui/limerfegui/limerfeusbdialog.h +++ b/plugins/feature/limerfe/limerfegui.h @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 F4EXB // -// written by Edouard Griffiths // +// Copyright (C) 2022 Edouard Griffiths, F4EXB // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -16,36 +15,77 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#ifndef SDRGUI_LIMERFEGUI_LIMERFEUSBDIALOG_H_ -#define SDRGUI_LIMERFEGUI_LIMERFEUSBDIALOG_H_ +#ifndef INCLUDE_FEATURE_LIMERFEGUI_H_ +#define INCLUDE_FEATURE_LIMERFEGUI_H_ -#include - -#include #include +#include "feature/featuregui.h" +#include "util/messagequeue.h" #include "util/movingaverage.h" -#include "limerfe/limerfecontroller.h" -#include "limerfe/limerfeusbcalib.h" -#include "export.h" +#include "settings/rollupstate.h" +#include "limerfesettings.h" + +class PluginAPI; +class FeatureUISet; +class Feature; +class LimeRFE; class DSPDeviceSourceEngine; class DSPDeviceSinkEngine; -class MainWindow; namespace Ui { - class LimeRFEUSBDialog; + class LimeRFEGUI; } -class SDRGUI_API LimeRFEUSBDialog : public QDialog { +class LimeRFEGUI : public FeatureGUI +{ Q_OBJECT - public: - explicit LimeRFEUSBDialog(LimeRFEUSBCalib& limeRFEUSBCalib, MainWindow* mainWindow); - ~LimeRFEUSBDialog(); + static LimeRFEGUI* create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature); + virtual void destroy(); + + void resetToDefaults(); + QByteArray serialize() const; + bool deserialize(const QByteArray& data); + virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } + virtual void setWorkspaceIndex(int index); + virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; } + virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; } + virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; } + +protected: + void resizeEvent(QResizeEvent* size); private: - void displaySettings(); + Ui::LimeRFEGUI* ui; + PluginAPI* m_pluginAPI; + FeatureUISet* m_featureUISet; + LimeRFESettings m_settings; + RollupState m_rollupState; + bool m_rxOn; + bool m_txOn; + bool m_doApplySettings; + bool m_rxTxToggle; + QTimer m_timer; + double m_currentPowerCorrection; + bool m_avgPower; + MovingAverageUtil m_powerMovingAverage; + bool m_deviceSetSync; + std::vector m_sourceEngines; + std::vector m_rxDeviceSetIndex; + std::vector m_sinkEngines; + std::vector m_txDeviceSetIndex; + + LimeRFE* m_limeRFE; + MessageQueue m_inputMessageQueue; + + explicit LimeRFEGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr); + virtual ~LimeRFEGUI(); + + void blockApplySettings(bool block) { m_doApplySettings = !block; } + void applySettings(bool force = false); + void displaySettings(); void displayMode(); void displayPower(); void refreshPower(); @@ -60,26 +100,13 @@ private: void stopStartTx(bool start); void syncRxTx(); void highlightApplyButton(bool highlight); - - Ui::LimeRFEUSBDialog* ui; - MainWindow *m_mainWindow; - LimeRFEController m_controller; - LimeRFEController::LimeRFESettings m_settings; - LimeRFEUSBCalib& m_limeRFEUSBCalib; - bool m_rxTxToggle; - QTimer m_timer; - double m_currentPowerCorrection; - bool m_avgPower; - MovingAverageUtil m_powerMovingAverage; - bool m_deviceSetSync; - int m_rxDeviceSetSequence; - int m_txDeviceSetSequence; - std::vector m_sourceEngines; - std::vector m_rxDeviceSetIndex; - std::vector m_sinkEngines; - std::vector m_txDeviceSetIndex; + bool handleMessage(const Message& message); + void makeUIConnections(); private slots: + void onMenuDialogCalled(const QPoint &p); + void onWidgetRolled(QWidget* widget, bool rollDown); + void handleInputMessages(); void on_openDevice_clicked(); void on_closeDevice_clicked(); void on_deviceToGUI_clicked(); @@ -107,4 +134,4 @@ private slots: void tick(); }; -#endif // SDRGUI_LIMERFEGUI_LIMERFEUSBDIALOG_H_ +#endif diff --git a/plugins/feature/limerfe/limerfegui.ui b/plugins/feature/limerfe/limerfegui.ui new file mode 100644 index 000000000..13574f3e3 --- /dev/null +++ b/plugins/feature/limerfe/limerfegui.ui @@ -0,0 +1,980 @@ + + + LimeRFEGUI + + + + 0 + 0 + 392 + 667 + + + + + 0 + 0 + + + + + 390 + 667 + + + + + 560 + 667 + + + + + Liberation Sans + 9 + + + + LimeRFE USB controller + + + + + 0 + 0 + 391 + 372 + + + + Settings + + + + 3 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + Dev + + + + + + + + 220 + 0 + + + + Device + + + + + + + + 60 + 16777215 + + + + Open device + + + Open + + + + + + + + 60 + 16777215 + + + + Close Device + + + Close + + + + + + + + + + + Transfer data to GUI + + + to GUI + + + + + + + Apply changes + + + Apply + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + + + + + + + Rx channel + + + + + + + + + + + + 120 + 0 + + + + Rx channel group + + + + Wideband + + + + + HAM + + + + + Cellular + + + + + + + + + 200 + 0 + + + + Rx channel range + + + + + + + + + + + Rx port + + + + + + + + 99 + 16777215 + + + + Rx port + + + + Tx/Rx (J3) + + + + + Tx/Rx HF (J5) + + + + + + + + Att + + + + + + + Rx attenuation + + + + 0 + + + + + 2 + + + + + 4 + + + + + 6 + + + + + 8 + + + + + 10 + + + + + 12 + + + + + 14 + + + + + + + + dB + + + + + + + AM/FM notch filter + + + Notch + + + + + + + + + Qt::Horizontal + + + + + + + + + Tx channel + + + + + + + Channel same as Rx + + + Same as Rx + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 120 + 0 + + + + Rx channel group + + + + Wideband + + + + + HAM + + + + + Cellular + + + + + + + + + 200 + 0 + + + + Rx channel range + + + + + + + + + + + + 47 + 0 + + + + Tx port + + + + + + + Tx port + + + + Tx/Rx (J3) + + + + + Tx (J4) + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 373 + 391 + 121 + + + + Power + + + + 3 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + Enable power measurements + + + Pwr + + + + + + + Refresh power + + + + + + + :/recycle.png:/recycle.png + + + + + + + Power measurement source (EXTernal, CELlular) + + + + EXT + + + + + CEL + + + + + + + + Auto refresh power + + + + + + + :/play.png:/play.png + + + true + + + + + + + Corr + + + + + + + + 60 + 16777215 + + + + Qt::ClickFocus + + + Power correction in dBm + + + -00.0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 10 + + + + + Fwd + + + + + + + Relative forward power in dB + + + 00.0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + Ref + + + + + + + Relative reflected power in dB + + + 00.0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + RL + + + + + + + Return loss in dB + + + 00.0 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + dB + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + VSWR + + + + + + + Voltage Standing Wave Ratio + + + 1.000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Abs power + + + + + + + Corrected forward power in dBm + + + -00.0 dBm + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Corrected forward power in Watts + + + 0.000 W + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Corrected power averaging + + + Avg + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 495 + 391 + 171 + + + + Control + + + + 3 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + + Mode + + + + + + + + 110 + 0 + + + + Rx/Tx state + + + None + + + + + + + DeviceSet synchronization + + + Rx/Tx Sync + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Switch Rx + + + RX + + + true + + + + + + + Switch Tx + + + TX + + + true + + + + + + + Rx/Tx toggle + + + Toggle + + + + + + + Rx + + + + + + + Index of Rx DeviceSet + + + + + + + Tx + + + + + + + Index of Tx DeviceSet + + + + + + + Refresh DeviceSet indexes + + + + + + + :/recycle.png:/recycle.png + + + + + + + + + + + Messages + + + + + + + + + + + ButtonSwitch + QToolButton +
gui/buttonswitch.h
+
+ + RollupContents + QWidget +
gui/rollupcontents.h
+ 1 +
+
+ + + + +
diff --git a/plugins/feature/limerfe/limerfeplugin.cpp b/plugins/feature/limerfe/limerfeplugin.cpp new file mode 100644 index 000000000..09f911209 --- /dev/null +++ b/plugins/feature/limerfe/limerfeplugin.cpp @@ -0,0 +1,80 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + + +#include +#include "plugin/pluginapi.h" + +#ifndef SERVER_MODE +#include "limerfegui.h" +#endif +#include "limerfe.h" +#include "limerfeplugin.h" +#include "limerfewebapiadapter.h" + +const PluginDescriptor LimeRFEPlugin::m_pluginDescriptor = { + LimeRFE::m_featureId, + QStringLiteral("LimeRFE USB Controller"), + QStringLiteral("7.1.0"), + QStringLiteral("(c) Edouard Griffiths, F4EXB"), + QStringLiteral("https://github.com/f4exb/sdrangel"), + true, + QStringLiteral("https://github.com/f4exb/sdrangel") +}; + +LimeRFEPlugin::LimeRFEPlugin(QObject* parent) : + QObject(parent), + m_pluginAPI(nullptr) +{ +} + +const PluginDescriptor& LimeRFEPlugin::getPluginDescriptor() const +{ + return m_pluginDescriptor; +} + +void LimeRFEPlugin::initPlugin(PluginAPI* pluginAPI) +{ + m_pluginAPI = pluginAPI; + + // register Simple PTT feature + m_pluginAPI->registerFeature(LimeRFE::m_featureIdURI, LimeRFE::m_featureId, this); +} + +#ifdef SERVER_MODE +FeatureGUI* LimeRFEPlugin::createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const +{ + (void) featureUISet; + (void) feature; + return nullptr; +} +#else +FeatureGUI* LimeRFEPlugin::createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const +{ + return LimeRFEGUI::create(m_pluginAPI, featureUISet, feature); +} +#endif + +Feature* LimeRFEPlugin::createFeature(WebAPIAdapterInterface* webAPIAdapterInterface) const +{ + return new LimeRFE(webAPIAdapterInterface); +} + +FeatureWebAPIAdapter* LimeRFEPlugin::createFeatureWebAPIAdapter() const +{ + return new LimeRFEWebAPIAdapter(); +} diff --git a/plugins/feature/limerfe/limerfeplugin.h b/plugins/feature/limerfe/limerfeplugin.h new file mode 100644 index 000000000..53aca7c26 --- /dev/null +++ b/plugins/feature/limerfe/limerfeplugin.h @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_FEATURE_LIMERFEPLUGIN_H +#define INCLUDE_FEATURE_LIMERFEPLUGIN_H + +#include +#include "plugin/plugininterface.h" + +class FeatureGUI; +class WebAPIAdapterInterface; + +class LimeRFEPlugin : public QObject, PluginInterface { + Q_OBJECT + Q_INTERFACES(PluginInterface) + Q_PLUGIN_METADATA(IID "sdrangel.feature.limerfe") + +public: + explicit LimeRFEPlugin(QObject* parent = nullptr); + + const PluginDescriptor& getPluginDescriptor() const; + void initPlugin(PluginAPI* pluginAPI); + + virtual FeatureGUI* createFeatureGUI(FeatureUISet *featureUISet, Feature *feature) const; + virtual Feature* createFeature(WebAPIAdapterInterface *webAPIAdapterInterface) const; + virtual FeatureWebAPIAdapter* createFeatureWebAPIAdapter() const; + +private: + static const PluginDescriptor m_pluginDescriptor; + + PluginAPI* m_pluginAPI; +}; + +#endif // INCLUDE_FEATURE_SIMPLEPTTPLUGIN_H diff --git a/plugins/feature/limerfe/limerfesettings.cpp b/plugins/feature/limerfe/limerfesettings.cpp new file mode 100644 index 000000000..98d94ffb0 --- /dev/null +++ b/plugins/feature/limerfe/limerfesettings.cpp @@ -0,0 +1,182 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include + +#include "util/simpleserializer.h" +#include "settings/serializable.h" + +#include "limerfesettings.h" + +LimeRFESettings::LimeRFESettings() : + m_rollupState(nullptr) +{ + resetToDefaults(); +} + +void LimeRFESettings::resetToDefaults() +{ + m_devicePath = ""; + m_title = "Lime RFE"; + m_rgbColor = QColor(50, 205, 50).rgb(); + m_rxChannels = ChannelsWideband; + m_rxWidebandChannel = WidebandLow; + m_rxHAMChannel = HAM_144_146MHz; + m_rxCellularChannel = CellularBand38; + m_rxPort = RxPortJ3; + m_amfmNotch = false; + m_attenuationFactor = 0; + m_txChannels = ChannelsWideband; + m_txWidebandChannel = WidebandLow; + m_txHAMChannel = HAM_144_146MHz; + m_txCellularChannel = CellularBand38; + m_txPort = TxPortJ3; + m_swrEnable = false; + m_swrSource = SWRExternal; + m_txRxDriven = false; + m_useReverseAPI = false; + m_reverseAPIAddress = "127.0.0.1"; + m_reverseAPIPort = 8888; + m_reverseAPIFeatureSetIndex = 0; + m_reverseAPIFeatureIndex = 0; + m_workspaceIndex = 0; +} + +QByteArray LimeRFESettings::serialize() const +{ + SimpleSerializer s(1); + + s.writeS32(1, (int) m_rxChannels); + s.writeS32(2, (int) m_rxWidebandChannel); + s.writeS32(3, (int) m_rxHAMChannel); + s.writeS32(4, (int) m_rxCellularChannel); + s.writeS32(5, (int) m_rxPort); + s.writeBool(6, m_amfmNotch); + s.writeU32(7, m_attenuationFactor); + + s.writeS32(10, (int) m_txChannels); + s.writeS32(11, (int) m_txWidebandChannel); + s.writeS32(12, (int) m_txHAMChannel); + s.writeS32(13, (int) m_txCellularChannel); + s.writeS32(14, (int) m_txPort); + s.writeBool(15, m_swrEnable); + s.writeS32(16, (int) m_swrSource); + + s.writeBool(20, m_txRxDriven); + + s.writeString(30, m_title); + s.writeU32(31, m_rgbColor); + s.writeBool(32, m_useReverseAPI); + s.writeString(33, m_reverseAPIAddress); + s.writeU32(34, m_reverseAPIPort); + s.writeU32(35, m_reverseAPIFeatureSetIndex); + s.writeU32(36, m_reverseAPIFeatureIndex); + + if (m_rollupState) { + s.writeBlob(37, m_rollupState->serialize()); + } + + s.writeS32(38, m_workspaceIndex); + s.writeBlob(39, m_geometryBytes); + s.writeString(40, m_devicePath); + s.writeBlob(41, m_calib.serialize()); + + return s.final(); +} + +bool LimeRFESettings::deserialize(const QByteArray& data) +{ + SimpleDeserializer d(data); + + if(!d.isValid()) + { + resetToDefaults(); + return false; + } + + if(d.getVersion() == 1) + { + QByteArray bytetmp; + uint32_t utmp; + int tmp; + + d.readS32(1, &tmp, (int) ChannelsWideband); + m_rxChannels = (ChannelGroups) tmp; + d.readS32(2, &tmp, (int) WidebandLow); + m_rxWidebandChannel = (WidebandChannel) tmp; + d.readS32(3, &tmp, (int) HAM_144_146MHz); + m_rxHAMChannel = (HAMChannel) tmp; + d.readS32(4, &tmp, (int) CellularBand38); + m_rxCellularChannel = (CellularChannel) tmp; + d.readS32(5, &tmp, (int) RxPortJ3); + m_rxPort = (RxPort) tmp; + d.readBool(6, &m_amfmNotch, false); + d.readU32(7, &m_attenuationFactor, 0); + + d.readS32(10, &tmp, (int) ChannelsWideband); + m_txChannels = (ChannelGroups) tmp; + d.readS32(11, &tmp, (int) WidebandLow); + m_txWidebandChannel = (WidebandChannel) tmp; + d.readS32(12, &tmp, (int) HAM_144_146MHz); + m_txHAMChannel = (HAMChannel) tmp; + d.readS32(13, &tmp, (int) CellularBand38); + m_txCellularChannel = (CellularChannel) tmp; + d.readS32(14, &tmp, (int) TxPortJ3); + m_txPort = (TxPort) tmp; + d.readBool(15, &m_swrEnable, false); + d.readS32(16, &tmp, (int) SWRExternal); + m_swrSource = (SWRSource) tmp; + + d.readBool(20, &m_txRxDriven, false); + + d.readString(30, &m_title, "Lime RFE"); + d.readU32(31, &m_rgbColor, QColor(50, 205, 50).rgb()); + d.readBool(32, &m_useReverseAPI, false); + d.readString(33, &m_reverseAPIAddress, "127.0.0.1"); + d.readU32(34, &utmp, 0); + + if ((utmp > 1023) && (utmp < 65535)) { + m_reverseAPIPort = utmp; + } else { + m_reverseAPIPort = 8888; + } + + d.readU32(35, &utmp, 0); + m_reverseAPIFeatureSetIndex = utmp > 99 ? 99 : utmp; + d.readU32(36, &utmp, 0); + m_reverseAPIFeatureIndex = utmp > 99 ? 99 : utmp; + + if (m_rollupState) + { + d.readBlob(37, &bytetmp); + m_rollupState->deserialize(bytetmp); + } + + d.readS32(38, &m_workspaceIndex, 0); + d.readBlob(39, &m_geometryBytes); + d.readString(40, &m_devicePath, ""); + d.readBlob(41, &bytetmp); + m_calib.deserialize(bytetmp); + + return true; + } + else + { + resetToDefaults(); + return false; + } +} diff --git a/sdrbase/limerfe/limerfecontroller.h b/plugins/feature/limerfe/limerfesettings.h similarity index 52% rename from sdrbase/limerfe/limerfecontroller.h rename to plugins/feature/limerfe/limerfesettings.h index 000ed15ca..8dca60c6b 100644 --- a/sdrbase/limerfe/limerfecontroller.h +++ b/plugins/feature/limerfe/limerfesettings.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // +// Copyright (C) 2022 Edouard Griffiths, F4EXB // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -15,17 +15,18 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#ifndef SDRBASE_LIMERFE_LIMERFECONTROLLER_H_ -#define SDRBASE_LIMERFE_LIMERFECONTROLLER_H_ +#ifndef INCLUDE_FEATURE_LIMERFESETTINGS_H_ +#define INCLUDE_FEATURE_LIMERFESETTINGS_H_ -#include -#include -#include "lime/limeRFE.h" -#include "export.h" +#include +#include -class SDRBASE_API LimeRFEController +#include "limerfeusbcalib.h" + +class Serializable; + +struct LimeRFESettings { -public: enum ChannelGroups { ChannelsWideband, @@ -80,51 +81,43 @@ public: SWRCellular }; - struct SDRBASE_API LimeRFESettings - { - LimeRFESettings(); - // Rx - LimeRFEController::ChannelGroups m_rxChannels; - LimeRFEController::WidebandChannel m_rxWidebandChannel; - LimeRFEController::HAMChannel m_rxHAMChannel; - LimeRFEController::CellularChannel m_rxCellularChannel; - LimeRFEController::RxPort m_rxPort; - unsigned int m_attenuationFactor; //!< Attenuation is 2 times this factor in dB (0..7 => 0..14dB) - bool m_amfmNotch; - // Tx - LimeRFEController::ChannelGroups m_txChannels; - LimeRFEController::WidebandChannel m_txWidebandChannel; - LimeRFEController::HAMChannel m_txHAMChannel; - LimeRFEController::CellularChannel m_txCellularChannel; - LimeRFEController::TxPort m_txPort; - bool m_swrEnable; - LimeRFEController::SWRSource m_swrSource; - // Rx/Tx - bool m_txRxDriven; //!< Tx settings set according to Rx settings - bool m_rxOn; - bool m_txOn; - }; + // Rx + ChannelGroups m_rxChannels; + WidebandChannel m_rxWidebandChannel; + HAMChannel m_rxHAMChannel; + CellularChannel m_rxCellularChannel; + RxPort m_rxPort; + unsigned int m_attenuationFactor; //!< Attenuation is 2 times this factor in dB (0..7 => 0..14dB) + bool m_amfmNotch; + // Tx + ChannelGroups m_txChannels; + WidebandChannel m_txWidebandChannel; + HAMChannel m_txHAMChannel; + CellularChannel m_txCellularChannel; + TxPort m_txPort; + bool m_swrEnable; + SWRSource m_swrSource; + // Rx/Tx + bool m_txRxDriven; //!< Tx settings set according to Rx settings + // Common + QString m_devicePath; + QString m_title; + quint32 m_rgbColor; + bool m_useReverseAPI; + QString m_reverseAPIAddress; + uint16_t m_reverseAPIPort; + uint16_t m_reverseAPIFeatureSetIndex; + uint16_t m_reverseAPIFeatureIndex; + Serializable *m_rollupState; + int m_workspaceIndex; + QByteArray m_geometryBytes; + LimeRFEUSBCalib m_calib; - LimeRFEController(); - ~LimeRFEController(); - - int openDevice(const std::string& serialDeviceName); - void closeDevice(); - int configure(); - int getState(); - static std::string getError(int errorCode); - int setRx(LimeRFESettings& settings, bool rxOn); - int setTx(LimeRFESettings& settings, bool txOn); - int getFwdPower(int& powerDB); - int getRefPower(int& powerDB); - - void settingsToState(const LimeRFESettings& settings); - void stateToSettings(LimeRFESettings& settings); - -private: - rfe_dev_t *m_rfeDevice; - rfe_boardState m_rfeBoardState; - static const std::map m_errorCodesMap; + LimeRFESettings(); + void resetToDefaults(); + QByteArray serialize() const; + bool deserialize(const QByteArray& data); + void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } }; -#endif // SDRBASE_LIMERFE_LIMERFECONTROLLER_H_ +#endif diff --git a/sdrbase/limerfe/limerfeusbcalib.cpp b/plugins/feature/limerfe/limerfeusbcalib.cpp similarity index 100% rename from sdrbase/limerfe/limerfeusbcalib.cpp rename to plugins/feature/limerfe/limerfeusbcalib.cpp diff --git a/sdrbase/limerfe/limerfeusbcalib.h b/plugins/feature/limerfe/limerfeusbcalib.h similarity index 97% rename from sdrbase/limerfe/limerfeusbcalib.h rename to plugins/feature/limerfe/limerfeusbcalib.h index 80f419575..4973e75b6 100644 --- a/sdrbase/limerfe/limerfeusbcalib.h +++ b/plugins/feature/limerfe/limerfeusbcalib.h @@ -19,11 +19,10 @@ #define SDRBASE_LIMERFE_LIMERFEUSBCALIB_H_ #include -#include "export.h" class QByteArray; -class SDRBASE_API LimeRFEUSBCalib +class LimeRFEUSBCalib { public: QByteArray serialize() const; diff --git a/plugins/feature/limerfe/limerfewebapiadapter.cpp b/plugins/feature/limerfe/limerfewebapiadapter.cpp new file mode 100644 index 000000000..df8e98bb2 --- /dev/null +++ b/plugins/feature/limerfe/limerfewebapiadapter.cpp @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#include "SWGFeatureSettings.h" +#include "limerfe.h" +#include "limerfewebapiadapter.h" + +LimeRFEWebAPIAdapter::LimeRFEWebAPIAdapter() +{} + +LimeRFEWebAPIAdapter::~LimeRFEWebAPIAdapter() +{} + +int LimeRFEWebAPIAdapter::webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) errorMessage; + response.setDemodAnalyzerSettings(new SWGSDRangel::SWGDemodAnalyzerSettings()); + response.getDemodAnalyzerSettings()->init(); + LimeRFE::webapiFormatFeatureSettings(response, m_settings); + + return 200; +} + +int LimeRFEWebAPIAdapter::webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage) +{ + (void) force; // no action + (void) errorMessage; + LimeRFE::webapiUpdateFeatureSettings(m_settings, featureSettingsKeys, response); + + return 200; +} diff --git a/plugins/feature/limerfe/limerfewebapiadapter.h b/plugins/feature/limerfe/limerfewebapiadapter.h new file mode 100644 index 000000000..7e9a39f8a --- /dev/null +++ b/plugins/feature/limerfe/limerfewebapiadapter.h @@ -0,0 +1,49 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Edouard Griffiths, F4EXB. // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation as version 3 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License V3 for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_LIMERFE_WEBAPIADAPTER_H +#define INCLUDE_LIMERFE_WEBAPIADAPTER_H + +#include "feature/featurewebapiadapter.h" +#include "limerfesettings.h" + +/** + * Standalone API adapter only for the settings + */ +class LimeRFEWebAPIAdapter : public FeatureWebAPIAdapter { +public: + LimeRFEWebAPIAdapter(); + virtual ~LimeRFEWebAPIAdapter(); + + virtual QByteArray serialize() const { return m_settings.serialize(); } + virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); } + + virtual int webapiSettingsGet( + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& featureSettingsKeys, + SWGSDRangel::SWGFeatureSettings& response, + QString& errorMessage); + +private: + LimeRFESettings m_settings; +}; + +#endif // INCLUDE_DEMODANALYZER_WEBAPIADAPTER_H diff --git a/sdrgui/limerfeusbgui.md b/plugins/feature/limerfe/readme.md similarity index 66% rename from sdrgui/limerfeusbgui.md rename to plugins/feature/limerfe/readme.md index 9ced50bc1..9aa7fc73c 100644 --- a/sdrgui/limerfeusbgui.md +++ b/plugins/feature/limerfe/readme.md @@ -1,36 +1,46 @@ -

LimeRFE USB control

+

LimeRFE USB controller

-The LimeRFE or Lime RF Front End is a power amplifier and LNA board designed to augment the capabilities of the LimeSDR in order to build an operational radio solution. The usage is not limited to LimeSDR any Rx or Tx device can be connected to it. The LimeRFE can be controlled directly via its USB port independently of a LimeSDR device. This interface allows exactly that from the SDRangel GUI. +

Introduction

-To open the LimeRFE USB dialog open the Preferences sub-menu from the top bar and click on the `LimeRFE` item. This item is available only when the code is compiled with the `LimeRFE` branch of LimeSuite. +This plugin supports the [LimeRFE](https://github.com/myriadrf/LimeRFE) board. This board hosts a hardware power amplifier (PA) module with appropriate filtering and support circuitry to augment primarily but not only the LimeSDR, LimeSDR Mini, and LimeNET Micro platforms, providing a complete solution that addresses real life applications ranging from HAM radio to standards-compliant cellular network implementations. -The dialog is non-modal so that it can be left open and keep the control on LimeRFE while other functions can be used. +As mentioned above it can be connected to a wide variety of SDR receivers and transmitters and this feature supports the synchronization with any receiver or trasmiiter device sets. -Whenever a change requires the LimeRFE configuration to be changed to become effective the "Apply" button (6) becomes green to suggest it should be activated. +This plugin depends on [LimeSuite](https://github.com/myriadrf/LimeSuite) that should be available in your system in order to be compiled. -⚠ Disclaimer: please use this interface and the LimeRFE sensibly by making sure you are licensed to operate it on the selected frequencies. If you are a licensed amateur radio you should make sure you operate on the bands allocated in your region as some bands are exclusive to a specific region or country. +

Interface

-![LimeRFE USB dialog](../doc/img/LimeRFEUSB_dialog.png) +![LimeRFE controller GUI](../../../doc/img/LimeRFE_plugin.png) -

1. USB serial devices list

+When starting you need first to open the LimeRFE device with button (2). You havr to select the appropriate serial device from (1). Note that all serial USB based devices are listed. You need to identify which one corresponds to the LimeRFE board you want to target. + +Once opened successfully (check status message in 6) you will apply the settings using the Apply button (5). Whenever the settings are changed this button lits in green showing that you may press it to update the board. Conversely the "to GUI" button (4) reads the settings from the board and updates the GUI. + +

1. USB serial devices list

This combo lists all USB serial devices list available in the system regardless if they are LimeRFE or other devices. You must specify the device corresponding to a LimeRFE device to be able to open it successfully with (2) -

2. Open device

+

2. Open device

Click on this button to open the serial device selected by (1). You need to open the device successfully prior to any operation. The open status is displayed in the status window (5). -

3. Close device

+

3. Close device

If you have more than one LimeRFE connected to your system you have to close one before opening another by using this button. -

4. Pull device configuration to GUI

+

4. Pull device configuration to GUI

Use this button to retrieve the LimeRFE device current configuration and populate the GUI with its data. +

5. Apply changes

+ +Use this button to apply configuration changes. You must press this button to make any of your changes active. Whenever a change requires the LimeRFE configuration to be changed to become effective this button becomes green to suggest it should be activated. + +

6. Status window

A. Rx channel control -![LimeRFE USB Rx dialog](../doc/img/LimeRFEUSB_dialog_rx.png) +![LimeRFE Rx section](../../../doc/img/LimeRFE_plugin_rx.png)

A.1. Rx channel group

@@ -85,7 +95,7 @@ Toggle AM/FM broadcast bands notch filter.

B. Tx channel control

-![LimeRFE USB Tx dialog](../doc/img/LimeRFEUSB_dialog_tx.png) +![LimeRFE Tx section](../../../doc/img/LimeRFE_plugin_tx.png)

B.1 Copy Rx band settings

@@ -106,9 +116,12 @@ Select which port to connect the Rx to: - **Tx/Rx (J3)**: this is the J3 port combining Rx and Tx. When cellular bands are selected this is connected to a duplexer internally - **Tx (J4)**: Tx connected port only. Can be used to split Rx and Tx to drive a higher power P.A. for example + +This is where status messages are displayed. +

C. Power and SWR

-![LimeRFE USB power dialog](../doc/img/LimeRFEUSB_dialog_power.png) +![LimeRFE power section](../../../doc/img/LimeRFE_plugin_power.png)

C.1 Activate power measurement

@@ -118,52 +131,46 @@ Check this box to enable power measurements. Use this button to refresh the power measurements. -

C.3 Forward power (relative)

- -This is the relative forward direction power in dB. - -

C.4 Reflected power (relative)

- -This is the relative reverse direction power in dB. - -

C.5 Return loss

- -This is the return loss in dB and is exactly (C.3) minus (C.4). - -

C.6 Voltage Standing Wave Ratio

- -This is the VSWR computed from the return loss in (C.5) - -

C.7 Power measurement source

+

C.3 Power measurement source

Use this combo to select the power measurement source: - **EXT**: External: select this when a dual directional coupler is connected to `Ref` (J17) and `Fwd` (J18) ports - **CEL**: Cellular: select this to use the internal coupler when cellular bands are engaged -

C.8 Monitor power continuously

+

C.4 Monitor power continuously

Use this switch to activate the continuous monitoring. A measurement will be taken every 500ms. -

C.9 Power correction

+

C.5 Power correction

Use a power meter and apply this correction to obtain the real delivered power in dBm. There is one correction factor by band. The values are saved in the persistent settings. -

C.10 Corrected power

+

C.6 Coupler relative power measurements

-This is the corrected power in dBm and is exactly (C.3) plus (C.9). + - **Fwd**: This is the relative forward direction power in dB. + - **Ref**: This is the relative reverse direction power in dB. + - **RL**: This is the return loss in dB and is exactly Fwd minus Ref -

C.11 Corrected power in Watts

+

C.7 Voltage Standing Wave Ratio

+ +This is the VSWR computed from the return loss RL in (C.6) + +

C.8 Corrected power in dBm

+ +This is the corrected power in dBm and is exactly Fwd in (C.6) plus correction in (C.8). + +

C.9 Corrected power in Watts

This is the corrected power in Watts. -

C.12 Corrected power averaging

+

C.10 Corrected power averaging

Use this switch to activate the averaging of corrected power. This is a moving average over 10 measurements thus over a 5s period. -

D. Rx/Tx mode selection

+

D. Control

-![LimeRFE USB mode dialog](../doc/img/LimeRFEUSB_dialog_mode.png) +![LimeRFE control section](../../../doc/img/LimeRFE_plugin_control.png)

D.1 Rx mode

@@ -192,15 +199,3 @@ Select the Tx device set index with which you want to synchronize the Tx switch

D.7 Refresh device sets indexes

When the configuration of device sets changes you can use this button to refresh the device set indexes in (D.5) and (D.6). - -

5. Status window

- -This is where status messages are displayed. - -

6. Apply changes

- -Use this button to apply configuration changes. You must press this button to make any of your changes active. Whenever a change requires the LimeRFE configuration to be changed to become effective this button becomes green to suggest it should be activated. - -

7. Close dialog

- -This dismisses the dialog. diff --git a/plugins/feature/vorlocalizer/readme.md b/plugins/feature/vorlocalizer/readme.md index f4f4fc18a..15fe66557 100644 --- a/plugins/feature/vorlocalizer/readme.md +++ b/plugins/feature/vorlocalizer/readme.md @@ -27,7 +27,7 @@ Pressing this button downloads the OpenAIP.net Navaid database, which contains t

3: Draw Radials Adjusted for Magnetic Declination

-When checked, radials on the map will drawn adjusted for magnetic declination. For example, if a VOR has a magnetic declination of 5 degrees, and the radial is calculated at 0 degrees, the radial will be drawn to magnetic North, i.e. -5 degress from true North. If not checked, the same radial would be drawn to true North (i.e 0 degrees), which may result in a less accurate position estimate. +When checked, radials on the map will drawn adjusted for magnetic declination. For example, if a VOR has a magnetic declination of 5 degrees, and the radial is calculated at 0 degrees, the radial will be drawn to magnetic North, i.e. -5 degrees from true North. If not checked, the same radial would be drawn to true North (i.e 0 degrees), which may result in a less accurate position estimate.

4: Round robin turn time

diff --git a/plugins/samplemimo/bladerf2mimo/readme.md b/plugins/samplemimo/bladerf2mimo/readme.md index f8dc2c303..517246477 100644 --- a/plugins/samplemimo/bladerf2mimo/readme.md +++ b/plugins/samplemimo/bladerf2mimo/readme.md @@ -104,7 +104,7 @@ With SR as the sample rate before decimation Fc is calculated as: For Rx streams the I/Q stream from the BladeRF ADC is downsampled by a power of two before being sent to the passband. -For Tx strams the baseband stream is interpolated by this value before being sent to the BladeRF device. +For Tx streams the baseband stream is interpolated by this value before being sent to the BladeRF device. Possible values are increasing powers of two: 1 (no decimation or interpolation), 2, 4, 8, 16, 32, 64. diff --git a/plugins/samplesource/limesdrinput/readme.md b/plugins/samplesource/limesdrinput/readme.md index 9c86f4687..ba80b268a 100644 --- a/plugins/samplesource/limesdrinput/readme.md +++ b/plugins/samplesource/limesdrinput/readme.md @@ -161,7 +161,7 @@ Use this button to adjust the global gain of the LNA, TIA and PGA. LimeSuite sof

8.3: LNA manual gain

-Use this button to adjust the gain of tha LNA when manual gain mode is set (8.1). Gain can be set between 1 and 30 dB in 1 dB steps. However the hardware has 3 dB steps for the lower gain values so increasing or decreasing by one step does not always produce a change. The value in dB appears at the right of the button. +Use this button to adjust the gain of the LNA when manual gain mode is set (8.1). Gain can be set between 1 and 30 dB in 1 dB steps. However the hardware has 3 dB steps for the lower gain values so increasing or decreasing by one step does not always produce a change. The value in dB appears at the right of the button.

8.4: TIA manual gain

@@ -169,7 +169,7 @@ Use this combo to select the TIA gain in dB when manual gain mode is set (8.1).

8.5: PGA manual gain

-Use this button to adjust the gain of tha PGA when manual gain mode is set (8.1). Gain can be set between 0 and 32 dB in 1 dB steps. The value in dB appears at the right of the button. +Use this button to adjust the gain of the PGA when manual gain mode is set (8.1). Gain can be set between 0 and 32 dB in 1 dB steps. The value in dB appears at the right of the button.

9: Antenna select

diff --git a/plugins/samplesource/xtrxinput/readme.md b/plugins/samplesource/xtrxinput/readme.md index b82329800..a3fc80942 100644 --- a/plugins/samplesource/xtrxinput/readme.md +++ b/plugins/samplesource/xtrxinput/readme.md @@ -179,7 +179,7 @@ Use this button to adjust the global gain of the LNA, TIA and PGA. LimeSuite sof

8.3: LNA manual gain

-Use this button to adjust the gain of tha LNA when manual gain mode is set (9.1). Gain can be set between 1 and 30 dB in 1 dB steps. However the hardware has 3 dB steps for the lower gain values so increasing or decreasing by one step does not always produce a change. The value in dB appears at the right of the button. +Use this button to adjust the gain of the LNA when manual gain mode is set (9.1). Gain can be set between 1 and 30 dB in 1 dB steps. However the hardware has 3 dB steps for the lower gain values so increasing or decreasing by one step does not always produce a change. The value in dB appears at the right of the button.

8.4: TIA manual gain

@@ -187,7 +187,7 @@ Use this combo to select the TIA gain in dB when manual gain mode is set (9.1).

8.5: PGA manual gain

-Use this button to adjust the gain of tha PGA when manual gain mode is set (9.1). Gain can be set between 0 and 32 dB in 1 dB steps. The value in dB appears at the right of the button. +Use this button to adjust the gain of the PGA when manual gain mode is set (9.1). Gain can be set between 0 and 32 dB in 1 dB steps. The value in dB appears at the right of the button.

9: Antenna select

diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index ceee21356..094466cef 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -31,19 +31,6 @@ else(FFTW3F_FOUND) add_definitions(-DUSE_KISSFFT) endif(FFTW3F_FOUND) -if (LIMESUITE_FOUND) - set(sdrbase_SOURCES - ${sdrbase_SOURCES} - limerfe/limerfecontroller.cpp - ) - set(sdrbase_HEADERS - ${sdrbase_HEADERS} - limerfe/limerfecontroller.h - ) - include_directories(${LIMESUITE_INCLUDE_DIR}) - set(sdrbase_LIMERFE_LIB ${LIMESUITE_LIBRARY}) -endif (LIMESUITE_FOUND) - if (LIBSIGMF_FOUND AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(sdrbase_SOURCES ${sdrbase_SOURCES} @@ -65,8 +52,6 @@ set(sdrbase_SERIALDV_LIB ${LIBSERIALDV_LIBRARY}) set(sdrbase_SOURCES ${sdrbase_SOURCES} - ambe/ambeengine.cpp - ambe/ambeworker.cpp audio/audiocompressor.cpp audio/audiocompressorsnd.cpp @@ -165,8 +150,6 @@ set(sdrbase_SOURCES feature/featureutils.cpp feature/featurewebapiutils.cpp - limerfe/limerfeusbcalib.cpp - pipes/datafifostore.cpp pipes/datapipes.cpp pipes/datapipesgcworker.cpp @@ -242,8 +225,6 @@ set(sdrbase_SOURCES set(sdrbase_HEADERS ${sdrbase_HEADERS} - ambe/ambeengine.h - ambe/ambeworker.h audio/audiocompressor.h audio/audiocompressorsnd.h @@ -373,8 +354,6 @@ set(sdrbase_HEADERS feature/featureutils.h feature/featurewebapiutils.h - limerfe/limerfeusbcalib.h - pipes/datafifostore.h pipes/datapipes.h pipes/datapipesgcworker.h diff --git a/sdrbase/dsp/dspcommands.cpp b/sdrbase/dsp/dspcommands.cpp index 1ef8bbe9a..ba65aeef0 100644 --- a/sdrbase/dsp/dspcommands.cpp +++ b/sdrbase/dsp/dspcommands.cpp @@ -44,3 +44,4 @@ MESSAGE_CLASS_DEFINITION(DSPSignalNotification, Message) MESSAGE_CLASS_DEFINITION(DSPMIMOSignalNotification, Message) MESSAGE_CLASS_DEFINITION(DSPConfigureChannelizer, Message) MESSAGE_CLASS_DEFINITION(DSPConfigureAudio, Message) +MESSAGE_CLASS_DEFINITION(DSPPushMbeFrame, Message) diff --git a/sdrbase/dsp/dspcommands.h b/sdrbase/dsp/dspcommands.h index eda9ccc0e..9553ce2e6 100644 --- a/sdrbase/dsp/dspcommands.h +++ b/sdrbase/dsp/dspcommands.h @@ -345,4 +345,45 @@ private: AudioType m_autioType; }; +class SDRBASE_API DSPPushMbeFrame : public Message { + MESSAGE_CLASS_DECLARATION + +public: + DSPPushMbeFrame( + const unsigned char *mbeFrame, + int mbeRateIndex, + int mbeVolumeIndex, + unsigned char channels, + bool useHP, + int upsampling, + AudioFifo *audioFifo + ) : + Message(), + m_mbeFrame(mbeFrame), + m_mbeRateIndex(mbeRateIndex), + m_mbeVolumeIndex(mbeVolumeIndex), + m_channels(channels), + m_useHP(useHP), + m_upsampling(upsampling), + m_audioFifo(audioFifo) + { } + + const unsigned char * getMbeFrame() const { return m_mbeFrame; } + int getMbeRateIndex() const { return m_mbeRateIndex; } + int getMbeVolumeIndex() const { return m_mbeVolumeIndex; } + unsigned char getChannels() const { return m_channels; } + bool getUseHP() const { return m_useHP; } + int getUpsampling() const { return m_upsampling; } + AudioFifo *getAudioFifo() const { return m_audioFifo; } + +private: + const unsigned char *m_mbeFrame; + int m_mbeRateIndex; + int m_mbeVolumeIndex; + unsigned char m_channels; + bool m_useHP; + int m_upsampling; + AudioFifo *m_audioFifo; +}; + #endif // INCLUDE_DSPCOMMANDS_H diff --git a/sdrbase/dsp/dspengine.cpp b/sdrbase/dsp/dspengine.cpp index de1561cd3..76bace2c3 100644 --- a/sdrbase/dsp/dspengine.cpp +++ b/sdrbase/dsp/dspengine.cpp @@ -168,37 +168,6 @@ void DSPEngine::removeDeviceEngineAt(int deviceIndex) m_deviceEngineReferences.removeAt(deviceIndex); } -bool DSPEngine::hasDVSerialSupport() -{ - return m_ambeEngine.getNbDevices() > 0; -} - -void DSPEngine::setDVSerialSupport(bool support) -{ (void) support; } - -void DSPEngine::getDVSerialNames(std::vector& deviceNames) -{ - std::vector qDeviceRefs; - m_ambeEngine.getDeviceRefs(qDeviceRefs); - deviceNames.clear(); - - for (std::vector::const_iterator it = qDeviceRefs.begin(); it != qDeviceRefs.end(); ++it) { - deviceNames.push_back(it->toStdString()); - } -} - -void DSPEngine::pushMbeFrame( - const unsigned char *mbeFrame, - int mbeRateIndex, - int mbeVolumeIndex, - unsigned char channels, - bool useHP, - int upsampling, - AudioFifo *audioFifo) -{ - m_ambeEngine.pushMbeFrame(mbeFrame, mbeRateIndex, mbeVolumeIndex, channels, useHP, upsampling, audioFifo); -} - void DSPEngine::createFFTFactory(const QString& fftWisdomFileName) { m_fftFactory = new FFTFactory(fftWisdomFileName); diff --git a/sdrbase/dsp/dspengine.h b/sdrbase/dsp/dspengine.h index 1f1bafbd1..0b332e4e6 100644 --- a/sdrbase/dsp/dspengine.h +++ b/sdrbase/dsp/dspengine.h @@ -26,7 +26,6 @@ #include "audio/audiodevicemanager.h" #include "audio/audiooutputdevice.h" #include "export.h" -#include "ambe/ambeengine.h" class DSPDeviceSourceEngine; class DSPDeviceSinkEngine; @@ -55,7 +54,6 @@ public: void removeDeviceEngineAt(int deviceIndex); AudioDeviceManager *getAudioDeviceManager() { return &m_audioDeviceManager; } - AMBEEngine *getAMBEEngine() { return &m_ambeEngine; } uint32_t getDeviceSourceEnginesNumber() const { return m_deviceSourceEngines.size(); } DSPDeviceSourceEngine *getDeviceSourceEngineByIndex(unsigned int deviceIndex) { return m_deviceSourceEngines[deviceIndex]; } @@ -66,20 +64,6 @@ public: uint32_t getDeviceMIMOEnginesNumber() const { return m_deviceMIMOEngines.size(); } DSPDeviceMIMOEngine *getDeviceMIMOEngineByIndex(unsigned int deviceIndex) { return m_deviceMIMOEngines[deviceIndex]; } - // Serial DV methods: - - bool hasDVSerialSupport(); - void setDVSerialSupport(bool support); - void getDVSerialNames(std::vector& deviceNames); - void pushMbeFrame( - const unsigned char *mbeFrame, - int mbeRateIndex, - int mbeVolumeIndex, - unsigned char channels, - bool useHP, - int upsampling, - AudioFifo *audioFifo); - const QTimer& getMasterTimer() const { return m_masterTimer; } void setMIMOSupport(bool mimoSupport) { m_mimoSupport = mimoSupport; } bool getMIMOSupport() const { return m_mimoSupport; } @@ -109,7 +93,6 @@ private: QTimer m_masterTimer; bool m_dvSerialSupport; bool m_mimoSupport; - AMBEEngine m_ambeEngine; FFTFactory *m_fftFactory; }; diff --git a/sdrbase/limerfe/limerfecontroller.cpp b/sdrbase/limerfe/limerfecontroller.cpp deleted file mode 100644 index 35a718cea..000000000 --- a/sdrbase/limerfe/limerfecontroller.cpp +++ /dev/null @@ -1,567 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include - -#include "limerfecontroller.h" - -const std::map LimeRFEController::m_errorCodesMap = { - { 0, "OK"}, - {-4, "Error synchronizing communication"}, - {-3, "Non-configurable GPIO pin specified. Only pins 4 and 5 are configurable."}, - {-2, "Problem with .ini configuration file"}, - {-1, "Communication error"}, - { 1, "Wrong TX connector - not possible to route TX of the selecrted channel to the specified port"}, - { 2, "Wrong RX connector - not possible to route RX of the selecrted channel to the specified port"}, - { 3, "Mode TXRX not allowed - when the same port is selected for RX and TX, it is not allowed to use mode RX & TX"}, - { 4, "Wrong mode for cellular channel - Cellular FDD bands (1, 2, 3, and 7) are only allowed mode RX & TX, while TDD band 38 is allowed only RX or TX mode"}, - { 5, "Cellular channels must be the same both for RX and TX"}, - { 6, "Requested channel code is wrong"} -}; - -LimeRFEController::LimeRFESettings::LimeRFESettings() -{ - m_rxChannels = ChannelsWideband; - m_rxWidebandChannel = WidebandLow; - m_rxHAMChannel = HAM_144_146MHz; - m_rxCellularChannel = CellularBand38; - m_rxPort = RxPortJ3; - m_amfmNotch = false; - m_attenuationFactor = 0; - m_txChannels = ChannelsWideband; - m_txWidebandChannel = WidebandLow; - m_txHAMChannel = HAM_144_146MHz; - m_txCellularChannel = CellularBand38; - m_txPort = TxPortJ3; - m_swrEnable = false; - m_swrSource = SWRExternal; - m_txRxDriven = false; - m_rxOn = false; - m_txOn = false; -} - -LimeRFEController::LimeRFEController() : - m_rfeDevice(nullptr) -{} - -LimeRFEController::~LimeRFEController() -{ - closeDevice(); -} - -int LimeRFEController::openDevice(const std::string& serialDeviceName) -{ - closeDevice(); - - rfe_dev_t *rfeDevice = RFE_Open(serialDeviceName.c_str(), nullptr); - - if (rfeDevice != (void *) -1) { - m_rfeDevice = rfeDevice; - return 0; - } - else - { - return -1; - } -} - -void LimeRFEController::closeDevice() -{ - if (m_rfeDevice) - { - RFE_Close(m_rfeDevice); - m_rfeDevice = nullptr; - } -} - -int LimeRFEController::configure() -{ - if (!m_rfeDevice) { - return -1; - } - - qDebug() << "LimeRFEController::configure: " - << "attValue: " << (int) m_rfeBoardState.attValue - << "channelIDRX: " << (int) m_rfeBoardState.channelIDRX - << "channelIDTX: " << (int) m_rfeBoardState.channelIDTX - << "mode: " << (int) m_rfeBoardState.mode - << "notchOnOff: " << (int) m_rfeBoardState.notchOnOff - << "selPortRX: " << (int) m_rfeBoardState.selPortRX - << "selPortTX: " << (int) m_rfeBoardState.selPortTX - << "enableSWR: " << (int) m_rfeBoardState.enableSWR - << "sourceSWR: " << (int) m_rfeBoardState.sourceSWR; - - int rc = RFE_ConfigureState(m_rfeDevice, m_rfeBoardState); - - if (rc != 0) { - qInfo("LimeRFEController::configure: %s", getError(rc).c_str()); - } else { - qDebug() << "LimeRFEController::configure: done"; - } - - return rc; -} - -int LimeRFEController::getState() -{ - if (!m_rfeDevice) { - return -1; - } - - int rc = RFE_GetState(m_rfeDevice, &m_rfeBoardState); - - qDebug() << "LimeRFEController::getState: " - << "attValue: " << (int) m_rfeBoardState.attValue - << "channelIDRX: " << (int) m_rfeBoardState.channelIDRX - << "channelIDTX: " << (int) m_rfeBoardState.channelIDTX - << "mode: " << (int) m_rfeBoardState.mode - << "notchOnOff: " << (int) m_rfeBoardState.notchOnOff - << "selPortRX: " << (int) m_rfeBoardState.selPortRX - << "selPortTX: " << (int) m_rfeBoardState.selPortTX - << "enableSWR: " << (int) m_rfeBoardState.enableSWR - << "sourceSWR: " << (int) m_rfeBoardState.sourceSWR; - - if (rc != 0) { - qInfo("LimeRFEController::getState: %s", getError(rc).c_str()); - } - - return rc; -} - -std::string LimeRFEController::getError(int errorCode) -{ - std::map::const_iterator it = m_errorCodesMap.find(errorCode); - - if (it == m_errorCodesMap.end()) { - return "Unknown error"; - } else { - return it->second; - } -} - -int LimeRFEController::setRx(LimeRFESettings& settings, bool rxOn) -{ - if (!m_rfeDevice) { - return -1; - } - - int mode = rxOn && settings.m_txOn ? - RFE_MODE_TXRX : rxOn ? - RFE_MODE_RX : settings.m_txOn ? - RFE_MODE_TX : RFE_MODE_NONE; - - int rc = RFE_Mode(m_rfeDevice, mode); - - if (rc == 0) { - settings.m_rxOn = rxOn; - } - - return rc; -} - -int LimeRFEController::setTx(LimeRFESettings& settings, bool txOn) -{ - if (!m_rfeDevice) { - return -1; - } - - int mode = txOn && settings.m_rxOn ? - RFE_MODE_TXRX : txOn ? - RFE_MODE_TX : settings.m_rxOn ? - RFE_MODE_RX : RFE_MODE_NONE; - - int rc = RFE_Mode(m_rfeDevice, mode); - - if (rc == 0) { - settings.m_txOn = txOn; - } - - return rc; -} - -int LimeRFEController::getFwdPower(int& powerDB) -{ - if (!m_rfeDevice) { - return -1; - } - - int power; - int rc = RFE_ReadADC(m_rfeDevice, RFE_ADC1, &power); - - if (rc == 0) { - powerDB = power; - } - - return rc; -} - -int LimeRFEController::getRefPower(int& powerDB) -{ - if (!m_rfeDevice) { - return -1; - } - - int power; - int rc = RFE_ReadADC(m_rfeDevice, RFE_ADC2, &power); - - if (rc == 0) { - powerDB = power; - } - - return rc; -} - -void LimeRFEController::settingsToState(const LimeRFESettings& settings) -{ - if (settings.m_rxChannels == ChannelsCellular) - { - if (settings.m_rxCellularChannel == CellularBand1) - { - m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND01; - m_rfeBoardState.mode = RFE_MODE_TXRX; - } - else if (settings.m_rxCellularChannel == CellularBand2) - { - m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND02; - m_rfeBoardState.mode = RFE_MODE_TXRX; - } - else if (settings.m_rxCellularChannel == CellularBand3) - { - m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND03; - m_rfeBoardState.mode = RFE_MODE_TXRX; - } - else if (settings.m_rxCellularChannel == CellularBand38) - { - m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND38; - } - else if (settings.m_rxCellularChannel == CellularBand7) - { - m_rfeBoardState.channelIDRX = RFE_CID_CELL_BAND07; - m_rfeBoardState.mode = RFE_MODE_TXRX; - } - - m_rfeBoardState.selPortRX = RFE_PORT_1; - m_rfeBoardState.selPortTX = RFE_PORT_1; - m_rfeBoardState.channelIDTX = m_rfeBoardState.channelIDRX; - } - else - { - m_rfeBoardState.mode = settings.m_rxOn && settings.m_txOn ? - RFE_MODE_TXRX : settings.m_rxOn ? - RFE_MODE_RX : settings.m_txOn ? - RFE_MODE_TX : RFE_MODE_NONE; - - if (settings.m_rxChannels == ChannelsWideband) - { - if (settings.m_rxWidebandChannel == WidebandLow) { - m_rfeBoardState.channelIDRX = RFE_CID_WB_1000; - } else if (settings.m_rxWidebandChannel == WidebandHigh) { - m_rfeBoardState.channelIDRX = RFE_CID_WB_4000; - } - } - else if (settings.m_rxChannels == ChannelsHAM) - { - if (settings.m_rxHAMChannel == HAM_30M) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_0030; - } else if (settings.m_rxHAMChannel == HAM_50_70MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_0070; - } else if (settings.m_rxHAMChannel == HAM_144_146MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_0145; - } else if (settings.m_rxHAMChannel == HAM_220_225MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_0220; - } else if (settings.m_rxHAMChannel == HAM_430_440MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_0435; - } else if (settings.m_rxHAMChannel == HAM_902_928MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_0920; - } else if (settings.m_rxHAMChannel == HAM_1240_1325MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_1280; - } else if (settings.m_rxHAMChannel == HAM_2300_2450MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_2400; - } else if (settings.m_rxHAMChannel == HAM_3300_3500MHz) { - m_rfeBoardState.channelIDRX = RFE_CID_HAM_3500; - } - } - - if (settings.m_rxPort == RxPortJ3) { - m_rfeBoardState.selPortRX = RFE_PORT_1; - } else if (settings.m_rxPort == RxPortJ5) { - m_rfeBoardState.selPortRX = RFE_PORT_3; - } - - if (settings.m_txRxDriven) - { - m_rfeBoardState.channelIDTX = m_rfeBoardState.channelIDRX; - } - else - { - if (settings.m_txChannels == ChannelsWideband) - { - if (settings.m_txWidebandChannel == WidebandLow) { - m_rfeBoardState.channelIDTX = RFE_CID_WB_1000; - } else if (settings.m_txWidebandChannel == WidebandHigh) { - m_rfeBoardState.channelIDTX = RFE_CID_WB_4000; - } - } - else if (settings.m_txChannels == ChannelsHAM) - { - if (settings.m_txHAMChannel == HAM_30M) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_0030; - } else if (settings.m_txHAMChannel == HAM_50_70MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_0070; - } else if (settings.m_txHAMChannel == HAM_144_146MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_0145; - } else if (settings.m_txHAMChannel == HAM_220_225MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_0220; - } else if (settings.m_txHAMChannel == HAM_430_440MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_0435; - } else if (settings.m_txHAMChannel == HAM_902_928MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_0920; - } else if (settings.m_txHAMChannel == HAM_1240_1325MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_1280; - } else if (settings.m_txHAMChannel == HAM_2300_2450MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_2400; - } else if (settings.m_txHAMChannel == HAM_3300_3500MHz) { - m_rfeBoardState.channelIDTX = RFE_CID_HAM_3500; - } - } - } - - if (settings.m_txPort == TxPortJ3) { - m_rfeBoardState.selPortTX = RFE_PORT_1; - } else if (settings.m_txPort == TxPortJ4) { - m_rfeBoardState.selPortTX = RFE_PORT_2; - } else if (settings.m_txPort == TxPortJ5) { - m_rfeBoardState.selPortTX = RFE_PORT_3; - } - } - - m_rfeBoardState.attValue = settings.m_attenuationFactor > 7 ? 7 : settings.m_attenuationFactor; - m_rfeBoardState.notchOnOff = settings.m_amfmNotch; - m_rfeBoardState.enableSWR = settings.m_swrEnable ? RFE_SWR_ENABLE : RFE_SWR_DISABLE; - - if (settings.m_swrSource == SWRExternal) { - m_rfeBoardState.sourceSWR = RFE_SWR_SRC_EXT; - } else if (settings.m_swrSource == SWRCellular) { - m_rfeBoardState.sourceSWR = RFE_SWR_SRC_CELL; - } -} - -void LimeRFEController::stateToSettings(LimeRFESettings& settings) -{ - if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND01) - { - settings.m_rxChannels = ChannelsCellular; - settings.m_rxCellularChannel = CellularBand1; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND02) - { - settings.m_rxChannels = ChannelsCellular; - settings.m_rxCellularChannel = CellularBand2; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND03) - { - settings.m_rxChannels = ChannelsCellular; - settings.m_rxCellularChannel = CellularBand3; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND07) - { - settings.m_rxChannels = ChannelsCellular; - settings.m_rxCellularChannel = CellularBand7; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_CELL_BAND38) - { - settings.m_rxChannels = ChannelsCellular; - settings.m_rxCellularChannel = CellularBand38; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_WB_1000) - { - settings.m_rxChannels = ChannelsWideband; - settings.m_rxWidebandChannel = WidebandLow; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_WB_4000) - { - settings.m_rxChannels = ChannelsWideband; - settings.m_rxWidebandChannel = WidebandHigh; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0030) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_30M; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0070) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_50_70MHz; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0145) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_144_146MHz; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0220) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_220_225MHz; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0435) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_430_440MHz; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_0920) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_902_928MHz; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_1280) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_1240_1325MHz; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_2400) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_2300_2450MHz; - } - else if (m_rfeBoardState.channelIDRX == RFE_CID_HAM_3500) - { - settings.m_rxChannels = ChannelsHAM; - settings.m_rxHAMChannel = HAM_3300_3500MHz; - } - - if (m_rfeBoardState.selPortRX == RFE_PORT_1) { - settings.m_rxPort = RxPortJ3; - } else if (m_rfeBoardState.selPortRX == RFE_PORT_3) { - settings.m_rxPort = RxPortJ5; - } - - if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND01) - { - settings.m_txChannels = ChannelsCellular; - settings.m_txCellularChannel = CellularBand1; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND02) - { - settings.m_txChannels = ChannelsCellular; - settings.m_txCellularChannel = CellularBand2; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND03) - { - settings.m_txChannels = ChannelsCellular; - settings.m_txCellularChannel = CellularBand3; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND07) - { - settings.m_txChannels = ChannelsCellular; - settings.m_txCellularChannel = CellularBand7; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_CELL_BAND38) - { - settings.m_txChannels = ChannelsCellular; - settings.m_txCellularChannel = CellularBand38; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_WB_1000) - { - settings.m_txChannels = ChannelsWideband; - settings.m_txWidebandChannel = WidebandLow; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_WB_4000) - { - settings.m_txChannels = ChannelsWideband; - settings.m_txWidebandChannel = WidebandHigh; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0030) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_30M; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0070) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_50_70MHz; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0145) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_144_146MHz; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0220) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_220_225MHz; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0435) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_430_440MHz; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_0920) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_902_928MHz; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_1280) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_1240_1325MHz; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_2400) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_2300_2450MHz; - } - else if (m_rfeBoardState.channelIDTX == RFE_CID_HAM_3500) - { - settings.m_txChannels = ChannelsHAM; - settings.m_txHAMChannel = HAM_3300_3500MHz; - } - - if (m_rfeBoardState.selPortTX == RFE_PORT_1) { - settings.m_txPort = TxPortJ3; - } else if (m_rfeBoardState.selPortTX == RFE_PORT_2) { - settings.m_txPort = TxPortJ4; - } else if (m_rfeBoardState.selPortTX == RFE_PORT_3) { - settings.m_txPort = TxPortJ5; - } - - settings.m_attenuationFactor = m_rfeBoardState.attValue; - settings.m_amfmNotch = m_rfeBoardState.notchOnOff == RFE_NOTCH_ON; - - if (m_rfeBoardState.mode == RFE_MODE_RX) - { - settings.m_rxOn = true; - settings.m_txOn = false; - } - else if (m_rfeBoardState.mode == RFE_MODE_TX) - { - settings.m_rxOn = false; - settings.m_txOn = true; - } - else if (m_rfeBoardState.mode == RFE_MODE_NONE) - { - settings.m_rxOn = false; - settings.m_txOn = false; - } - else if (m_rfeBoardState.mode == RFE_MODE_TXRX) - { - settings.m_rxOn = true; - settings.m_txOn = true; - } - - settings.m_swrEnable = m_rfeBoardState.enableSWR == RFE_SWR_ENABLE; - settings.m_swrSource = m_rfeBoardState.sourceSWR == RFE_SWR_SRC_CELL ? SWRCellular : SWRExternal; -} diff --git a/sdrbase/resources/webapi.qrc b/sdrbase/resources/webapi.qrc index 219ac5fc7..5c38b5c68 100644 --- a/sdrbase/resources/webapi.qrc +++ b/sdrbase/resources/webapi.qrc @@ -9,6 +9,7 @@ webapi/doc/swagger/include/AIS.yaml webapi/doc/swagger/include/AISDemod.yaml webapi/doc/swagger/include/AISMod.yaml + webapi/doc/swagger/include/AMBE.yaml webapi/doc/swagger/include/AMDemod.yaml webapi/doc/swagger/include/AMMod.yaml webapi/doc/swagger/include/AntennaTools.yaml diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index b9bec83ab..120b8e2ef 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1248,6 +1248,19 @@ margin-bottom: 20px; } }, "description" : "AIS settings" +}; + defs.AMBEActions = { + "properties" : { + "updateDevices" : { + "description" : "Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing", + "$ref" : "#/definitions/AMBEDevices" + }, + "removeAll" : { + "type" : "integer", + "description" : "Set to a non zero value to remove all AMBE devices from the list of used AMBE devices" + } + }, + "description" : "AMBE" }; defs.AMBEDevice = { "properties" : { @@ -1261,6 +1274,23 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" +}; + defs.AMBEDeviceReport = { + "properties" : { + "devicePath" : { + "type" : "string", + "description" : "AMBE device full path or AMBE server URL" + }, + "successCount" : { + "type" : "integer", + "description" : "number of frames decoded successfully" + }, + "failureCount" : { + "type" : "integer", + "description" : "number of frames that failed to decode" + } + }, + "description" : "Report of AMBE device in use" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1278,6 +1308,52 @@ margin-bottom: 20px; } }, "description" : "List of AMBE devices (serial or server address)" +}; + defs.AMBEReport = { + "properties" : { + "serial" : { + "description" : "List of AMBE serial devices in the system", + "$ref" : "#/definitions/DVSerialDevices" + }, + "devices" : { + "type" : "array", + "description" : "List of AMBE devices or servers in use", + "items" : { + "$ref" : "#/definitions/AMBEDeviceReport" + } + } + }, + "description" : "AMBE" +}; + defs.AMBESettings = { + "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + }, + "rollupState" : { + "$ref" : "#/definitions/RollupState" + } + }, + "description" : "AMBE" }; defs.AMDemodReport = { "properties" : { @@ -4605,6 +4681,14 @@ margin-bottom: 20px; }, "rollupState" : { "$ref" : "#/definitions/RollupState" + }, + "ambeFeatureIndex" : { + "type" : "integer", + "description" : "index of AMBE controller feature to be used for AMBE frames decoding" + }, + "connectAMBE" : { + "type" : "integer", + "description" : "Decode frames with AMBE feature\n * 0 - Do not decode frames with AMBE feature\n * 1 - Decode frames with AMBE feature\n" } }, "description" : "DSDDemod" @@ -5270,9 +5354,15 @@ margin-bottom: 20px; "AFCActions" : { "$ref" : "#/definitions/AFCActions" }, + "AMBEActions" : { + "$ref" : "#/definitions/AMBEActions" + }, "GS232ControllerActions" : { "$ref" : "#/definitions/GS232ControllerActions" }, + "LimeRFEActions" : { + "$ref" : "#/definitions/LimeRFEActions" + }, "MapActions" : { "$ref" : "#/definitions/MapActions" }, @@ -5406,9 +5496,15 @@ margin-bottom: 20px; "AFCReport" : { "$ref" : "#/definitions/AFCReport" }, + "AMBEReport" : { + "$ref" : "#/definitions/AMBEReport" + }, "GS232ControllerReport" : { "$ref" : "#/definitions/GS232ControllerReport" }, + "LimeRFEReport" : { + "$ref" : "#/definitions/LimeRFEReport" + }, "MapReport" : { "$ref" : "#/definitions/MapReport" }, @@ -5489,6 +5585,9 @@ margin-bottom: 20px; "AISSettings" : { "$ref" : "#/definitions/AISSettings" }, + "AMBESettings" : { + "$ref" : "#/definitions/AMBESettings" + }, "AntennaToolsSettings" : { "$ref" : "#/definitions/AntennaToolsSettings" }, @@ -5504,6 +5603,9 @@ margin-bottom: 20px; "GS232ControllerSettings" : { "$ref" : "#/definitions/GS232ControllerSettings" }, + "LimeRFESettings" : { + "$ref" : "#/definitions/LimeRFESettings" + }, "MapSettings" : { "$ref" : "#/definitions/MapSettings" }, @@ -7069,6 +7171,34 @@ margin-bottom: 20px; } }, "description" : "KiwiSDR" +}; + defs.LimeRFEActions = { + "properties" : { + "selectChannel" : { + "type" : "integer", + "description" : "Select channel\n * 0 - Rx\n * 1 - Tx\n" + }, + "deviceSetIndex" : { + "type" : "integer" + }, + "switchChannel" : { + "type" : "integer", + "description" : "Switch on or off\n * 0 - Off\n * 1 - On\n" + }, + "getState" : { + "type" : "integer", + "description" : "Set to non zero value to get the board state" + }, + "fromToSettings" : { + "type" : "integer", + "description" : "Move from/to settings to/from device\n * 0 - From device to settings. The toGUI button in GUI mode\n * 1 - From settings to device. The Apply button in GUI mode\n" + }, + "openCloseDevice" : { + "type" : "integer", + "description" : "Open or close device\n * 0 - Close device\n * 1 - Open device\n" + } + }, + "description" : "LimeRFE" }; defs.LimeRFEDevice = { "properties" : { @@ -7096,21 +7226,35 @@ margin-bottom: 20px; }, "description" : "List of LimeRFE devices (serial or server address)" }; - defs.LimeRFEPower = { + defs.LimeRFEReport = { "properties" : { - "forward" : { + "rxOn" : { + "type" : "integer", + "description" : "Boolean 1 if Rx is active else 0" + }, + "txOn" : { + "type" : "integer", + "description" : "Boolean 1 if Tx is active else 0" + }, + "forwardPower" : { "type" : "integer", "description" : "relative forward power in centi-Bels" }, - "reflected" : { + "reflectedPower" : { "type" : "integer", "description" : "relative reflected power in centi-Bels" } }, - "description" : "report of forward and reflected power measurements" + "description" : "LimeRFE" }; defs.LimeRFESettings = { "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, "devicePath" : { "type" : "string", "description" : "Path to the device serial interface (ex /dev/ttyUSB2)" @@ -7170,13 +7314,28 @@ margin-bottom: 20px; "type" : "integer", "description" : "SWR measurement source (LimeRFEController::SWRSource)\n * 0 - External\n * 1 - Cellular\n" }, - "rxOn" : { + "txRxDriven" : { "type" : "integer", - "description" : "Boolean 1 if Rx is active else 0" + "description" : "Boolean 1 if Tx is copy of Rx else 0" }, - "txOn" : { + "useReverseAPI" : { "type" : "integer", - "description" : "Boolean 1 if Tx is active else 0" + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + }, + "rollupState" : { + "$ref" : "#/definitions/RollupState" } }, "description" : "LimeRFE" @@ -14642,21 +14801,6 @@ margin-bottom: 20px; featuresetPresetPut -
  • - instanceAMBEDevicesDelete -
  • -
  • - instanceAMBEDevicesGet -
  • -
  • - instanceAMBEDevicesPatch -
  • -
  • - instanceAMBEDevicesPut -
  • -
  • - instanceAMBESerialGet -
  • instanceAudioGet
  • @@ -14735,21 +14879,6 @@ margin-bottom: 20px;
  • instanceFeatures
  • -
  • - instanceLimeRFEConfigGet -
  • -
  • - instanceLimeRFEConfigPut -
  • -
  • - instanceLimeRFEPowerGet -
  • -
  • - instanceLimeRFERunPut -
  • -
  • - instanceLimeRFESerialGet -
  • instanceLocationGet
  • @@ -38785,1785 +38914,6 @@ $(document).ready(function() {

    Instance

    -
    -
    -
    -

    instanceAMBEDevicesDelete

    -

    -
    -
    -
    -

    -

    Emtpy the active devices thus effectively closing down AMBE devices support

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X DELETE "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesDeleteWithCompletionHandler: 
    -              ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesDelete(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesDeleteExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesDelete: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesDelete();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesDelete: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesDelete();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesDelete: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_delete()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesDelete: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - Success.

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesGet

    -

    -
    -
    -
    -

    -

    get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesGetWithCompletionHandler: 
    -              ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of devices possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPatch

    -

    -
    -
    -
    -

    -

    Add and/or delete devices to/from the active list

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PATCH "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPatchWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPatch(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPatchExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPatch: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPatch($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPatch: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPatch(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPatch: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_patch(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPatch: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPut

    -

    -
    -
    -
    -

    -

    Replace the list of active devices

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPutWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBESerialGet

    -

    -
    -
    -
    -

    -

    get a list of available DV serial devices

    -

    -
    -
    /sdrangel/ambe/serial
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/serial"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBESerialGetWithCompletionHandler: 
    -              ^(DVSerialDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBESerialGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBESerialGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBESerialGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBESerialGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBESerialGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBESerialGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBESerialGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_serial_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBESerialGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of device paths possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -51076,1994 +49426,6 @@ except ApiException as e:

    -
    -
    -
    -

    instanceLimeRFEConfigGet

    -

    -
    -
    -
    -

    -

    get LimeRFE configuration

    -

    -
    -
    /sdrangel/limerfe/config
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/limerfe/config?serial="
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFESettings result = apiInstance.instanceLimeRFEConfigGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFESettings result = apiInstance.instanceLimeRFEConfigGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    String *serial = serial_example; // device serial path
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFEConfigGetWith:serial
    -              completionHandler: ^(LimeRFESettings output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var serial = serial_example; // {String} device serial path
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFEConfigGet(serial, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFEConfigGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var serial = serial_example;  // String | device serial path
    -
    -            try
    -            {
    -                LimeRFESettings result = apiInstance.instanceLimeRFEConfigGet(serial);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFEConfigGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$serial = serial_example; // String | device serial path
    -
    -try {
    -    $result = $api_instance->instanceLimeRFEConfigGet($serial);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFEConfigGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $serial = serial_example; # String | device serial path
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFEConfigGet(serial => $serial);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFEConfigGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -serial = serial_example # String | device serial path
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_config_get(serial)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFEConfigGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - -
    NameDescription
    serial* - - -
    -
    -
    - - String - - -
    - device serial path -
    -
    -
    - Required -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - On success return configuration information for the given device in input

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFEConfigPut

    -

    -
    -
    -
    -

    -

    replace LimeRFE configuration

    -

    -
    -
    /sdrangel/limerfe/config
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/limerfe/config"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFEConfigPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFEConfigPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    LimeRFESettings *body = ; // Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFEConfigPutWith:body
    -              completionHandler: ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {LimeRFESettings} Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFEConfigPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFEConfigPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new LimeRFESettings(); // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceLimeRFEConfigPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFEConfigPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -try {
    -    $result = $api_instance->instanceLimeRFEConfigPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFEConfigPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::LimeRFESettings->new(); # LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFEConfigPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFEConfigPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_config_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFEConfigPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFEPowerGet

    -

    -
    -
    -
    -

    -

    get forward and reflected relative powers in centi-Bels

    -

    -
    -
    /sdrangel/limerfe/power
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/limerfe/power?serial="
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFEPower result = apiInstance.instanceLimeRFEPowerGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEPowerGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFEPower result = apiInstance.instanceLimeRFEPowerGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEPowerGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    String *serial = serial_example; // device serial path
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFEPowerGetWith:serial
    -              completionHandler: ^(LimeRFEPower output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var serial = serial_example; // {String} device serial path
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFEPowerGet(serial, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFEPowerGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var serial = serial_example;  // String | device serial path
    -
    -            try
    -            {
    -                LimeRFEPower result = apiInstance.instanceLimeRFEPowerGet(serial);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFEPowerGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$serial = serial_example; // String | device serial path
    -
    -try {
    -    $result = $api_instance->instanceLimeRFEPowerGet($serial);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFEPowerGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $serial = serial_example; # String | device serial path
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFEPowerGet(serial => $serial);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFEPowerGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -serial = serial_example # String | device serial path
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_power_get(serial)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFEPowerGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - -
    NameDescription
    serial* - - -
    -
    -
    - - String - - -
    - device serial path -
    -
    -
    - Required -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - On success return forward and reflected powers in centi-Bels

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFERunPut

    -

    -
    -
    -
    -

    -

    set Rx and Tx on or off

    -

    -
    -
    /sdrangel/limerfe/run
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/limerfe/run"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFERunPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFERunPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFERunPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFERunPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    LimeRFESettings *body = ; // Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFERunPutWith:body
    -              completionHandler: ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {LimeRFESettings} Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFERunPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFERunPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new LimeRFESettings(); // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceLimeRFERunPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFERunPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -try {
    -    $result = $api_instance->instanceLimeRFERunPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFERunPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::LimeRFESettings->new(); # LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFERunPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFERunPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_run_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFERunPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFESerialGet

    -

    -
    -
    -
    -

    -

    get a list of available serial interfaces to LimeRFE device

    -

    -
    -
    /sdrangel/limerfe/serial
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/limerfe/serial"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            LimeRFEDevices result = apiInstance.instanceLimeRFESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            LimeRFEDevices result = apiInstance.instanceLimeRFESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFESerialGetWithCompletionHandler: 
    -              ^(LimeRFEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFESerialGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFESerialGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                LimeRFEDevices result = apiInstance.instanceLimeRFESerialGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFESerialGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceLimeRFESerialGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFESerialGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFESerialGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFESerialGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_serial_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFESerialGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of device paths possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -59698,7 +56060,7 @@ except ApiException as e:
    - Generated 2022-05-19T00:27:23.053+02:00 + Generated 2022-05-25T12:47:57.273+02:00
    diff --git a/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml new file mode 100644 index 000000000..1720cecfb --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/AMBE.yaml @@ -0,0 +1,103 @@ +AMBESettings: + description: AMBE + properties: + title: + type: string + rgbColor: + type: integer + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer + rollupState: + $ref: "/doc/swagger/include/RollupState.yaml#/RollupState" + +AMBEReport: + description: AMBE + properties: + serial: + description: List of AMBE serial devices in the system + $ref: "/doc/swagger/include/AMBE.yaml#/definitions/DVSerialDevices" + devices: + description: List of AMBE devices or servers in use + type: array + items: + $ref: "/doc/swagger/include/AMBE.yaml#/definitions/AMBEDeviceReport" + +AMBEActions: + description: AMBE + properties: + updateDevices: + description: Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing + $ref: "/doc/swagger/include/AMBE.yaml#/definitions/AMBEDevices" + removeAll: + type: integer + description: Set to a non zero value to remove all AMBE devices from the list of used AMBE devices + + +definitions: + + DVSerialDevices: + description: "List of DV serial devices available in the system" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + dvSerialDevices: + description: "Device names of DV serial devices" + type: array + items: + $ref: "#/definitions/DVSerialDevice" + + DVSerialDevice: + description: "DV serial device details" + properties: + deviceName: + description: "Name of the serial device in the system" + type: string + + AMBEDevices: + description: "List of AMBE devices (serial or server address)" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + ambeDevices: + description: "List of AMBE devices" + type: array + items: + $ref: "#/definitions/AMBEDevice" + + AMBEDevice: + description: "AMBE devices active in the system" + properties: + deviceRef: + description: "Serial device name or server address" + type: string + delete: + description: "1 if device is to be removed from active list" + type: integer + + AMBEDeviceReport: + description: "Report of AMBE device in use" + properties: + devicePath: + type: string + description: AMBE device full path or AMBE server URL + successCount: + type: integer + description: number of frames decoded successfully + failureCount: + type: integer + description: number of frames that failed to decode diff --git a/sdrbase/resources/webapi/doc/swagger/include/DSDDemod.yaml b/sdrbase/resources/webapi/doc/swagger/include/DSDDemod.yaml index ec315e4f8..d61367309 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/DSDDemod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/DSDDemod.yaml @@ -72,7 +72,15 @@ DSDDemodSettings: $ref: "/doc/swagger/include/ChannelMarker.yaml#/ChannelMarker" rollupState: $ref: "/doc/swagger/include/RollupState.yaml#/RollupState" - + ambeFeatureIndex: + type: integer + description: index of AMBE controller feature to be used for AMBE frames decoding + connectAMBE: + type: integer + description: > + Decode frames with AMBE feature + * 0 - Do not decode frames with AMBE feature + * 1 - Decode frames with AMBE feature DSDDemodReport: description: DSDDemod properties: diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml index f1ee424cd..bee05f5cf 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureActions.yaml @@ -15,8 +15,12 @@ FeatureActions: type: integer AFCActions: $ref: "/doc/swagger/include/AFC.yaml#/AFCActions" + AMBEActions: + $ref: "/doc/swagger/include/AMBE.yaml#/AMBEActions" GS232ControllerActions: $ref: "/doc/swagger/include/GS232Controller.yaml#/GS232ControllerActions" + LimeRFEActions: + $ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFEActions" MapActions: $ref: "/doc/swagger/include/Map.yaml#/MapActions" PERTesterActions: diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml index 109b16b1f..c4c63649e 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureReport.yaml @@ -9,8 +9,12 @@ FeatureReport: type: string AFCReport: $ref: "/doc/swagger/include/AFC.yaml#/AFCReport" + AMBEReport: + $ref: "/doc/swagger/include/AMBE.yaml#/AMBEReport" GS232ControllerReport: $ref: "/doc/swagger/include/GS232Controller.yaml#/GS232ControllerReport" + LimeRFEReport: + $ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFEReport" MapReport: $ref: "/doc/swagger/include/Map.yaml#/MapReport" PERTesterReport: diff --git a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml index b30b75ca8..2bef41e84 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FeatureSettings.yaml @@ -17,6 +17,8 @@ FeatureSettings: $ref: "/doc/swagger/include/AFC.yaml#/AFCSettings" AISSettings: $ref: "/doc/swagger/include/AIS.yaml#/AISSettings" + AMBESettings: + $ref: "/doc/swagger/include/AMBE.yaml#/AMBESettings" AntennaToolsSettings: $ref: "/doc/swagger/include/AntennaTools.yaml#/AntennaToolsSettings" APRSSettings: @@ -27,6 +29,8 @@ FeatureSettings: $ref: "/doc/swagger/include/JogdialController.yaml#/JogdialControllerSettings" GS232ControllerSettings: $ref: "/doc/swagger/include/GS232Controller.yaml#/GS232ControllerSettings" + LimeRFESettings: + $ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFESettings" MapSettings: $ref: "/doc/swagger/include/Map.yaml#/MapSettings" PERTesterSettings: diff --git a/sdrbase/resources/webapi/doc/swagger/include/LimeRFE.yaml b/sdrbase/resources/webapi/doc/swagger/include/LimeRFE.yaml index 095a88c00..8757eb8ee 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/LimeRFE.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/LimeRFE.yaml @@ -1,6 +1,10 @@ LimeRFESettings: description: LimeRFE properties: + title: + type: string + rgbColor: + type: integer devicePath: description: Path to the device serial interface (ex /dev/ttyUSB2) type: string @@ -102,19 +106,69 @@ LimeRFESettings: SWR measurement source (LimeRFEController::SWRSource) * 0 - External * 1 - Cellular + txRxDriven: + description: Boolean 1 if Tx is copy of Rx else 0 + type: integer + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer + rollupState: + $ref: "/doc/swagger/include/RollupState.yaml#/RollupState" + +LimeRFEReport: + description: LimeRFE + properties: rxOn: description: Boolean 1 if Rx is active else 0 type: integer txOn: description: Boolean 1 if Tx is active else 0 type: integer - -LimeRFEPower: - description: report of forward and reflected power measurements - properties: - forward: + forwardPower: description: relative forward power in centi-Bels type: integer - reflected: + reflectedPower: description: relative reflected power in centi-Bels - type: integer \ No newline at end of file + type: integer + +LimeRFEActions: + description: LimeRFE + properties: + selectChannel: + type: integer + description: > + Select channel + * 0 - Rx + * 1 - Tx + deviceSetIndex: + type: integer + dexcription: Index of device set to synchronize switch with + switchChannel: + type: integer + description: > + Switch on or off + * 0 - Off + * 1 - On + getState: + type: integer + description: Set to non zero value to get the board state + fromToSettings: + type: integer + description: > + Move from/to settings to/from device + * 0 - From device to settings. The toGUI button in GUI mode + * 1 - From settings to device. The Apply button in GUI mode + openCloseDevice: + type: integer + description: > + Open or close device + * 0 - Close device + * 1 - Open device diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index a81ae6e1a..fed3b778b 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -454,222 +454,6 @@ paths: "501": $ref: "#/responses/Response_501" - /sdrangel/ambe/serial: - x-swagger-router-controller: instance - get: - description: get a list of available DV serial devices - operationId: instanceAMBESerialGet - tags: - - Instance - responses: - "200": - description: On success return list of device paths possibly empty - schema: - $ref: "#/definitions/DVSerialDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/ambe/devices: - x-swagger-router-controller: instance - get: - description: get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes - operationId: InstanceAMBEDevicesGet - tags: - - Instance - responses: - "200": - description: On success return list of devices possibly empty - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - put: - description: Replace the list of active devices - operationId: InstanceAMBEDevicesPut - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - delete: - description: Emtpy the active devices thus effectively closing down AMBE devices support - operationId: InstanceAMBEDevicesDelete - tags: - - Instance - responses: - "200": - description: Success. - schema: - $ref: "#/definitions/SuccessResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - patch: - description: Add and/or delete devices to/from the active list - operationId: InstanceAMBEDevicesPatch - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/serial: - x-swagger-router-controller: instance - get: - description: get a list of available serial interfaces to LimeRFE device - operationId: instanceLimeRFESerialGet - tags: - - Instance - responses: - "200": - description: On success return list of device paths possibly empty - schema: - $ref: "#/definitions/LimeRFEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/config: - x-swagger-router-controller: instance - get: - description: get LimeRFE configuration - operationId: instanceLimeRFEConfigGet - tags: - - Instance - parameters: - - name: serial - in: query - description: device serial path - required: true - type: string - responses: - "200": - description: On success return configuration information for the given device in input - schema: - $ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFESettings" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - put: - description: replace LimeRFE configuration - operationId: instanceLimeRFEConfigPut - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API. - required: true - schema: - $ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFESettings" - responses: - "200": - description: Success - schema: - $ref: "#/definitions/SuccessResponse" - "400": - description: Error - schema: - $ref: "#/definitions/ErrorResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/run: - x-swagger-router-controller: instance - put: - description: set Rx and Tx on or off - operationId: instanceLimeRFERunPut - tags: - - Instance - parameters: - - name: body - in: body - description: Give device serial path in devicePath field and run status in rxOn and txOn - required: true - schema: - $ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFESettings" - responses: - "200": - description: Success - schema: - $ref: "#/definitions/SuccessResponse" - "400": - description: Error - schema: - $ref: "#/definitions/ErrorResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/power: - x-swagger-router-controller: instance - get: - description: get forward and reflected relative powers in centi-Bels - operationId: instanceLimeRFEPowerGet - tags: - - Instance - parameters: - - name: serial - in: query - description: device serial path - required: true - type: string - responses: - "200": - description: On success return forward and reflected powers in centi-Bels - schema: - $ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFEPower" - "400": - description: Error - schema: - $ref: "#/definitions/ErrorResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - /sdrangel/presets: x-swagger-router-controller: instance get: @@ -3433,51 +3217,6 @@ definitions: type: number format: float - DVSerialDevices: - description: "List of DV serial devices available in the system" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - dvSerialDevices: - description: "Device names of DV serial devices" - type: array - items: - $ref: "#/definitions/DVSerialDevice" - - DVSerialDevice: - description: "DV serial device details" - properties: - deviceName: - description: "Name of the serial device in the system" - type: string - - AMBEDevices: - description: "List of AMBE devices (serial or server address)" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - ambeDevices: - description: "List of AMBE devices" - type: array - items: - $ref: "#/definitions/AMBEDevice" - - AMBEDevice: - description: "AMBE devices active in the system" - properties: - deviceRef: - description: "Serial device name or server address" - type: string - delete: - description: "1 if device is to be removed from active list" - type: integer - LimeRFEDevices: description: "List of LimeRFE devices (serial or server address)" required: diff --git a/sdrbase/settings/mainsettings.cpp b/sdrbase/settings/mainsettings.cpp index e9529066f..f4d988d59 100644 --- a/sdrbase/settings/mainsettings.cpp +++ b/sdrbase/settings/mainsettings.cpp @@ -7,11 +7,9 @@ #include "settings/mainsettings.h" #include "commands/command.h" #include "audio/audiodevicemanager.h" -#include "ambe/ambeengine.h" MainSettings::MainSettings() : - m_audioDeviceManager(nullptr), - m_ambeEngine(nullptr) + m_audioDeviceManager(nullptr) { resetToDefaults(); qInfo("MainSettings::MainSettings: settings file: format: %d location: %s", getFileFormat(), qPrintable(getFileLocation())); @@ -60,10 +58,6 @@ void MainSettings::load() m_audioDeviceManager->deserialize(qUncompress(QByteArray::fromBase64(s.value("audio").toByteArray()))); } - if (m_ambeEngine) { - m_ambeEngine->deserialize(qUncompress(QByteArray::fromBase64(s.value("ambe").toByteArray()))); - } - QStringList groups = s.childGroups(); for (int i = 0; i < groups.size(); ++i) @@ -135,7 +129,6 @@ void MainSettings::load() } m_hardwareDeviceUserArgs.deserialize(qUncompress(QByteArray::fromBase64(s.value("hwDeviceUserArgs").toByteArray()))); - m_limeRFEUSBCalib.deserialize(qUncompress(QByteArray::fromBase64(s.value("limeRFEUSBCalib").toByteArray()))); } void MainSettings::save() const @@ -149,10 +142,6 @@ void MainSettings::save() const s.setValue("audio", qCompress(m_audioDeviceManager->serialize()).toBase64()); } - if (m_ambeEngine) { - s.setValue("ambe", qCompress(m_ambeEngine->serialize()).toBase64()); - } - QStringList groups = s.childGroups(); for(int i = 0; i < groups.size(); ++i) @@ -196,7 +185,6 @@ void MainSettings::save() const } s.setValue("hwDeviceUserArgs", qCompress(m_hardwareDeviceUserArgs.serialize()).toBase64()); - s.setValue("limeRFEUSBCalib", qCompress(m_limeRFEUSBCalib.serialize()).toBase64()); } void MainSettings::initialize() diff --git a/sdrbase/settings/mainsettings.h b/sdrbase/settings/mainsettings.h index 5e55e2f92..d341dee3d 100644 --- a/sdrbase/settings/mainsettings.h +++ b/sdrbase/settings/mainsettings.h @@ -4,7 +4,6 @@ #include #include #include "device/deviceuserargs.h" -#include "limerfe/limerfeusbcalib.h" #include "preferences.h" #include "preset.h" #include "featuresetpreset.h" @@ -14,7 +13,6 @@ class Command; class AudioDeviceManager; -class AMBEEngine; class SDRBASE_API MainSettings : public QObject { @@ -182,10 +180,8 @@ public: } DeviceUserArgs& getDeviceUserArgs() { return m_hardwareDeviceUserArgs; } - LimeRFEUSBCalib& getLimeRFEUSBCalib() { return m_limeRFEUSBCalib; } const AudioDeviceManager *getAudioDeviceManager() const { return m_audioDeviceManager; } void setAudioDeviceManager(AudioDeviceManager *audioDeviceManager) { m_audioDeviceManager = audioDeviceManager; } - void setAMBEEngine(AMBEEngine *ambeEngine) { m_ambeEngine = ambeEngine; } signals: void preferenceChanged(int); @@ -205,8 +201,6 @@ protected: typedef QList Configurations; Configurations m_configurations; DeviceUserArgs m_hardwareDeviceUserArgs; - LimeRFEUSBCalib m_limeRFEUSBCalib; - AMBEEngine *m_ambeEngine; }; #endif // INCLUDE_SETTINGS_H diff --git a/sdrbase/webapi/webapiadapter.cpp b/sdrbase/webapi/webapiadapter.cpp index ea5885018..1a6e57976 100644 --- a/sdrbase/webapi/webapiadapter.cpp +++ b/sdrbase/webapi/webapiadapter.cpp @@ -51,9 +51,6 @@ #include "SWGDeviceListItem.h" #include "SWGAudioDevices.h" #include "SWGLocationInformation.h" -#include "SWGDVSerialDevices.h" -#include "SWGDVSerialDevice.h" -#include "SWGAMBEDevices.h" #include "SWGPresets.h" #include "SWGPresetGroup.h" #include "SWGPresetItem.h" @@ -79,7 +76,6 @@ #include "SWGDeviceState.h" #include "SWGLimeRFEDevices.h" #include "SWGLimeRFESettings.h" -#include "SWGLimeRFEPower.h" #include "SWGFeaturePresets.h" #include "SWGFeaturePresetGroup.h" #include "SWGFeaturePresetItem.h" @@ -88,10 +84,6 @@ #include "SWGFeatureReport.h" #include "SWGFeatureActions.h" -#ifdef HAS_LIMERFEUSB -#include "limerfe/limerfecontroller.h" -#endif - #include "webapiadapter.h" WebAPIAdapter::WebAPIAdapter() @@ -758,391 +750,6 @@ int WebAPIAdapter::instanceLocationPut( return 200; } -int WebAPIAdapter::instanceDVSerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - response.init(); - - std::vector deviceNames; - dspEngine->getDVSerialNames(deviceNames); - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getDvSerialDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it); - ++it; - } - - return 200; -} - -int WebAPIAdapter::instanceDVSerialPatch( - bool dvserial, - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - dspEngine->setDVSerialSupport(dvserial); - - MainCore::MsgDVSerial *msg = MainCore::MsgDVSerial::create(dvserial); - m_mainCore->m_mainMessageQueue->push(msg); - response.init(); - - if (dvserial) - { - std::vector deviceNames; - dspEngine->getDVSerialNames(deviceNames); - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getDvSerialDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it); - ++it; - } - } - else - { - response.setNbDevices(0); - } - - return 200; -} - -int WebAPIAdapter::instanceAMBESerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - response.init(); - - std::vector deviceNames; - std::vector qDeviceNames; - dspEngine->getAMBEEngine()->scan(qDeviceNames); - - for (std::vector::const_iterator it = qDeviceNames.begin(); it != qDeviceNames.end(); ++it) { - deviceNames.push_back(it->toStdString()); - } - - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getDvSerialDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGDVSerialDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceName() = QString::fromStdString(*it); - ++it; - } - - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesGet( - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - response.init(); - - std::vector deviceNames; - dspEngine->getDVSerialNames(deviceNames); - response.setNbDevices((int) deviceNames.size()); - QList *deviceNamesList = response.getAmbeDevices(); - - std::vector::iterator it = deviceNames.begin(); - - while (it != deviceNames.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGAMBEDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceRef() = QString::fromStdString(*it); - deviceNamesList->back()->setDelete(0); - ++it; - } - - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesDelete( - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - DSPEngine *dspEngine = DSPEngine::instance(); - dspEngine->getAMBEEngine()->releaseAll(); - - response.init(); - *response.getMessage() = QString("All AMBE devices released"); - - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesPut( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - DSPEngine *dspEngine = DSPEngine::instance(); - dspEngine->getAMBEEngine()->releaseAll(); - - QList *ambeList = query.getAmbeDevices(); - - for (QList::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) { - dspEngine->getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString()); - } - - instanceAMBEDevicesGet(response, error); - return 200; -} - -int WebAPIAdapter::instanceAMBEDevicesPatch( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - DSPEngine *dspEngine = DSPEngine::instance(); - QList *ambeList = query.getAmbeDevices(); - - for (QList::const_iterator it = ambeList->begin(); it != ambeList->end(); ++it) - { - if ((*it)->getDelete()) { - dspEngine->getAMBEEngine()->releaseController((*it)->getDeviceRef()->toStdString()); - } else { - dspEngine->getAMBEEngine()->registerController((*it)->getDeviceRef()->toStdString()); - } - } - - instanceAMBEDevicesGet(response, error); - return 200; -} - -#ifdef HAS_LIMERFEUSB -int WebAPIAdapter::instanceLimeRFESerialGet( - SWGSDRangel::SWGLimeRFEDevices& response, - SWGSDRangel::SWGErrorResponse& error) -{ - (void) error; - response.init(); - std::vector comPorts; - SerialUtil::getComPorts(comPorts, "ttyUSB[0-9]+"); // regex is for Linux only - response.setNbDevices((int) comPorts.size()); - QList *deviceNamesList = response.getLimeRfeDevices(); - std::vector::iterator it = comPorts.begin(); - - while (it != comPorts.end()) - { - deviceNamesList->append(new SWGSDRangel::SWGLimeRFEDevice); - deviceNamesList->back()->init(); - *deviceNamesList->back()->getDeviceRef() = QString::fromStdString(*it); - ++it; - } - - return 200; -} - -int WebAPIAdapter::instanceLimeRFEConfigGet( - const QString& serial, - SWGSDRangel::SWGLimeRFESettings& response, - SWGSDRangel::SWGErrorResponse& error) -{ - LimeRFEController controller; - int rc = controller.openDevice(serial.toStdString()); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error opening LimeRFE device %1: %2") - .arg(serial).arg(controller.getError(rc).c_str()); - return 400; - } - - rc = controller.getState(); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error getting config from LimeRFE device %1: %2") - .arg(serial).arg(controller.getError(rc).c_str()); - return 500; - } - - controller.closeDevice(); - - LimeRFEController::LimeRFESettings settings; - controller.stateToSettings(settings); - response.init(); - response.setDevicePath(new QString(serial)); - response.setRxChannels((int) settings.m_rxChannels); - response.setRxWidebandChannel((int) settings.m_rxWidebandChannel); - response.setRxHamChannel((int) settings.m_rxHAMChannel); - response.setRxCellularChannel((int) settings.m_rxCellularChannel); - response.setRxPort((int) settings.m_rxPort); - response.setRxOn(settings.m_rxOn ? 1 : 0); - response.setAmfmNotch(settings.m_amfmNotch ? 1 : 0); - response.setAttenuationFactor(settings.m_attenuationFactor); - response.setTxChannels((int) settings.m_txChannels); - response.setTxWidebandChannel((int) settings.m_txWidebandChannel); - response.setTxHamChannel((int) settings.m_txHAMChannel); - response.setTxCellularChannel((int) settings.m_txCellularChannel); - response.setTxPort((int) settings.m_txPort); - response.setTxOn(settings.m_txOn ? 1 : 0); - response.setSwrEnable(settings.m_swrEnable ? 1 : 0); - response.setSwrSource((int) settings.m_swrSource); - - return 200; -} - -int WebAPIAdapter::instanceLimeRFEConfigPut( - SWGSDRangel::SWGLimeRFESettings& query, - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error) -{ - LimeRFEController controller; - int rc = controller.openDevice(query.getDevicePath()->toStdString()); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error opening LimeRFE device %1: %2") - .arg(*query.getDevicePath()).arg(controller.getError(rc).c_str()); - return 400; - } - - LimeRFEController::LimeRFESettings settings; - settings.m_rxChannels = (LimeRFEController::ChannelGroups) query.getRxChannels(); - settings.m_rxWidebandChannel = (LimeRFEController::WidebandChannel) query.getRxWidebandChannel(); - settings.m_rxHAMChannel = (LimeRFEController::HAMChannel) query.getRxHamChannel(); - settings.m_rxCellularChannel = (LimeRFEController::CellularChannel) query.getRxCellularChannel(); - settings.m_rxPort = (LimeRFEController::RxPort) query.getRxPort(); - settings.m_rxOn = query.getRxOn() != 0; - settings.m_amfmNotch = query.getAmfmNotch() != 0; - settings.m_attenuationFactor = query.getAttenuationFactor(); - settings.m_txChannels = (LimeRFEController::ChannelGroups) query.getTxChannels(); - settings.m_txWidebandChannel = (LimeRFEController::WidebandChannel) query.getTxWidebandChannel(); - settings.m_txHAMChannel = (LimeRFEController::HAMChannel) query.getTxHamChannel(); - settings.m_txCellularChannel = (LimeRFEController::CellularChannel) query.getTxCellularChannel(); - settings.m_txPort = (LimeRFEController::TxPort) query.getTxPort(); - settings.m_txOn = query.getTxOn() != 0; - settings.m_swrEnable = query.getSwrEnable() != 0; - settings.m_swrSource = (LimeRFEController::SWRSource) query.getSwrSource(); - - controller.settingsToState(settings); - - rc = controller.configure(); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error configuring LimeRFE device %1: %2") - .arg(*query.getDevicePath()).arg(controller.getError(rc).c_str()); - return 500; - } - - response.init(); - *response.getMessage() = QString("LimeRFE device at %1 configuration updated successfully").arg(*query.getDevicePath()); - return 200; -} - -int WebAPIAdapter::instanceLimeRFERunPut( - SWGSDRangel::SWGLimeRFESettings& query, - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error) -{ - LimeRFEController controller; - int rc = controller.openDevice(query.getDevicePath()->toStdString()); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error opening LimeRFE device %1: %2") - .arg(*query.getDevicePath()).arg(controller.getError(rc).c_str()); - return 400; - } - - LimeRFEController::LimeRFESettings settings; - settings.m_rxOn = query.getRxOn() != 0; - settings.m_txOn = query.getTxOn() != 0; - - rc = controller.setRx(settings, settings.m_rxOn); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error setting Rx/Tx LimeRFE device %1: %2") - .arg(*query.getDevicePath()).arg(controller.getError(rc).c_str()); - return 400; - } - - response.init(); - *response.getMessage() = QString("LimeRFE device at %1 mode updated successfully").arg(*query.getDevicePath()); - return 200; -} - -int WebAPIAdapter::instanceLimeRFEPowerGet( - const QString& serial, - SWGSDRangel::SWGLimeRFEPower& response, - SWGSDRangel::SWGErrorResponse& error) -{ - LimeRFEController controller; - int rc = controller.openDevice(serial.toStdString()); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error opening LimeRFE device %1: %2") - .arg(serial).arg(controller.getError(rc).c_str()); - return 400; - } - - int fwdPower; - rc = controller.getFwdPower(fwdPower); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error getting forward power from LimeRFE device %1: %2") - .arg(serial).arg(controller.getError(rc).c_str()); - return 500; - } - - int refPower; - rc = controller.getRefPower(refPower); - - if (rc != 0) - { - error.init(); - *error.getMessage() = QString("Error getting reflected power from LimeRFE device %1: %2") - .arg(serial).arg(controller.getError(rc).c_str()); - return 500; - } - - controller.closeDevice(); - - response.init(); - response.setForward(fwdPower); - response.setReflected(refPower); - return 200; -} -#endif - int WebAPIAdapter::instancePresetsGet( SWGSDRangel::SWGPresets& response, SWGSDRangel::SWGErrorResponse& error) diff --git a/sdrbase/webapi/webapiadapter.h b/sdrbase/webapi/webapiadapter.h index 0608f0060..efcc1a4d4 100644 --- a/sdrbase/webapi/webapiadapter.h +++ b/sdrbase/webapi/webapiadapter.h @@ -115,63 +115,6 @@ public: SWGSDRangel::SWGLocationInformation& response, SWGSDRangel::SWGErrorResponse& error); - virtual int instanceDVSerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceDVSerialPatch( - bool dvserial, - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBESerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesGet( - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesPut( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesPatch( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceAMBEDevicesDelete( - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error); - -#ifdef HAS_LIMERFEUSB - virtual int instanceLimeRFESerialGet( - SWGSDRangel::SWGLimeRFEDevices& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceLimeRFEConfigGet( - const QString& serial, - SWGSDRangel::SWGLimeRFESettings& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceLimeRFEConfigPut( - SWGSDRangel::SWGLimeRFESettings& query, - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceLimeRFERunPut( - SWGSDRangel::SWGLimeRFESettings& query, - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error); - - virtual int instanceLimeRFEPowerGet( - const QString& serial, - SWGSDRangel::SWGLimeRFEPower& response, - SWGSDRangel::SWGErrorResponse& error); -#endif - virtual int instancePresetsGet( SWGSDRangel::SWGPresets& response, SWGSDRangel::SWGErrorResponse& error); diff --git a/sdrbase/webapi/webapiadapterinterface.cpp b/sdrbase/webapi/webapiadapterinterface.cpp index 3c10c31a0..125cc3e3e 100644 --- a/sdrbase/webapi/webapiadapterinterface.cpp +++ b/sdrbase/webapi/webapiadapterinterface.cpp @@ -31,12 +31,6 @@ QString WebAPIAdapterInterface::instanceAudioOutputParametersURL = "/sdrangel/au QString WebAPIAdapterInterface::instanceAudioInputCleanupURL = "/sdrangel/audio/input/cleanup"; QString WebAPIAdapterInterface::instanceAudioOutputCleanupURL = "/sdrangel/audio/output/cleanup"; QString WebAPIAdapterInterface::instanceLocationURL = "/sdrangel/location"; -QString WebAPIAdapterInterface::instanceAMBESerialURL = "/sdrangel/ambe/serial"; -QString WebAPIAdapterInterface::instanceAMBEDevicesURL = "/sdrangel/ambe/devices"; -QString WebAPIAdapterInterface::instanceLimeRFESerialURL = "/sdrangel/limerfe/serial"; -QString WebAPIAdapterInterface::instanceLimeRFEConfigURL = "/sdrangel/limerfe/config"; -QString WebAPIAdapterInterface::instanceLimeRFERunURL = "/sdrangel/limerfe/run"; -QString WebAPIAdapterInterface::instanceLimeRFEPowerURL = "/sdrangel/limerfe/power"; QString WebAPIAdapterInterface::instancePresetsURL = "/sdrangel/presets"; QString WebAPIAdapterInterface::instancePresetURL = "/sdrangel/preset"; QString WebAPIAdapterInterface::instancePresetFileURL = "/sdrangel/preset/file"; diff --git a/sdrbase/webapi/webapiadapterinterface.h b/sdrbase/webapi/webapiadapterinterface.h index 41a9e2c3b..cd1862c6b 100644 --- a/sdrbase/webapi/webapiadapterinterface.h +++ b/sdrbase/webapi/webapiadapterinterface.h @@ -41,8 +41,6 @@ namespace SWGSDRangel class SWGAudioInputDevice; class SWGAudioOutputDevice; class SWGLocationInformation; - class SWGDVSerialDevices; - class SWGAMBEDevices; class SWGLimeRFEDevices; class SWGLimeRFESettings; class SWGLimeRFEPower; @@ -401,80 +399,6 @@ public: return 501; } - /** - * Handler of /sdrangel/ambe/serial (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBESerialGet( - SWGSDRangel::SWGDVSerialDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesGet( - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesPut( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) query; - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesPatch( - SWGSDRangel::SWGAMBEDevices& query, - SWGSDRangel::SWGAMBEDevices& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) query; - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - - /** - * Handler of /sdrangel/ambe/devices (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceAMBEDevicesDelete( - SWGSDRangel::SWGSuccessResponse& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - /** * Handler of /sdrangel/limerfe/serial (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels * returns the Http status code (default 501: not implemented) @@ -537,22 +461,6 @@ public: return 501; } - /** - * Handler of /sdrangel/limerfe/power (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels - * returns the Http status code (default 501: not implemented) - */ - virtual int instanceLimeRFEPowerGet( - const QString& serial, - SWGSDRangel::SWGLimeRFEPower& response, - SWGSDRangel::SWGErrorResponse& error) - { - (void) serial; - (void) response; - error.init(); - *error.getMessage() = QString("Function not implemented"); - return 501; - } - /** * Handler of /sdrangel/presets (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels * returns the Http status code (default 501: not implemented) @@ -1786,12 +1694,6 @@ public: static QString instanceAudioInputCleanupURL; static QString instanceAudioOutputCleanupURL; static QString instanceLocationURL; - static QString instanceAMBESerialURL; - static QString instanceAMBEDevicesURL; - static QString instanceLimeRFESerialURL; - static QString instanceLimeRFEConfigURL; - static QString instanceLimeRFERunURL; - static QString instanceLimeRFEPowerURL; static QString instancePresetsURL; static QString instancePresetURL; static QString instancePresetFileURL; diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 449870e42..291ccb590 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -33,11 +33,9 @@ #include "SWGInstanceFeaturesResponse.h" #include "SWGAudioDevices.h" #include "SWGLocationInformation.h" -#include "SWGDVSerialDevices.h" #include "SWGAMBEDevices.h" #include "SWGLimeRFEDevices.h" #include "SWGLimeRFESettings.h" -#include "SWGLimeRFEPower.h" #include "SWGPresets.h" #include "SWGPresetTransfer.h" #include "SWGPresetIdentifier.h" @@ -139,18 +137,6 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http instanceAudioOutputCleanupService(request, response); } else if (path == WebAPIAdapterInterface::instanceLocationURL) { instanceLocationService(request, response); - } else if (path == WebAPIAdapterInterface::instanceAMBESerialURL) { - instanceAMBESerialService(request, response); - } else if (path == WebAPIAdapterInterface::instanceAMBEDevicesURL) { - instanceAMBEDevicesService(request, response); - } else if (path == WebAPIAdapterInterface::instanceLimeRFESerialURL) { - instanceLimeRFESerialService(request, response); - } else if (path == WebAPIAdapterInterface::instanceLimeRFEConfigURL) { - instanceLimeRFEConfigService(request, response); - } else if (path == WebAPIAdapterInterface::instanceLimeRFERunURL) { - instanceLimeRFERunService(request, response); - } else if (path == WebAPIAdapterInterface::instanceLimeRFEPowerURL) { - instanceLimeRFEPowerService(request, response); } else if (path == WebAPIAdapterInterface::instancePresetsURL) { instancePresetsService(request, response); } else if (path == WebAPIAdapterInterface::instancePresetURL) { @@ -808,315 +794,6 @@ void WebAPIRequestMapper::instanceLocationService(qtwebapp::HttpRequest& request } } -void WebAPIRequestMapper::instanceAMBESerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "GET") - { - SWGSDRangel::SWGDVSerialDevices normalResponse; - - int status = m_adapter->instanceAMBESerialGet(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - -void WebAPIRequestMapper::instanceAMBEDevicesService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "GET") - { - SWGSDRangel::SWGAMBEDevices normalResponse; - - int status = m_adapter->instanceAMBEDevicesGet(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else if ((request.getMethod() == "PATCH") || (request.getMethod() == "PUT")) - { - SWGSDRangel::SWGAMBEDevices query; - SWGSDRangel::SWGAMBEDevices normalResponse; - QString jsonStr = request.getBody(); - QJsonObject jsonObject; - - if (parseJsonBody(jsonStr, jsonObject, response)) - { - if (validateAMBEDevices(query, jsonObject)) - { - int status; - - if (request.getMethod() == "PATCH") { - status = m_adapter->instanceAMBEDevicesPatch(query, normalResponse, errorResponse); - } else { - status = m_adapter->instanceAMBEDevicesPut(query, normalResponse, errorResponse); - } - - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON request"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON request"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON format"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON format"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else if (request.getMethod() == "DELETE") - { - SWGSDRangel::SWGSuccessResponse normalResponse; - - int status = m_adapter->instanceAMBEDevicesDelete(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - -void WebAPIRequestMapper::instanceLimeRFESerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "GET") - { - SWGSDRangel::SWGLimeRFEDevices normalResponse; - - int status = m_adapter->instanceLimeRFESerialGet(normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - -void WebAPIRequestMapper::instanceLimeRFEConfigService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "GET") - { - QByteArray serialStr = request.getParameter("serial"); - SWGSDRangel::SWGLimeRFESettings normalResponse; - - int status = m_adapter->instanceLimeRFEConfigGet(serialStr, normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else if (request.getMethod() == "PUT") - { - SWGSDRangel::SWGLimeRFESettings query; - SWGSDRangel::SWGSuccessResponse normalResponse; - QString jsonStr = request.getBody(); - QJsonObject jsonObject; - - if (parseJsonBody(jsonStr, jsonObject, response)) - { - QStringList limeRFESettingsKeys; - - if (validateLimeRFEConfig(query, jsonObject, limeRFESettingsKeys)) - { - if (limeRFESettingsKeys.contains("devicePath")) - { - int status = m_adapter->instanceLimeRFEConfigPut(query, normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"LimeRFE device path expected in JSON body"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid request"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON format"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON format"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON format"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON format"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - -void WebAPIRequestMapper::instanceLimeRFERunService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "PUT") - { - SWGSDRangel::SWGLimeRFESettings query; - QString jsonStr = request.getBody(); - QJsonObject jsonObject; - - if (parseJsonBody(jsonStr, jsonObject, response)) - { - QStringList limeRFESettingsKeys; - - if (validateLimeRFEConfig(query, jsonObject, limeRFESettingsKeys)) - { - if (limeRFESettingsKeys.contains("devicePath")) - { - SWGSDRangel::SWGSuccessResponse normalResponse; - int status = m_adapter->instanceLimeRFERunPut(query, normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"LimeRFE device path expected in JSON body"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON format"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON format"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON format"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(400,"Invalid JSON format"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid JSON format"; - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - -void WebAPIRequestMapper::instanceLimeRFEPowerService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) -{ - SWGSDRangel::SWGErrorResponse errorResponse; - response.setHeader("Content-Type", "application/json"); - response.setHeader("Access-Control-Allow-Origin", "*"); - - if (request.getMethod() == "GET") - { - QByteArray serialStr = request.getParameter("serial"); - SWGSDRangel::SWGLimeRFEPower normalResponse; - - int status = m_adapter->instanceLimeRFEPowerGet(serialStr, normalResponse, errorResponse); - response.setStatus(status); - - if (status/100 == 2) { - response.write(normalResponse.asJson().toUtf8()); - } else { - response.write(errorResponse.asJson().toUtf8()); - } - } - else - { - response.setStatus(405,"Invalid HTTP method"); - errorResponse.init(); - *errorResponse.getMessage() = "Invalid HTTP method"; - response.write(errorResponse.asJson().toUtf8()); - } -} - void WebAPIRequestMapper::instancePresetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) { SWGSDRangel::SWGErrorResponse errorResponse; @@ -4263,138 +3940,6 @@ bool WebAPIRequestMapper::validateAudioOutputDevice( return true; } -bool WebAPIRequestMapper::validateAMBEDevices(SWGSDRangel::SWGAMBEDevices& ambeDevices, QJsonObject& jsonObject) -{ - if (jsonObject.contains("nbDevices")) - { - int nbDevices = jsonObject["nbDevices"].toInt(); - - if (jsonObject.contains("ambeDevices")) - { - QJsonArray ambeDevicesJson = jsonObject["ambeDevices"].toArray(); - - if (nbDevices != ambeDevicesJson.size()) { - return false; - } - - ambeDevices.init(); - ambeDevices.setNbDevices(nbDevices); - QList *ambeList = ambeDevices.getAmbeDevices(); - - for (int i = 0; i < nbDevices; i++) - { - QJsonObject ambeDeviceJson = ambeDevicesJson.at(i).toObject(); - if (ambeDeviceJson.contains("deviceRef") && ambeDeviceJson.contains("delete")) - { - ambeList->push_back(new SWGSDRangel::SWGAMBEDevice()); - ambeList->back()->init(); - ambeList->back()->setDeviceRef(new QString(ambeDeviceJson["deviceRef"].toString())); - ambeList->back()->setDelete(ambeDeviceJson["delete"].toInt()); - } - else - { - return false; - } - } - - return true; - } - } - - return false; -} - -bool WebAPIRequestMapper::validateLimeRFEConfig(SWGSDRangel::SWGLimeRFESettings& limeRFESettings, QJsonObject& jsonObject, QStringList& limeRFESettingsKeys) -{ - if (jsonObject.contains("devicePath")) - { - limeRFESettings.setDevicePath(new QString(jsonObject["devicePath"].toString())); - limeRFESettingsKeys.append("devicePath"); - } - if (jsonObject.contains("rxChannels")) - { - limeRFESettings.setRxChannels(jsonObject["rxChannels"].toInt()); - limeRFESettingsKeys.append("rxChannels"); - } - if (jsonObject.contains("rxWidebandChannel")) - { - limeRFESettings.setRxWidebandChannel(jsonObject["rxWidebandChannel"].toInt()); - limeRFESettingsKeys.append("rxWidebandChannel"); - } - if (jsonObject.contains("rxHAMChannel")) - { - limeRFESettings.setRxHamChannel(jsonObject["rxHAMChannel"].toInt()); - limeRFESettingsKeys.append("rxHAMChannel"); - } - if (jsonObject.contains("rxCellularChannel")) - { - limeRFESettings.setRxCellularChannel(jsonObject["rxCellularChannel"].toInt()); - limeRFESettingsKeys.append("rxCellularChannel"); - } - if (jsonObject.contains("rxPort")) - { - limeRFESettings.setRxPort(jsonObject["rxPort"].toInt()); - limeRFESettingsKeys.append("rxPort"); - } - if (jsonObject.contains("attenuationFactor")) - { - limeRFESettings.setAttenuationFactor(jsonObject["attenuationFactor"].toInt()); - limeRFESettingsKeys.append("attenuationFactor"); - } - if (jsonObject.contains("amfmNotch")) - { - limeRFESettings.setAmfmNotch(jsonObject["amfmNotch"].toInt()); - limeRFESettingsKeys.append("amfmNotch"); - } - if (jsonObject.contains("txChannels")) - { - limeRFESettings.setTxChannels(jsonObject["txChannels"].toInt()); - limeRFESettingsKeys.append("txChannels"); - } - if (jsonObject.contains("txWidebandChannel")) - { - limeRFESettings.setTxWidebandChannel(jsonObject["txWidebandChannel"].toInt()); - limeRFESettingsKeys.append("txWidebandChannel"); - } - if (jsonObject.contains("txHAMChannel")) - { - limeRFESettings.setTxHamChannel(jsonObject["txHAMChannel"].toInt()); - limeRFESettingsKeys.append("txHAMChannel"); - } - if (jsonObject.contains("txCellularChannel")) - { - limeRFESettings.setTxCellularChannel(jsonObject["txCellularChannel"].toInt()); - limeRFESettingsKeys.append("txCellularChannel"); - } - if (jsonObject.contains("txPort")) - { - limeRFESettings.setTxPort(jsonObject["txPort"].toInt()); - limeRFESettingsKeys.append("txPort"); - } - if (jsonObject.contains("rxOn")) - { - limeRFESettings.setRxOn(jsonObject["rxOn"].toInt()); - limeRFESettingsKeys.append("rxOn"); - } - if (jsonObject.contains("txOn")) - { - limeRFESettings.setTxOn(jsonObject["txOn"].toInt()); - limeRFESettingsKeys.append("txOn"); - } - if (jsonObject.contains("swrEnable")) - { - limeRFESettings.setSwrEnable(jsonObject["swrEnable"].toInt()); - limeRFESettingsKeys.append("swrEnable"); - } - if (jsonObject.contains("swrSource")) - { - limeRFESettings.setSwrSource(jsonObject["swrSource"].toInt()); - limeRFESettingsKeys.append("swrSource"); - } - - return true; -} - bool WebAPIRequestMapper::validateSpectrumSettings(SWGSDRangel::SWGGLSpectrum& spectrumSettings, QJsonObject& jsonObject, QStringList& spectrumSettingsKeys) { extractKeys(jsonObject, spectrumSettingsKeys); @@ -5597,11 +5142,21 @@ bool WebAPIRequestMapper::getFeatureActions( featureActions->setAfcActions(new SWGSDRangel::SWGAFCActions()); featureActions->getAfcActions()->fromJsonObject(actionsJsonObject); } + else if (featureActionsKey == "AMBEActions") + { + featureActions->setAmbeActions(new SWGSDRangel::SWGAMBEActions()); + featureActions->getAmbeActions()->fromJsonObject(actionsJsonObject); + } else if (featureActionsKey == "GS232ControllerActions") { featureActions->setGs232ControllerActions(new SWGSDRangel::SWGGS232ControllerActions()); featureActions->getGs232ControllerActions()->fromJsonObject(actionsJsonObject); } + else if (featureActionsKey == "LimeRFEActions") + { + featureActions->setLimeRfeActions(new SWGSDRangel::SWGLimeRFEActions()); + featureActions->getLimeRfeActions()->fromJsonObject(actionsJsonObject); + } else if (featureActionsKey == "MapActions") { featureActions->setMapActions(new SWGSDRangel::SWGMapActions()); diff --git a/sdrbase/webapi/webapirequestmapper.h b/sdrbase/webapi/webapirequestmapper.h index 048d4a02b..5c7f0dec8 100644 --- a/sdrbase/webapi/webapirequestmapper.h +++ b/sdrbase/webapi/webapirequestmapper.h @@ -66,13 +66,6 @@ private: void instanceAudioInputCleanupService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceAudioOutputCleanupService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceLocationService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceDVSerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceAMBESerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceAMBEDevicesService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceLimeRFESerialService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceLimeRFEConfigService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceLimeRFERunService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); - void instanceLimeRFEPowerService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetFileService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); @@ -130,8 +123,6 @@ private: bool validateFeatureActions(SWGSDRangel::SWGFeatureActions& featureActions, QJsonObject& jsonObject, QStringList& featureActionsKeys); bool validateAudioInputDevice(SWGSDRangel::SWGAudioInputDevice& audioInputDevice, QJsonObject& jsonObject, QStringList& audioInputDeviceKeys); bool validateAudioOutputDevice(SWGSDRangel::SWGAudioOutputDevice& audioOutputDevice, QJsonObject& jsonObject, QStringList& audioOutputDeviceKeys); - bool validateAMBEDevices(SWGSDRangel::SWGAMBEDevices& ambeDevices, QJsonObject& jsonObject); - bool validateLimeRFEConfig(SWGSDRangel::SWGLimeRFESettings& limeRFESettings, QJsonObject& jsonObject, QStringList& limeRFESettingsKeys); bool validateConfig(SWGSDRangel::SWGInstanceConfigResponse& config, QJsonObject& jsonObject, WebAPIAdapterInterface::ConfigKeys& configKeys); bool validateWorkspaceInfo(SWGSDRangel::SWGWorkspaceInfo& workspaceInfo, QJsonObject& jsonObject); bool validateConfigurationIdentifier(SWGSDRangel::SWGConfigurationIdentifier& configurationIdentifier); diff --git a/sdrbase/webapi/webapiutils.cpp b/sdrbase/webapi/webapiutils.cpp index 21398951c..8708cf012 100644 --- a/sdrbase/webapi/webapiutils.cpp +++ b/sdrbase/webapi/webapiutils.cpp @@ -270,11 +270,13 @@ const QMap WebAPIUtils::m_mimoDeviceHwIdToActionsKey = { const QMap WebAPIUtils::m_featureTypeToSettingsKey = { {"AFC", "AFCSettings"}, {"AIS", "AISSettings"}, + {"AMBE", "AMBESettings"}, {"AntennaTools", "AntennaToolsSettings"}, {"APRS", "APRSSettings"}, {"DemodAnalyzer", "DemodAnalyzerSettings"}, {"JogdialController", "JogdialControllerSettings"}, {"GS232Controller", "GS232ControllerSettings"}, // a.k.a Rotator Controller + {"LimeRFE", "LimeRFESettings"}, {"Map", "MapSettings"}, {"PERTester", "PERTesterSettings"}, {"Radiosonde", "RadiosondeSettings"}, @@ -287,7 +289,9 @@ const QMap WebAPIUtils::m_featureTypeToSettingsKey = { const QMap WebAPIUtils::m_featureTypeToActionsKey = { {"AFC", "AFCActions"}, + {"AMBE", "AMBEActions"}, {"GS232Controller", "GS232ControllerActions"}, + {"LimeRFE", "LimeRFEActions"}, {"Map", "MapActions"}, {"PERTester", "PERTesterActions"}, {"RigCtlServer", "RigCtlServerActions"}, @@ -300,11 +304,13 @@ const QMap WebAPIUtils::m_featureTypeToActionsKey = { const QMap WebAPIUtils::m_featureURIToSettingsKey = { {"sdrangel.feature.afc", "AFCSettings"}, {"sdrangel.feature.ais", "AISSSettings"}, + {"sdrangel.feature.ambe", "AMBESSettings"}, {"sdrangel.feature.antennatools", "AntennaToolsSettings"}, {"sdrangel.feature.aprs", "APRSSettings"}, {"sdrangel.feature.demodanalyzer", "DemodAnalyzerSettings"}, {"sdrangel.feature.jogdialcontroller", "JogdialControllerSettings"}, {"sdrangel.feature.gs232controller", "GS232ControllerSettings"}, + {"sdrangel.feature.limerfe", "LimeRFESettings"}, {"sdrangel.feature.map", "MapSettings"}, {"sdrangel.feature.pertester", "PERTesterSettings"}, {"sdrangel.feature.radiosonde", "RadiosondeSettings"}, diff --git a/sdrbench/mainbench.cpp b/sdrbench/mainbench.cpp index cb31eb8a3..624d3fcba 100644 --- a/sdrbench/mainbench.cpp +++ b/sdrbench/mainbench.cpp @@ -20,8 +20,6 @@ #include #include -#include "ambe/ambeengine.h" - #include "mainbench.h" MainBench *MainBench::m_instance = 0; @@ -62,8 +60,6 @@ void MainBench::run() testDecimateFI(); } else if (m_parser.getTestType() == ParserBench::TestDecimatorsFF) { testDecimateFF(); - } else if (m_parser.getTestType() == ParserBench::TestAMBE) { - testAMBE(); } else if (m_parser.getTestType() == ParserBench::TestGolay2312) { testGolay2312(); } else { @@ -197,19 +193,6 @@ void MainBench::testDecimateFF() delete[] buf; } -void MainBench::testAMBE() -{ - qDebug() << "MainBench::testAMBE"; - AMBEEngine ambeEngine; - std::vector ambeDevices; - ambeEngine.scan(ambeDevices); - - for (std::vector::const_iterator it = ambeDevices.begin(); it != ambeDevices.end(); ++it) { - qDebug("MainBench::testAMBE: detected AMBE device %s", qPrintable(*it)); - } -} - - void MainBench::decimateII(const qint16* buf, int len) { SampleVector::iterator it = m_convertBuffer.begin(); diff --git a/sdrbench/mainbench.h b/sdrbench/mainbench.h index 397ee6319..8992ecc2c 100644 --- a/sdrbench/mainbench.h +++ b/sdrbench/mainbench.h @@ -53,7 +53,6 @@ private: void testDecimateIF(); void testDecimateFI(); void testDecimateFF(); - void testAMBE(); void testGolay2312(); void decimateII(const qint16 *buf, int len); void decimateInfII(const qint16 *buf, int len); diff --git a/sdrbench/parserbench.cpp b/sdrbench/parserbench.cpp index 7602a6904..a03fa749e 100644 --- a/sdrbench/parserbench.cpp +++ b/sdrbench/parserbench.cpp @@ -125,8 +125,6 @@ ParserBench::TestType ParserBench::getTestType() const return TestDecimatorsInfII; } else if (m_testStr == "decimatesupii") { return TestDecimatorsSupII; - } else if (m_testStr == "ambe") { - return TestAMBE; } else if (m_testStr == "golay2312") { return TestGolay2312; } else { diff --git a/sdrbench/parserbench.h b/sdrbench/parserbench.h index 9dce1cfdd..50b455c27 100644 --- a/sdrbench/parserbench.h +++ b/sdrbench/parserbench.h @@ -35,7 +35,6 @@ public: TestDecimatorsFF, TestDecimatorsInfII, TestDecimatorsSupII, - TestAMBE, TestGolay2312 } TestType; diff --git a/sdrgui/CMakeLists.txt b/sdrgui/CMakeLists.txt index 086def148..5f6d97ffa 100644 --- a/sdrgui/CMakeLists.txt +++ b/sdrgui/CMakeLists.txt @@ -8,7 +8,6 @@ set(sdrgui_SOURCES mainwindow.cpp gui/aboutdialog.cpp gui/addpresetdialog.cpp - gui/ambedevicesdialog.cpp gui/audiodialog.cpp gui/audioselectdialog.cpp gui/basicchannelsettingsdialog.cpp @@ -108,7 +107,6 @@ set(sdrgui_HEADERS mainwindow.h gui/aboutdialog.h gui/addpresetdialog.h - gui/ambedevicesdialog.h gui/audiodialog.h gui/audioselectdialog.h gui/basicchannelsettingsdialog.h @@ -207,7 +205,6 @@ set(sdrgui_FORMS # mainwindow.ui gui/aboutdialog.ui gui/addpresetdialog.ui - gui/ambedevicesdialog.ui gui/basicchannelsettingsdialog.ui gui/basicdevicesettingsdialog.ui gui/basicfeaturesettingsdialog.ui @@ -246,23 +243,6 @@ set(sdrgui_FORMS soapygui/arginfogui.ui ) -if (LIMESUITE_FOUND) - set(sdrgui_SOURCES - ${sdrgui_SOURCES} - limerfegui/limerfeusbdialog.cpp - ) - set(sdrgui_HEADERS - ${sdrgui_HEADERS} - limerfegui/limerfeusbdialog.h - ) - set(sdrgui_FORMS - ${sdrgui_FORMS} - limerfegui/limerfeusbdialog.ui - ) - include_directories(${LIMESUITE_INCLUDE_DIR}) - set(sdrgui_LIMERFE_LIB ${LIMESUITE_LIBRARY}) -endif (LIMESUITE_FOUND) - qt5_wrap_ui(sdrgui_FORMS_HEADERS ${sdrgui_FORMS}) include_directories( diff --git a/sdrgui/gui/ambedevicesdialog.cpp b/sdrgui/gui/ambedevicesdialog.cpp deleted file mode 100644 index 3c8195a61..000000000 --- a/sdrgui/gui/ambedevicesdialog.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 F4EXB // -// written by Edouard Griffiths // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include -#include - -#include "ambedevicesdialog.h" -#include "ui_ambedevicesdialog.h" - -AMBEDevicesDialog::AMBEDevicesDialog(AMBEEngine* ambeEngine, QWidget* parent) : - QDialog(parent), - ui(new Ui::AMBEDevicesDialog), - m_ambeEngine(ambeEngine) -{ - ui->setupUi(this); - populateSerialList(); - refreshInUseList(); -} - -AMBEDevicesDialog::~AMBEDevicesDialog() -{ - delete ui; -} - -void AMBEDevicesDialog::populateSerialList() -{ - std::vector ambeSerialDevices; - m_ambeEngine->scan(ambeSerialDevices); - ui->ambeSerialDevices->clear(); - std::vector::const_iterator it = ambeSerialDevices.begin(); - - for (; it != ambeSerialDevices.end(); ++it) - { - ui->ambeSerialDevices->addItem(QString(*it)); - } -} - -void AMBEDevicesDialog::refreshInUseList() -{ - std::vector inUseDevices; - m_ambeEngine->getDeviceRefs(inUseDevices); - ui->ambeDeviceRefs->clear(); - std::vector::const_iterator it = inUseDevices.begin(); - - for (; it != inUseDevices.end(); ++it) - { - qDebug("AMBEDevicesDialog::refreshInUseList: %s", qPrintable(*it)); - ui->ambeDeviceRefs->addItem(*it); - } -} - -void AMBEDevicesDialog::on_importSerial_clicked() -{ - QListWidgetItem *serialItem = ui->ambeSerialDevices->currentItem(); - - if (!serialItem) - { - ui->statusText->setText("No selection"); - return; - } - - QString serialName = serialItem->text(); - QList foundItems = ui->ambeDeviceRefs->findItems(serialName, Qt::MatchFixedString|Qt::MatchCaseSensitive); - - if (foundItems.size() == 0) - { - if (m_ambeEngine->registerController(serialName.toStdString())) - { - ui->ambeDeviceRefs->addItem(serialName); - ui->statusText->setText(tr("%1 added").arg(serialName)); - } - else - { - ui->statusText->setText(tr("Cannot open %1").arg(serialName)); - } - } - else - { - ui->statusText->setText("Device already in use"); - } -} - -void AMBEDevicesDialog::on_importAllSerial_clicked() -{ - int count = 0; - - for (int i = 0; i < ui->ambeSerialDevices->count(); i++) - { - const QListWidgetItem *serialItem = ui->ambeSerialDevices->item(i); - QString serialName = serialItem->text(); - QList foundItems = ui->ambeDeviceRefs->findItems(serialName, Qt::MatchFixedString|Qt::MatchCaseSensitive); - - if (foundItems.size() == 0) - { - if (m_ambeEngine->registerController(serialName.toStdString())) - { - ui->ambeDeviceRefs->addItem(serialName); - count++; - } - } - } - - ui->statusText->setText(tr("%1 devices added").arg(count)); -} - -void AMBEDevicesDialog::on_removeAmbeDevice_clicked() -{ - QListWidgetItem *deviceItem = ui->ambeDeviceRefs->currentItem(); - - if (!deviceItem) - { - ui->statusText->setText("No selection"); - return; - } - - QString deviceName = deviceItem->text(); - m_ambeEngine->releaseController(deviceName.toStdString()); - ui->statusText->setText(tr("%1 removed").arg(deviceName)); - refreshInUseList(); -} - -void AMBEDevicesDialog::on_refreshAmbeList_clicked() -{ - refreshInUseList(); - ui->statusText->setText("In use refreshed"); -} - -void AMBEDevicesDialog::on_clearAmbeList_clicked() -{ - if (ui->ambeDeviceRefs->count() == 0) - { - ui->statusText->setText("No active items"); - return; - } - - m_ambeEngine->releaseAll(); - ui->ambeDeviceRefs->clear(); - ui->statusText->setText("All items released"); -} - -void AMBEDevicesDialog::on_importAddress_clicked() -{ - QString addressAndPort = ui->ambeAddressText->text(); - - QList foundItems = ui->ambeDeviceRefs->findItems(addressAndPort, Qt::MatchFixedString|Qt::MatchCaseSensitive); - - if (foundItems.size() == 0) - { - if (m_ambeEngine->registerController(addressAndPort.toStdString())) - { - ui->ambeDeviceRefs->addItem(addressAndPort); - ui->statusText->setText(tr("%1 added").arg(addressAndPort)); - } - else - { - ui->statusText->setText(tr("Cannot open %1").arg(addressAndPort)); - } - } - else - { - ui->statusText->setText("Address already in use"); - } -} diff --git a/sdrgui/gui/ambedevicesdialog.ui b/sdrgui/gui/ambedevicesdialog.ui deleted file mode 100644 index f1e34d493..000000000 --- a/sdrgui/gui/ambedevicesdialog.ui +++ /dev/null @@ -1,284 +0,0 @@ - - - AMBEDevicesDialog - - - - 0 - 0 - 401 - 450 - - - - AMBE devices control - - - - - 310 - 410 - 81 - 32 - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - 10 - 280 - 181 - 121 - - - - List of available AMBE serial devices available - - - - - - 10 - 90 - 381 - 151 - - - - List of devices/servers in use - - - - - - 10 - 260 - 101 - 17 - - - - Serial devices - - - - - - 10 - 10 - 381 - 17 - - - - AMBE server IP and port or direct input - - - - - - 10 - 30 - 381 - 25 - - - - AMBE server address as ip:port or direct input - - - - - - - - - 310 - 60 - 28 - 24 - - - - Refresh list of devices and servers in use - - - - - - - :/recycle.png:/recycle.png - - - - - - 280 - 60 - 24 - 23 - - - - Release all devices and servers - - - - - - - :/bin.png:/bin.png - - - - - - 10 - 70 - 91 - 17 - - - - In use - - - - - - 120 - 250 - 24 - 23 - - - - Use serial device - - - - - - - :/arrow_up.png:/arrow_up.png - - - - - - 120 - 60 - 24 - 23 - - - - Use server - - - - - - - :/arrow_down.png:/arrow_down.png - - - - - - 360 - 60 - 28 - 24 - - - - Remove all devices - - - - - - - :/sweep.png:/sweep.png - - - - - - 10 - 420 - 291 - 19 - - - - ... - - - - - - 150 - 250 - 24 - 23 - - - - Use all serial devices - - - - - - - :/double_arrow_up.png:/double_arrow_up.png - - - - - - - - - buttonBox - accepted() - AMBEDevicesDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - AMBEDevicesDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/sdrgui/limerfegui/limerfeusbdialog.cpp b/sdrgui/limerfegui/limerfeusbdialog.cpp deleted file mode 100644 index 8ba429a22..000000000 --- a/sdrgui/limerfegui/limerfeusbdialog.cpp +++ /dev/null @@ -1,881 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 F4EXB // -// written by Edouard Griffiths // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include -#include "util/serialutil.h" -#include "util/db.h" -#include "dsp/dspengine.h" -#include "dsp/dspdevicesourceengine.h" -#include "dsp/dspdevicesinkengine.h" -#include "mainwindow.h" -#include "device/deviceuiset.h" -#include "gui/doublevalidator.h" - -#include "limerfeusbdialog.h" -#include "ui_limerfeusbdialog.h" - -LimeRFEUSBDialog::LimeRFEUSBDialog(LimeRFEUSBCalib& limeRFEUSBCalib, MainWindow* mainWindow) : - QDialog(mainWindow), - ui(new Ui::LimeRFEUSBDialog), - m_limeRFEUSBCalib(limeRFEUSBCalib), - m_rxTxToggle(false), - m_currentPowerCorrection(0.0), - m_avgPower(false), - m_deviceSetSync(false) -{ - ui->setupUi(this); - m_mainWindow = mainWindow; - ui->powerCorrValue->setValidator(new DoubleValidator(-99.9, 99.9, 1, ui->powerCorrValue)); - std::vector comPorts; - SerialUtil::getComPorts(comPorts, "ttyUSB[0-9]+"); // regex is for Linux only - - for (std::vector::const_iterator it = comPorts.begin(); it != comPorts.end(); ++it) { - ui->device->addItem(QString(it->c_str())); - } - - updateDeviceSetList(); - displaySettings(); // default values - highlightApplyButton(false); - m_timer.setInterval(500); -} - -LimeRFEUSBDialog::~LimeRFEUSBDialog() -{ - delete ui; -} - -void LimeRFEUSBDialog::displaySettings() -{ - setRxChannels(); - ui->rxPort->setCurrentIndex(m_settings.m_rxPort); - ui->attenuation->setCurrentIndex(m_settings.m_attenuationFactor); - ui->amFmNotchFilter->setChecked(m_settings.m_amfmNotch); - setTxChannels(); - ui->txPort->setCurrentIndex(m_settings.m_txPort); - ui->txFollowsRx->setChecked(m_settings.m_txRxDriven); - ui->rxTxToggle->setChecked(m_rxTxToggle); - displayMode(); - displayPower(); -} - -void LimeRFEUSBDialog::displayMode() -{ - QString s; - - if (m_settings.m_rxOn) - { - if (m_settings.m_txOn) { - s = "Rx/Tx"; - } else { - s = "Rx"; - } - } - else - { - if (m_settings.m_txOn) { - s = "Tx"; - } else { - s = "None"; - } - } - - ui->modeText->setText(s); - - ui->modeRx->blockSignals(true); - ui->modeTx->blockSignals(true); - - if (m_settings.m_rxOn) { - ui->modeRx->setStyleSheet("QToolButton { background-color : green; }"); - } else { - ui->modeRx->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); - } - - if (m_settings.m_txOn) { - ui->modeTx->setStyleSheet("QToolButton { background-color : red; }"); - } else { - ui->modeTx->setStyleSheet("QToolButton { background:rgb(79,79,79); }"); - } - - ui->modeRx->setChecked(m_settings.m_rxOn); - ui->modeTx->setChecked(m_settings.m_txOn); - - ui->modeRx->blockSignals(false); - ui->modeTx->blockSignals(false); -} - -void LimeRFEUSBDialog::displayPower() -{ - ui->powerEnable->blockSignals(true); - ui->powerSource->blockSignals(true); - - ui->powerEnable->setChecked(m_settings.m_swrEnable); - ui->powerSource->setCurrentIndex((int) m_settings.m_swrSource); - - ui->powerEnable->blockSignals(false); - ui->powerSource->blockSignals(false); -} - -void LimeRFEUSBDialog::refreshPower() -{ - int fwdPower, refPower; - int rc = m_controller.getFwdPower(fwdPower); - - if (rc != 0) - { - ui->statusText->setText(m_controller.getError(rc).c_str()); - return; - } - - rc = m_controller.getRefPower(refPower); - - if (rc != 0) - { - ui->statusText->setText(m_controller.getError(rc).c_str()); - return; - } - - double fwdPowerDB = fwdPower / 10.0; - double refPowerDB = refPower / 10.0; - double retLossDB = fwdPowerDB - refPowerDB; - - ui->powerFwdText->setText(QString::number(fwdPowerDB, 'f', 1)); - ui->powerRefText->setText(QString::number(refPowerDB, 'f', 1)); - ui->returnLossText->setText(QString::number(retLossDB, 'f', 1)); - - double denom = CalcDb::powerFromdB(retLossDB/2.0) - 1.0; - - if (denom == 0.0) - { - ui->swrText->setText("---"); - } - else - { - double vswr = (CalcDb::powerFromdB(retLossDB/2.0) + 1.0) / denom; - vswr = vswr < 0.0 ? 0.0 : vswr > 99.999 ? 99.999 : vswr; - ui->swrText->setText(QString::number(vswr, 'f', 3)); - } - - updateAbsPower(m_currentPowerCorrection); -} - -void LimeRFEUSBDialog::setRxChannels() -{ - ui->rxChannel->blockSignals(true); - ui->rxPort->blockSignals(true); - ui->rxChannel->clear(); - ui->rxPort->clear(); - - if (m_settings.m_rxChannels == LimeRFEController::ChannelsWideband) - { - ui->rxChannel->addItem("1-1000MHz"); - ui->rxChannel->addItem("1-4GHz"); - ui->rxChannel->setCurrentIndex((int) m_settings.m_rxWidebandChannel); - ui->rxPort->addItem("TX/RX (J3)"); - ui->rxPort->addItem("TX/RX 30M (J5)"); - ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); - ui->txFollowsRx->setEnabled(true); - ui->rxPort->setEnabled(true); - } - else if (m_settings.m_rxChannels == LimeRFEController::ChannelsHAM) - { - ui->rxChannel->addItem("<30MHz"); - ui->rxChannel->addItem("50-70MHz"); - ui->rxChannel->addItem("144-146MHz"); - ui->rxChannel->addItem("220-225MHz"); - ui->rxChannel->addItem("430-440MHz"); - ui->rxChannel->addItem("902-928MHz"); - ui->rxChannel->addItem("1240-1325MHz"); - ui->rxChannel->addItem("2300-2450MHz"); - ui->rxChannel->addItem("3300-3500MHz"); - ui->rxChannel->setCurrentIndex((int) m_settings.m_rxHAMChannel); - ui->txFollowsRx->setEnabled(true); - - switch(m_settings.m_rxHAMChannel) - { - case LimeRFEController::HAM_30M: - case LimeRFEController::HAM_50_70MHz: - case LimeRFEController::HAM_144_146MHz: - case LimeRFEController::HAM_220_225MHz: - case LimeRFEController::HAM_430_440MHz: - ui->rxPort->addItem("TX/RX (J3)"); - ui->rxPort->addItem("TX/RX 30M (J5)"); - ui->rxPort->setEnabled(true); - ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); - break; - case LimeRFEController::HAM_902_928MHz: - case LimeRFEController::HAM_1240_1325MHz: - case LimeRFEController::HAM_2300_2450MHz: - case LimeRFEController::HAM_3300_3500MHz: - ui->rxPort->addItem("TX/RX (J3)"); - ui->rxPort->setEnabled(false); - m_settings.m_rxPort = LimeRFEController::RxPortJ3; - ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); - break; - default: - break; - } - } - else if (m_settings.m_rxChannels == LimeRFEController::ChannelsCellular) - { - ui->rxChannel->addItem("Band1"); - ui->rxChannel->addItem("Band2"); - ui->rxChannel->addItem("Band3"); - ui->rxChannel->addItem("Band7"); - ui->rxChannel->addItem("Band38"); - ui->rxChannel->setCurrentIndex((int) m_settings.m_rxCellularChannel); - ui->rxPort->addItem("TX/RX (J3)"); - ui->rxPort->setEnabled(false); - m_settings.m_rxPort = LimeRFEController::RxPortJ3; - ui->rxPort->setCurrentIndex((int) m_settings.m_rxPort); - m_settings.m_txRxDriven = true; - ui->txFollowsRx->setEnabled(false); - ui->txFollowsRx->setChecked(m_settings.m_txRxDriven); - } - - ui->rxChannelGroup->setCurrentIndex((int) m_settings.m_rxChannels); - ui->rxPort->blockSignals(false); - ui->rxChannel->blockSignals(false); -} - -void LimeRFEUSBDialog::setTxChannels() -{ - ui->txChannel->blockSignals(true); - ui->txPort->blockSignals(true); - ui->powerCorrValue->blockSignals(true); - - ui->txChannel->clear(); - ui->txPort->clear(); - - if (m_settings.m_txChannels == LimeRFEController::ChannelsWideband) - { - ui->txChannel->addItem("1-1000MHz"); - ui->txChannel->addItem("1-4GHz"); - ui->txChannel->setCurrentIndex((int) m_settings.m_txWidebandChannel); - ui->txPort->addItem("TX/RX (J3)"); - ui->txPort->addItem("TX (J4)"); - ui->txPort->setCurrentIndex((int) m_settings.m_txPort); - ui->txPort->setEnabled(true); - } - else if (m_settings.m_txChannels == LimeRFEController::ChannelsHAM) - { - ui->txChannel->addItem("<30MHz"); - ui->txChannel->addItem("50-70MHz"); - ui->txChannel->addItem("144-146MHz"); - ui->txChannel->addItem("220-225MHz"); - ui->txChannel->addItem("430-440MHz"); - ui->txChannel->addItem("902-928MHz"); - ui->txChannel->addItem("1240-1325MHz"); - ui->txChannel->addItem("2300-2450MHz"); - ui->txChannel->addItem("3300-3500MHz"); - ui->txChannel->setCurrentIndex((int) m_settings.m_txHAMChannel); - - switch(m_settings.m_txHAMChannel) - { - case LimeRFEController::HAM_30M: - case LimeRFEController::HAM_50_70MHz: - ui->txPort->addItem("TX/RX (J3)"); - ui->txPort->addItem("TX (J4)"); - ui->txPort->addItem("TX/RX 30M (J5)"); - ui->txPort->setEnabled(false); - m_settings.m_txPort = LimeRFEController::TxPortJ5; - ui->txPort->setCurrentIndex((int) m_settings.m_txPort); - break; - case LimeRFEController::HAM_144_146MHz: - case LimeRFEController::HAM_220_225MHz: - case LimeRFEController::HAM_430_440MHz: - case LimeRFEController::HAM_902_928MHz: - case LimeRFEController::HAM_1240_1325MHz: - case LimeRFEController::HAM_2300_2450MHz: - case LimeRFEController::HAM_3300_3500MHz: - ui->txPort->addItem("TX/RX (J3)"); - ui->txPort->addItem("TX (J4)"); - ui->txPort->setCurrentIndex(m_settings.m_txPort < 2 ? m_settings.m_txPort : 1); - ui->txPort->setEnabled(true); - break; - default: - break; - } - } - else if (m_settings.m_txChannels == LimeRFEController::ChannelsCellular) - { - ui->txChannel->addItem("Band1"); - ui->txChannel->addItem("Band2"); - ui->txChannel->addItem("Band3"); - ui->txChannel->addItem("Band7"); - ui->txChannel->addItem("Band38"); - ui->txChannel->setCurrentIndex((int) m_settings.m_txCellularChannel); - ui->txPort->addItem("TX/RX (J3)"); - m_settings.m_txPort = LimeRFEController::TxPortJ3; - ui->txPort->setEnabled(false); - ui->txPort->setCurrentIndex((int) m_settings.m_txPort); - } - - ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels); - m_currentPowerCorrection = getPowerCorrection(); - ui->powerCorrValue->setText(QString::number(m_currentPowerCorrection, 'f', 1)); - updateAbsPower(m_currentPowerCorrection); - - ui->powerCorrValue->blockSignals(false); - ui->txPort->blockSignals(false); - ui->txChannel->blockSignals(false); -} - -int LimeRFEUSBDialog::getPowerCorectionIndex() -{ - LimeRFEUSBCalib::ChannelRange range; - - switch (m_settings.m_txChannels) - { - case LimeRFEController::ChannelsWideband: - { - switch (m_settings.m_txWidebandChannel) - { - case LimeRFEController::WidebandLow: - range = LimeRFEUSBCalib::WidebandLow; - break; - case LimeRFEController::WidebandHigh: - range = LimeRFEUSBCalib::WidebandHigh; - break; - default: - return -1; - break; - } - break; - } - case LimeRFEController::ChannelsHAM: - { - switch (m_settings.m_txHAMChannel) - { - case LimeRFEController::HAM_30M: - range = LimeRFEUSBCalib::HAM_30MHz; - break; - case LimeRFEController::HAM_50_70MHz: - range = LimeRFEUSBCalib::HAM_50_70MHz; - break; - case LimeRFEController::HAM_144_146MHz: - range = LimeRFEUSBCalib::HAM_144_146MHz; - break; - case LimeRFEController::HAM_220_225MHz: - range = LimeRFEUSBCalib::HAM_220_225MHz; - break; - case LimeRFEController::HAM_430_440MHz: - range = LimeRFEUSBCalib::HAM_430_440MHz; - break; - case LimeRFEController::HAM_902_928MHz: - range = LimeRFEUSBCalib::HAM_902_928MHz; - break; - case LimeRFEController::HAM_1240_1325MHz: - range = LimeRFEUSBCalib::HAM_1240_1325MHz; - break; - case LimeRFEController::HAM_2300_2450MHz: - range = LimeRFEUSBCalib::HAM_2300_2450MHz; - break; - case LimeRFEController::HAM_3300_3500MHz: - range = LimeRFEUSBCalib::HAM_3300_3500MHz; - break; - default: - return -1; - break; - } - break; - } - case LimeRFEController::ChannelsCellular: - { - switch (m_settings.m_txCellularChannel) - { - case LimeRFEController::CellularBand1: - range = LimeRFEUSBCalib::CellularBand1; - break; - case LimeRFEController::CellularBand2: - range = LimeRFEUSBCalib::CellularBand2; - break; - case LimeRFEController::CellularBand3: - range = LimeRFEUSBCalib::CellularBand3; - break; - case LimeRFEController::CellularBand7: - range = LimeRFEUSBCalib::CellularBand7; - break; - case LimeRFEController::CellularBand38: - range = LimeRFEUSBCalib::CellularBand38; - break; - default: - return -1; - break; - } - break; - } - default: - return -1; - break; - } - - return (int) range; -} - -double LimeRFEUSBDialog::getPowerCorrection() -{ - int index = getPowerCorectionIndex(); - - QMap::const_iterator it = m_limeRFEUSBCalib.m_calibrations.find(index); - - if (it != m_limeRFEUSBCalib.m_calibrations.end()) { - return it.value(); - } else { - return 0.0; - } -} - -void LimeRFEUSBDialog::setPowerCorrection(double dbValue) -{ - int index = getPowerCorectionIndex(); - - if (index < 0) { - return; - } - - m_limeRFEUSBCalib.m_calibrations[index] = dbValue; -} - -void LimeRFEUSBDialog::on_openDevice_clicked() -{ - int rc = m_controller.openDevice(ui->device->currentText().toStdString()); - ui->statusText->append(QString("Open %1: %2").arg(ui->device->currentText()).arg(m_controller.getError(rc).c_str())); - - if (rc != 0) { - return; - } - - rc = m_controller.getState(); - ui->statusText->append(QString("Get state: %1").arg(m_controller.getError(rc).c_str())); -} - -void LimeRFEUSBDialog::on_closeDevice_clicked() -{ - ui->statusText->clear(); - m_controller.closeDevice(); - ui->statusText->setText("Closed"); -} - -void LimeRFEUSBDialog::on_deviceToGUI_clicked() -{ - int rc = m_controller.getState(); - - if (rc != 0) - { - ui->statusText->setText(m_controller.getError(rc).c_str()); - return; - } - - m_controller.stateToSettings(m_settings); - displaySettings(); - highlightApplyButton(false); -} - -void LimeRFEUSBDialog::on_rxChannelGroup_currentIndexChanged(int index) -{ - m_settings.m_rxChannels = (LimeRFEController::ChannelGroups) index; - setRxChannels(); - - if (m_settings.m_txRxDriven) - { - m_settings.m_txChannels = m_settings.m_rxChannels; - ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels); - } - - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_rxChannel_currentIndexChanged(int index) -{ - if (m_settings.m_rxChannels == LimeRFEController::ChannelsWideband) { - m_settings.m_rxWidebandChannel = (LimeRFEController::WidebandChannel) index; - } else if (m_settings.m_rxChannels == LimeRFEController::ChannelsHAM) { - m_settings.m_rxHAMChannel = (LimeRFEController::HAMChannel) index; - } else if (m_settings.m_rxChannels == LimeRFEController::ChannelsCellular) { - m_settings.m_rxCellularChannel = (LimeRFEController::CellularChannel) index; - } - - setRxChannels(); - - if (m_settings.m_txRxDriven) - { - m_settings.m_txWidebandChannel = m_settings.m_rxWidebandChannel; - m_settings.m_txHAMChannel = m_settings.m_rxHAMChannel; - m_settings.m_txCellularChannel = m_settings.m_rxCellularChannel; - setTxChannels(); - } - - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_rxPort_currentIndexChanged(int index) -{ - m_settings.m_rxPort = (LimeRFEController::RxPort) index; - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_txFollowsRx_clicked() -{ - bool checked = ui->txFollowsRx->isChecked(); - m_settings.m_txRxDriven = checked; - ui->txChannelGroup->setEnabled(!checked); - ui->txChannel->setEnabled(!checked); - m_settings.m_txChannels = m_settings.m_rxChannels; - m_settings.m_txWidebandChannel = m_settings.m_rxWidebandChannel; - m_settings.m_txHAMChannel = m_settings.m_rxHAMChannel; - m_settings.m_txCellularChannel = m_settings.m_rxCellularChannel; - ui->txChannelGroup->setCurrentIndex((int) m_settings.m_txChannels); - - if (checked) { - highlightApplyButton(true); - } -} - -void LimeRFEUSBDialog::on_txChannelGroup_currentIndexChanged(int index) -{ - m_settings.m_txChannels = (LimeRFEController::ChannelGroups) index; - setTxChannels(); - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_txChannel_currentIndexChanged(int index) -{ - if (m_settings.m_txChannels == LimeRFEController::ChannelsWideband) { - m_settings.m_txWidebandChannel = (LimeRFEController::WidebandChannel) index; - } else if (m_settings.m_txChannels == LimeRFEController::ChannelsHAM) { - m_settings.m_txHAMChannel = (LimeRFEController::HAMChannel) index; - } else if (m_settings.m_txChannels == LimeRFEController::ChannelsCellular) { - m_settings.m_txCellularChannel = (LimeRFEController::CellularChannel) index; - } - - setTxChannels(); - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_txPort_currentIndexChanged(int index) -{ - m_settings.m_txPort = (LimeRFEController::TxPort) index; - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_powerEnable_clicked() -{ - m_settings.m_swrEnable = ui->powerEnable->isChecked(); - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_powerSource_currentIndexChanged(int index) -{ - m_settings.m_swrSource = (LimeRFEController::SWRSource) index; - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_powerRefresh_clicked() -{ - refreshPower(); -} - -void LimeRFEUSBDialog::on_powerAutoRefresh_toggled(bool checked) -{ - if (checked) - { - connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); - m_timer.start(); - } - else - { - m_timer.stop(); - disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick())); - } -} - -void LimeRFEUSBDialog::on_powerAbsAvg_clicked() -{ - m_avgPower = ui->powerAbsAvg->isChecked(); -} - -void LimeRFEUSBDialog::on_powerCorrValue_textEdited(const QString &text) -{ - bool ok; - double powerCorrection = text.toDouble(&ok); - - if (ok) - { - setPowerCorrection(powerCorrection); - m_currentPowerCorrection = powerCorrection; - updateAbsPower(powerCorrection); - } -} - -void LimeRFEUSBDialog::on_deviceSetRefresh_clicked() -{ - updateDeviceSetList(); -} - -void LimeRFEUSBDialog::on_deviceSetSync_clicked() -{ - m_deviceSetSync = ui->deviceSetSync->isChecked(); - - if (m_deviceSetSync) { - syncRxTx(); - } -} - -void LimeRFEUSBDialog::syncRxTx() -{ - if (!m_settings.m_txOn) { - stopStartTx(m_settings.m_txOn); - } - - stopStartRx(m_settings.m_rxOn); - - if (m_settings.m_txOn) { - stopStartTx(m_settings.m_txOn); - } -} - -void LimeRFEUSBDialog::stopStartRx(bool start) -{ - unsigned int rxDeviceSetSequence = ui->deviceSetRx->currentIndex(); - - if (rxDeviceSetSequence >= m_sourceEngines.size()) { - return; - } - - DSPDeviceSourceEngine *deviceSourceEngine = m_sourceEngines[rxDeviceSetSequence]; - - if (start) - { - if (deviceSourceEngine->initAcquisition()) { - deviceSourceEngine->startAcquisition(); - } - } - else - { - deviceSourceEngine->stopAcquistion(); - } -} - -void LimeRFEUSBDialog::stopStartTx(bool start) -{ - unsigned int txDeviceSetSequence = ui->deviceSetTx->currentIndex(); - - if (txDeviceSetSequence >= m_sinkEngines.size()) { - return; - } - - DSPDeviceSinkEngine *deviceSinkEngine = m_sinkEngines[txDeviceSetSequence]; - - if (start) - { - if (deviceSinkEngine->initGeneration()) { - deviceSinkEngine->startGeneration(); - } - } - else - { - deviceSinkEngine->stopGeneration(); - } -} - -void LimeRFEUSBDialog::updateAbsPower(double powerCorrDB) -{ - bool ok; - double power = ui->powerFwdText->text().toDouble(&ok); - - if (ok) - { - double powerCorrected = power + powerCorrDB; - double powerDisplayed = powerCorrected; - - if (m_avgPower) - { - m_powerMovingAverage(powerCorrected); - powerDisplayed = m_powerMovingAverage.asDouble(); - } - - ui->powerAbsDbText->setText(tr("%1 dBm").arg(QString::number(powerDisplayed, 'f', 1))); - double powerWatts = CalcDb::powerFromdB(powerDisplayed - 30.0); - powerWatts = powerWatts > 8.0 ? 8.0 : powerWatts; - ui->powerAbsWText->setText(tr("%1 W").arg(QString::number(powerWatts, 'f', 3))); - } -} - -void LimeRFEUSBDialog::updateDeviceSetList() -{ - std::vector& deviceUISets = m_mainWindow->getDeviceUISets(); - std::vector::const_iterator it = deviceUISets.begin(); - m_sourceEngines.clear(); - m_rxDeviceSetIndex.clear(); - m_sinkEngines.clear(); - m_txDeviceSetIndex.clear(); - ui->deviceSetRx->clear(); - ui->deviceSetTx->clear(); - unsigned int deviceIndex = 0; - unsigned int rxIndex = 0; - unsigned int txIndex = 0; - - for (; it != deviceUISets.end(); ++it, deviceIndex++) - { - DSPDeviceSourceEngine *deviceSourceEngine = (*it)->m_deviceSourceEngine; - DSPDeviceSinkEngine *deviceSinkEngine = (*it)->m_deviceSinkEngine; - - if (deviceSourceEngine) - { - m_sourceEngines.push_back(deviceSourceEngine); - m_rxDeviceSetIndex.push_back(deviceIndex); - ui->deviceSetRx->addItem(QString("%1").arg(deviceIndex)); - rxIndex++; - } - else if (deviceSinkEngine) - { - m_sinkEngines.push_back(deviceSinkEngine); - m_txDeviceSetIndex.push_back(deviceIndex); - ui->deviceSetTx->addItem(QString("%1").arg(deviceIndex)); - txIndex++; - } - } -} - -void LimeRFEUSBDialog::highlightApplyButton(bool highlight) -{ - if (highlight) { - ui->apply->setStyleSheet("QPushButton { background-color : green; }"); - } else { - ui->apply->setStyleSheet("QPushButton { background:rgb(79,79,79); }"); - } -} - -void LimeRFEUSBDialog::on_modeRx_toggled(bool checked) -{ - int rc; - ui->statusText->clear(); - m_settings.m_rxOn = checked; - - if (m_rxTxToggle) - { - m_settings.m_txOn = !checked; - - if (checked) // Rx on - { - rc = m_controller.setTx(m_settings, false); // stop Tx first - ui->statusText->append(QString("Stop TX: %1").arg(m_controller.getError(rc).c_str())); - } - - rc = m_controller.setRx(m_settings, m_settings.m_rxOn); // Rx on or off - ui->statusText->append(QString("RX: %1").arg(m_controller.getError(rc).c_str())); - - if (!checked) // Rx off - { - rc = m_controller.setTx(m_settings, true); // start Tx next - ui->statusText->append(QString("Start TX: %1").arg(m_controller.getError(rc).c_str())); - } - } - else - { - rc = m_controller.setRx(m_settings, m_settings.m_rxOn); - ui->statusText->setText(m_controller.getError(rc).c_str()); - } - - if (m_deviceSetSync) { - syncRxTx(); - } - - displayMode(); -} - -void LimeRFEUSBDialog::on_modeTx_toggled(bool checked) -{ - int rc; - ui->statusText->clear(); - m_settings.m_txOn = checked; - - if (m_rxTxToggle) - { - m_settings.m_rxOn = !checked; - - if (checked) // Tx on - { - rc = m_controller.setRx(m_settings, false); // stop Rx first - ui->statusText->append(QString("Stop RX: %1").arg(m_controller.getError(rc).c_str())); - } - - rc = m_controller.setTx(m_settings, m_settings.m_txOn); // Tx on or off - ui->statusText->append(QString("TX: %1").arg(m_controller.getError(rc).c_str())); - - if (!checked) // Tx off - { - rc = m_controller.setRx(m_settings, true); // start Rx next - ui->statusText->append(QString("Start RX: %1").arg(m_controller.getError(rc).c_str())); - } - } - else - { - rc = m_controller.setTx(m_settings, m_settings.m_txOn); - ui->statusText->setText(m_controller.getError(rc).c_str()); - } - - if (m_deviceSetSync) { - syncRxTx(); - } - - displayMode(); -} - -void LimeRFEUSBDialog::on_rxTxToggle_clicked() -{ - m_rxTxToggle = ui->rxTxToggle->isChecked(); - - if (m_rxTxToggle && m_settings.m_rxOn && m_settings.m_txOn) - { - m_settings.m_txOn = false; - int rc = m_controller.setTx(m_settings, m_settings.m_txOn); - ui->statusText->setText(m_controller.getError(rc).c_str()); - displayMode(); - - if (m_deviceSetSync) { - syncRxTx(); - } - } -} - -void LimeRFEUSBDialog::on_attenuation_currentIndexChanged(int index) -{ - m_settings.m_attenuationFactor = index; - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_amFmNotchFilter_clicked() -{ - m_settings.m_amfmNotch = ui->amFmNotchFilter->isChecked(); - highlightApplyButton(true); -} - -void LimeRFEUSBDialog::on_apply_clicked() -{ - ui->statusText->clear(); - m_controller.settingsToState(m_settings); - int rc = m_controller.configure(); - ui->statusText->setText(m_controller.getError(rc).c_str()); - highlightApplyButton(false); -} - -void LimeRFEUSBDialog::tick() -{ - refreshPower(); -} diff --git a/sdrgui/limerfegui/limerfeusbdialog.ui b/sdrgui/limerfegui/limerfeusbdialog.ui deleted file mode 100644 index a8b75a21f..000000000 --- a/sdrgui/limerfegui/limerfeusbdialog.ui +++ /dev/null @@ -1,1012 +0,0 @@ - - - LimeRFEUSBDialog - - - - 0 - 0 - 411 - 499 - - - - LimeRFE USB control - - - - - 310 - 460 - 81 - 32 - - - - Dismiss dialog - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - 10 - 10 - 31 - 31 - - - - Dev - - - - - - 210 - 10 - 51 - 27 - - - - Open device - - - Open - - - - - - 270 - 10 - 51 - 27 - - - - Close Device - - - Close - - - - - - 50 - 10 - 151 - 27 - - - - Device - - - - - - 330 - 10 - 51 - 27 - - - - Transfer data to GUI - - - to GUI - - - - - - 0 - 40 - 401 - 16 - - - - Qt::Horizontal - - - - - - 10 - 50 - 91 - 27 - - - - Rx channel - - - - - - 10 - 80 - 151 - 27 - - - - Rx channel group - - - - Wideband - - - - - HAM - - - - - Cellular - - - - - - - 180 - 80 - 221 - 27 - - - - Rx channel range - - - - - - 10 - 110 - 61 - 27 - - - - Rx port - - - - - - 70 - 110 - 131 - 27 - - - - Rx port - - - - Tx/Rx (J3) - - - - - Tx/Rx HF (J5) - - - - - - - 210 - 110 - 31 - 27 - - - - Att - - - - - - 240 - 110 - 51 - 27 - - - - Rx attenuation - - - - 0 - - - - - 2 - - - - - 4 - - - - - 6 - - - - - 8 - - - - - 10 - - - - - 12 - - - - - 14 - - - - - - - 300 - 110 - 21 - 27 - - - - dB - - - - - - 330 - 110 - 71 - 27 - - - - AM/FM notch filter - - - Notch - - - - - - 0 - 140 - 401 - 16 - - - - Qt::Horizontal - - - - - - 10 - 150 - 91 - 27 - - - - Tx channel - - - - - - 110 - 150 - 111 - 27 - - - - Channel same as Rx - - - Same as Rx - - - - - - 10 - 180 - 151 - 27 - - - - Tx channel group - - - - Wideband - - - - - HAM - - - - - Cellular - - - - - - - 180 - 180 - 221 - 27 - - - - Tx channel range - - - - - - 10 - 210 - 61 - 27 - - - - Tx port - - - - - - 70 - 210 - 131 - 27 - - - - Tx port - - - - Tx/Rx (J3) - - - - - Tx (J4) - - - - - - - 0 - 240 - 401 - 16 - - - - Qt::Horizontal - - - - - - 10 - 350 - 50 - 25 - - - - Switch Rx - - - RX - - - true - - - - - - 70 - 350 - 50 - 25 - - - - Switch Tx - - - TX - - - true - - - - - - 70 - 320 - 111 - 27 - - - - Rx/Tx state - - - None - - - - - - 10 - 320 - 50 - 27 - - - - Mode - - - - - - 10 - 460 - 71 - 27 - - - - Apply changes - - - Apply - - - - - - 10 - 390 - 391 - 61 - - - - Messages - - - - - - 130 - 350 - 70 - 25 - - - - Rx/Tx toggle - - - Toggle - - - - - - 180 - 250 - 31 - 17 - - - - Fwd - - - - - - 230 - 250 - 31 - 17 - - - - Ref - - - - - - 230 - 270 - 35 - 17 - - - - Relative reflected power in dB - - - 00.0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 180 - 270 - 35 - 17 - - - - Relative forward power in dB - - - 00.0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 320 - 270 - 25 - 17 - - - - dB - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 280 - 250 - 31 - 17 - - - - RL - - - - - - 280 - 270 - 35 - 17 - - - - Return loss in dB - - - 00.0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 250 - 50 - 27 - - - - Enable power measurements - - - Pwr - - - - - - 80 - 250 - 24 - 24 - - - - Refresh power - - - - - - - :/recycle.png:/recycle.png - - - - - - 360 - 250 - 45 - 17 - - - - VSWR - - - - - - 0 - 310 - 401 - 16 - - - - Qt::Horizontal - - - - - - 80 - 280 - 24 - 24 - - - - Auto refresh power - - - - - - - :/play.png:/play.png - - - true - - - - - - 350 - 270 - 50 - 17 - - - - Voltage Standing Wave Ratio - - - 1.000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 10 - 280 - 60 - 25 - - - - Power measurement source (EXTernal, CELlular) - - - - EXT - - - - - CEL - - - - - - - 120 - 260 - 31 - 17 - - - - Corr - - - - - - 170 - 290 - 75 - 17 - - - - Corrected forward power in dBm - - - -00.0 dBm - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 250 - 290 - 65 - 17 - - - - Corrected forward power in Watts - - - 0.000 W - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 110 - 280 - 55 - 27 - - - - Qt::ClickFocus - - - Power correction in dBm - - - -00.0 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - 320 - 290 - 50 - 17 - - - - Corrected power averaging - - - Avg - - - - - - 230 - 350 - 50 - 25 - - - - Index of Rx DeviceSet - - - - - - 310 - 350 - 50 - 25 - - - - Index of Tx DeviceSet - - - - - - 210 - 350 - 25 - 25 - - - - Rx - - - - - - 290 - 350 - 25 - 25 - - - - Tx - - - - - - 210 - 320 - 100 - 25 - - - - DeviceSet synchronization - - - Rx/Tx Sync - - - - - - 370 - 350 - 24 - 24 - - - - Refresh DeviceSet indexes - - - - - - - :/recycle.png:/recycle.png - - - - - - ButtonSwitch - QToolButton -
    gui/buttonswitch.h
    -
    -
    - - - - - - buttonBox - accepted() - LimeRFEUSBDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - LimeRFEUSBDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -
    diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index efd65e253..1a186e990 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -61,7 +61,6 @@ #include "gui/sdrangelsplash.h" #include "gui/mypositiondialog.h" #include "gui/fftwisdomdialog.h" -#include "gui/ambedevicesdialog.h" #include "gui/workspace.h" #include "gui/featurepresetsdialog.h" #include "gui/devicesetpresetsdialog.h" @@ -97,10 +96,6 @@ #include #include -#if defined(HAS_LIMERFEUSB) -#include "limerfegui/limerfeusbdialog.h" -#endif - MainWindow *MainWindow::m_instance = 0; MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parser, QWidget* parent) : @@ -120,7 +115,6 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse m_mainCore->m_masterTabIndex = 0; m_mainCore->m_mainMessageQueue = &m_inputMessageQueue; m_mainCore->m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager()); - m_mainCore->m_settings.setAMBEEngine(m_dspEngine->getAMBEEngine()); QFontDatabase::addApplicationFont(":/LiberationSans-Regular.ttf"); QFontDatabase::addApplicationFont(":/LiberationMono-Regular.ttf"); @@ -1470,16 +1464,6 @@ void MainWindow::createMenuBar() QAction *fftAction = preferencesMenu->addAction("&FFT..."); fftAction->setToolTip("Set FFT cache"); QObject::connect(fftAction, &QAction::triggered, this, &MainWindow::on_action_FFT_triggered); -#ifndef __APPLE__ - QAction *ambeAction = preferencesMenu->addAction("A&MBE..."); - ambeAction->setToolTip("AMBE options"); - QObject::connect(ambeAction, &QAction::triggered, this, &MainWindow::on_action_AMBE_triggered); -#endif -#if defined(HAS_LIMERFEUSB) - QAction *limeRFEAction = preferencesMenu->addAction("Lime &RFE..."); - limeRFEAction->setToolTip("Lime RFE options"); - QObject::connect(limeRFEAction, &QAction::triggered, this, &MainWindow::on_action_LimeRFE_triggered); -#endif QMenu *devicesMenu = preferencesMenu->addMenu("&Devices"); QAction *userArgumentsAction = devicesMenu->addAction("&User arguments..."); userArgumentsAction->setToolTip("Device custom user arguments"); @@ -2127,26 +2111,6 @@ void MainWindow::fftWisdomProcessFinished(int exitCode, QProcess::ExitStatus exi m_fftWisdomProcess = nullptr; } -void MainWindow::on_action_AMBE_triggered() -{ - qDebug("MainWindow::on_action_AMBE_triggered"); -#ifndef __APPLE__ - AMBEDevicesDialog ambeDevicesDialog(m_dspEngine->getAMBEEngine(), this); - ambeDevicesDialog.exec(); -#endif -} - -void MainWindow::on_action_LimeRFE_triggered() -{ - qDebug("MainWindow::on_action_LimeRFE_triggered"); -#if defined(HAS_LIMERFEUSB) - qDebug("MainWindow::on_action_LimeRFE_triggered: activated"); - LimeRFEUSBDialog *limeRFEUSBDialog = new LimeRFEUSBDialog(m_mainCore->m_settings.getLimeRFEUSBCalib(), this); - limeRFEUSBDialog->setModal(false); - limeRFEUSBDialog->show(); -#endif -} - void MainWindow::samplingDeviceChangeHandler(DeviceGUI *deviceGUI, int newDeviceIndex) { int deviceType = (int) deviceGUI->getDeviceType(); diff --git a/sdrgui/mainwindow.h b/sdrgui/mainwindow.h index 21488f49a..5e8261906 100644 --- a/sdrgui/mainwindow.h +++ b/sdrgui/mainwindow.h @@ -181,8 +181,6 @@ private slots: void on_action_Audio_triggered(); void on_action_Logging_triggered(); void on_action_FFT_triggered(); - void on_action_AMBE_triggered(); - void on_action_LimeRFE_triggered(); void on_action_My_Position_triggered(); void on_action_DeviceUserArguments_triggered(); void on_action_commands_triggered(); diff --git a/sdrgui/readme.md b/sdrgui/readme.md index d304790bd..cefd1f8af 100644 --- a/sdrgui/readme.md +++ b/sdrgui/readme.md @@ -21,8 +21,6 @@ The menu items from left to right are: - _Audio_: opens a dialog to choose the audio output device. See the audio management documentation [here](audio.md) - _Logging_: opens a dialog to choose logging options. See "Logging" paragraph next for details - _FFT_: opens a dialog to run the `fftwf-wisdom` utility with a choice of direct and possibly reverse FFT sizes. It produces a so called wisdom file `fftw-wisdom` that speeds up FFT allocations. It is created at a default location and will be used at next invocations of SDRangel. See "FFT" paragraph next for details. - - _AMBE_: Opens a dialog to select AMBE3000 serial devices or AMBE server addresses to use for AMBE digital voice processing. If none is selected AMBE frames decoding will be done with mbelib if available else no audio will be produced for AMBE digital voice. See "AMBE"paragraph next for details. - - _Lime RFE_: Presemt only if LimeSuite library is available. This opens a dialog to control a LimeRFE device via USB. The details are provided [here](limerfeusbgui.md). - _My Position_: opens a dialog to enter your station ("My Position") coordinates in decimal degrees with north latitudes positive and east longitudes positive. This is used whenever positional data is to be displayed (APRS, DPRS, ...). For it now only works with D-Star $$CRC frames. See [DSD demod plugin](../plugins/channelrx/demoddsd/readme.md) for details on how to decode Digital Voice modes. - _Devices_: section to deal with devices settings - _User arguments_: opens a dialog to let the user give arguments specific to a device and its instance (sequence) in the system @@ -53,7 +51,7 @@ The workspace has a top bar with the following controls:

    1.1: Workspace index

    -Shows the index of the workspaces in the list of workspaces as a "W" followd by the index. +Shows the index of the workspaces in the list of workspaces as a "W" followed by the index.

    1.2: Create new receiver

    @@ -202,7 +200,7 @@ Use the "Cancel" button to dismiss all changes When clicking on the FFT submenu a dialog opens for running the `fftwf-wisdom` utility with a choice of direct and possibly reverse FFT sizes. It produces a so called wisdom file `fftw-wisdom` that speeds up FFT allocations. It is created at a default location and will be used at next invocations of SDRangel. -![Main Window AMBE](../doc/img/MainWindow_fft.png) +![Main Window FFT](../doc/img/MainWindow_fft.png)

    2.2.1: FFTW Wisdom program

    @@ -232,57 +230,7 @@ When clicking the "OK" button the `fftwf-wisdom` program is launched in the back When clicking the "Cancel" button the dialog is dismissed without execution of the `fftwf-wisdom` program. -

    2.3: AMBE

    - -When clicking on the AMBE submenu a dialog opens to let you specify physical AMBE devices to decode AMBE frames produced by digital voice signals (using DSD decoder plugin). - -![Main Window AMBE](../doc/img/MainWindow_ambe.png) - -

    2.3.1: AMBE server address and port or direct input

    - -Use this freeflow text input box to specify either the address and port of an AMBE server in the form: <IPv4 address>:<port> or any directly attached physical device address like a COM port on Windows. - -

    2.3.2: Import above address or device

    - -Import the address or device specified in (1) into the list of used devices. The system will try to open the device or contact the server and will add it to the list only if successful. - -

    2.3.3: Remove in use device or address

    - -When a device or address is selected in the in use list (6) push this button to remove it from the list. The corresponding resources will be released. - -

    2.3.4: Refresh in use list

    - -Checks the list of devices or addresses currently in use and update the in use list (6). - -

    2.3.5: Empty in use list

    - -Removes all devices or addresses in use. The in use list (6) is cleared consequently. This removes all AMBE devices related resources attached to the current instance of the SDRangel program. Therefore consecutive AMBE frames decoding will be handled by the mbelib library if available or no audio will be output. - -

    2.3.6: In use list

    - -List of devices or addresses currently in use for AMBE frames decoding by this instance of the SDRangel program. - -

    2.3.7: Import serial device

    - -Imports a serial device scanned in the list of available AMBE 3000 serial devices (9) in the in use list. If this device is already in the in use list then nothing happens and this is reported in the status text (10) - -

    2.3.8: Import all serial devices

    - -Imports all serial devices scanned in the list of available AMBE 3000 serial devices (9) in the in use list. If any device is already in the in use list then it is not added twice. - -

    2.3.9: List of available AMBE 3000 serial devices

    - -This is the list of AMBE 3000 currently attached to the system directly. This list gets updated at every opening of the dialog. - -

    2.3.10: Status text

    - -A brief text reports the result of the current action - -

    2.3.11: Close button

    - -Use this button to dismiss the dialog - -

    2.4: Commands

    +

    2.3: Commands

    This is a tree view of the saved commands. Commands describe the path to an executable file, its arguments a possible link to a keystroke event that triggers the execution. Similarly to presets commands can be arranged into groups and have a description short text. @@ -292,43 +240,43 @@ Of course any binary that resides in your system can be used that way like `/bin ![Main Window presets view](../doc/img/MainWindow_commands_view.png) -

    2.4.1: Command selection

    +

    2.3.1: Command selection

    You select a command or a command group by clicking on its line in the tree view. All actions (6) will be done relative to this command or command group. -

    2.4.2: Group

    +

    2.3.2: Group

    You can organize your commands into groups. Groups can be collapsed or expanded by using the caret icon on the left. -

    2.4.3: Description

    +

    2.3.3: Description

    Short description of a command. -

    2.4.4: Key binding indicator

    +

    2.3.4: Key binding indicator

    - `-`: no key binding - `P`: key press binding - `R`: key release binding -

    2.4.5: Key binding sequence

    +

    2.3.5: Key binding sequence

    Thisis a descriptive text of the key sequence that is used for the key binding. -

    2.4.6: Command control or actions

    +

    2.3.6: Command control or actions

    The controls are located as icons at the bottom of the window: ![Main Window commands](../doc/img/MainWindow_commands.png) -
    2.4.6.1: Create new command
    +
    2.3.6.1: Create new command
    Click on this icon to create a new command. This opens an edit dialog see the edit section (5B.6.3) for the details of the edit dialog. -
    2.4.6.2: Duplicate command
    +
    2.3.6.2: Duplicate command
    Click on this icon to duplicate the currently selected command (inactive on groups). Later you can edit the details of the copy with the edit dialog (see 5B.6.3 next) -
    2.4.6.3: Edit command or command group
    +
    2.3.6.3: Edit command or command group
    Command groups @@ -342,15 +290,15 @@ You can edit the details of the command with this dialog. ![Main Window command group edit](../doc/img/MainWindow_command_edit.png) -
    2.4.6.3.1: Edit group
    +
    2.3.6.3.1: Edit group
    You can select an existing group with the combo or create a new one for this command using the text edit box -
    2.4.6.3.2: Edit description
    +
    2.3.6.3.2: Edit description
    You can edit the description using this text box. The description will appear in the tree view. -
    2.4.6.3.3: Executable file selection
    +
    2.3.6.3.3: Executable file selection
    Clicking on this button will open a file dialog to select the executable file that will be run with this command. The file selection dialog has predefined file pattern selections: @@ -359,11 +307,11 @@ Clicking on this button will open a file dialog to select the executable file th - `*.sh` or `*.bat` for shell or batch files - `*.bin` or `*.exe` for binary files -
    2.4.6.3.4: Executable file path
    +
    2.3.6.3.4: Executable file path
    This is the full path of the selected executable file. -
    2.4.6.3.5: Command line arguments
    +
    2.3.6.3.5: Command line arguments
    Use the text box to edit the arguments given to the executable file as in `program arguments`. @@ -373,41 +321,41 @@ You can use special codes to insert information specific to the application cont - `%2`: the port of the web REST API - `%3`: the currently selected device set index -
    2.4.6.3.6: Key binding
    +
    2.3.6.3.6: Key binding
    Use this checkbox to enable or disable the command execution binding to a key or combination of keys press or release event -
    2.4.6.3.7: Key binding capture
    +
    2.3.6.3.7: Key binding capture
    Use this button to capture the key or key combination that will be used for the key binding. After pushing this button just type in the key or key combination. -
    2.4.6.3.8: Key binding display
    +
    2.3.6.3.8: Key binding display
    This shows the key or combination of keys used for the key binding. -
    2.4.6.3.9: Release key binding
    +
    2.3.6.3.9: Release key binding
    Use this checkbox to bind the key or combination of keys to the key release event. If unchecked the binding will be associated to the key press event. -
    2.4.6.3.10: Confirm changes
    +
    2.3.6.3.10: Confirm changes
    Use the "OK" button to confirm the changes. -
    2.4.6.3.11: Cancel changes
    +
    2.3.6.3.11: Cancel changes
    Use the "Cancel" button to cancel the changes. -
    2.4.6.4: Run command or groups of commands
    +
    2.3.6.4: Run command or groups of commands
    This will run the currently selected command. If the selection is a group it will run all commands of the group starting them in the displayed order. Please note that commands are run in independent processes and therefore all launched commands in the group will run concurrently. -
    2.4.6.5: View last command run details
    +
    2.3.6.5: View last command run details
    This dialog will show the results of the last run including the output (merged stdout and stderr). ![Main Window command output](../doc/img/MainWindow_command_output.png) -
    2.4.6.5.1: Process status
    +
    2.3.6.5.1: Process status
    When the process is not running the stop icon (■) is displayed. The background color indicate different states: @@ -417,31 +365,31 @@ When the process is not running the stop icon (■) is displayed. The backgr When the process is running the play icon (▶) is displayed with an orange background. -
    2.4.6.5.2: Refresh data
    +
    2.3.6.5.2: Refresh data
    Pushing this button will update the data displayed with the latest status. Please note that the log is displayed only when the process is terminated. -
    2.4.6.5.3: Start time
    +
    2.3.6.5.3: Start time
    This is the timestamp of process start. It is filled with dots `...` if the process has never started during this session. -
    2.4.6.5.4: End time
    +
    2.3.6.5.4: End time
    This is the timestamp of process end. It is filled with dots `...` if the process has never terminated during this session. -
    2.4.6.5.3: PID
    +
    2.3.6.5.3: PID
    This is the process PID. It is 0 if the process has never run during this session. -
    2.4.6.5.6: Process kill
    +
    2.3.6.5.6: Process kill
    Use this button to kill (send SIGKILL) the running process. It has no effect if the process is not running. -
    2.4.6.5.7: Command line
    +
    2.3.6.5.7: Command line
    This shows the actual command line that was used to start the process -
    2.4.6.5.8: Error status
    +
    2.3.6.5.8: Error status
    This is the translation of `QProcess::ProcessError`. Possible values are: @@ -453,31 +401,31 @@ This is the translation of `QProcess::ProcessError`. Possible values are: - `Read error`: an error occurred when attempting to read from the process. For example, the process may not be running. - `Unknown error`: an unknown error occurred. -
    2.4.6.5.9: Exit code
    +
    2.3.6.5.9: Exit code
    This is the program exit code. When the process crashes this is the signal by which the process end was caused. For example if you kill the process with button (6) it sends the process a SIGKILL (code 9) and therefore the value is 9. -
    2.4.6.5.10: Exit status
    +
    2.3.6.5.10: Exit status
    There are only two possibilities: either the program exits normally but possibly with a non zero exit code or it ends with a crash. -
    2.4.6.5.11: Process log
    +
    2.3.6.5.11: Process log
    This is the log of the process (merged stdout and stderr). Please note that it is updated only on program termination. -
    2.4.6.5.12: Exit
    +
    2.3.6.5.12: Exit
    By pushing the "Close" button the process output window is closed. -
    2.4.6.6: Save commands
    +
    2.3.6.6: Save commands
    This will save the commands immediately. The commands will be automatically saved when the application exits normally. -
    2.4.6.7: Delete commands or group of commands
    +
    2.3.6.7: Delete commands or group of commands
    This will delete the currently selected command or if selection is a group this will delete all commands in the group. -
    2.4.6.8: Activate keyboard bindings
    +
    2.3.6.8: Activate keyboard bindings
    Use this button to activate the keyboard bindings. Note that you need to have this button selected (its background should be lit in beige/orange) for the key bindings to be effective. diff --git a/sdrsrv/mainserver.cpp b/sdrsrv/mainserver.cpp index 2d084e654..949865178 100644 --- a/sdrsrv/mainserver.cpp +++ b/sdrsrv/mainserver.cpp @@ -51,7 +51,6 @@ MainServer::MainServer(qtwebapp::LoggerWithFile *logger, const MainParser& parse m_mainCore->m_logger = logger; m_mainCore->m_mainMessageQueue = &m_inputMessageQueue; m_mainCore->m_settings.setAudioDeviceManager(m_dspEngine->getAudioDeviceManager()); - m_mainCore->m_settings.setAMBEEngine(m_dspEngine->getAMBEEngine()); m_mainCore->m_masterTabIndex = -1; qDebug() << "MainServer::MainServer: create FFT factory..."; diff --git a/swagger/sdrangel/api/swagger/include/AMBE.yaml b/swagger/sdrangel/api/swagger/include/AMBE.yaml new file mode 100644 index 000000000..d696083a0 --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/AMBE.yaml @@ -0,0 +1,103 @@ +AMBESettings: + description: AMBE + properties: + title: + type: string + rgbColor: + type: integer + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer + rollupState: + $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" + +AMBEReport: + description: AMBE + properties: + serial: + description: List of AMBE serial devices in the system + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/definitions/DVSerialDevices" + devices: + description: List of AMBE devices or servers in use + type: array + items: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/definitions/AMBEDeviceReport" + +AMBEActions: + description: AMBE + properties: + updateDevices: + description: Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/definitions/AMBEDevices" + removeAll: + type: integer + description: Set to a non zero value to remove all AMBE devices from the list of used AMBE devices + + +definitions: + + DVSerialDevices: + description: "List of DV serial devices available in the system" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + dvSerialDevices: + description: "Device names of DV serial devices" + type: array + items: + $ref: "#/definitions/DVSerialDevice" + + DVSerialDevice: + description: "DV serial device details" + properties: + deviceName: + description: "Name of the serial device in the system" + type: string + + AMBEDevices: + description: "List of AMBE devices (serial or server address)" + required: + - nbDevices + properties: + nbDevices: + description: "Number of DV serial devices" + type: integer + ambeDevices: + description: "List of AMBE devices" + type: array + items: + $ref: "#/definitions/AMBEDevice" + + AMBEDevice: + description: "AMBE devices active in the system" + properties: + deviceRef: + description: "Serial device name or server address" + type: string + delete: + description: "1 if device is to be removed from active list" + type: integer + + AMBEDeviceReport: + description: "Report of AMBE device in use" + properties: + devicePath: + type: string + description: AMBE device full path or AMBE server URL + successCount: + type: integer + description: number of frames decoded successfully + failureCount: + type: integer + description: number of frames that failed to decode diff --git a/swagger/sdrangel/api/swagger/include/DSDDemod.yaml b/swagger/sdrangel/api/swagger/include/DSDDemod.yaml index 5e8e184aa..d0c87f99c 100644 --- a/swagger/sdrangel/api/swagger/include/DSDDemod.yaml +++ b/swagger/sdrangel/api/swagger/include/DSDDemod.yaml @@ -72,7 +72,15 @@ DSDDemodSettings: $ref: "http://swgserver:8081/api/swagger/include/ChannelMarker.yaml#/ChannelMarker" rollupState: $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" - + ambeFeatureIndex: + type: integer + description: index of AMBE controller feature to be used for AMBE frames decoding + connectAMBE: + type: integer + description: > + Decode frames with AMBE feature + * 0 - Do not decode frames with AMBE feature + * 1 - Decode frames with AMBE feature DSDDemodReport: description: DSDDemod properties: diff --git a/swagger/sdrangel/api/swagger/include/FeatureActions.yaml b/swagger/sdrangel/api/swagger/include/FeatureActions.yaml index 153399011..4ba69ceaa 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureActions.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureActions.yaml @@ -15,8 +15,12 @@ FeatureActions: type: integer AFCActions: $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCActions" + AMBEActions: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/AMBEActions" GS232ControllerActions: $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerActions" + LimeRFEActions: + $ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFEActions" MapActions: $ref: "http://swgserver:8081/api/swagger/include/Map.yaml#/MapActions" PERTesterActions: diff --git a/swagger/sdrangel/api/swagger/include/FeatureReport.yaml b/swagger/sdrangel/api/swagger/include/FeatureReport.yaml index 468022ad5..95fdcea9e 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureReport.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureReport.yaml @@ -9,8 +9,12 @@ FeatureReport: type: string AFCReport: $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCReport" + AMBEReport: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/AMBEReport" GS232ControllerReport: $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerReport" + LimeRFEReport: + $ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFEReport" MapReport: $ref: "http://swgserver:8081/api/swagger/include/Map.yaml#/MapReport" PERTesterReport: diff --git a/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml b/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml index da6a8cef2..6832f8ab4 100644 --- a/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml +++ b/swagger/sdrangel/api/swagger/include/FeatureSettings.yaml @@ -17,6 +17,8 @@ FeatureSettings: $ref: "http://swgserver:8081/api/swagger/include/AFC.yaml#/AFCSettings" AISSettings: $ref: "http://swgserver:8081/api/swagger/include/AIS.yaml#/AISSettings" + AMBESettings: + $ref: "http://swgserver:8081/api/swagger/include/AMBE.yaml#/AMBESettings" AntennaToolsSettings: $ref: "http://swgserver:8081/api/swagger/include/AntennaTools.yaml#/AntennaToolsSettings" APRSSettings: @@ -27,6 +29,8 @@ FeatureSettings: $ref: "http://swgserver:8081/api/swagger/include/JogdialController.yaml#/JogdialControllerSettings" GS232ControllerSettings: $ref: "http://swgserver:8081/api/swagger/include/GS232Controller.yaml#/GS232ControllerSettings" + LimeRFESettings: + $ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFESettings" MapSettings: $ref: "http://swgserver:8081/api/swagger/include/Map.yaml#/MapSettings" PERTesterSettings: diff --git a/swagger/sdrangel/api/swagger/include/LimeRFE.yaml b/swagger/sdrangel/api/swagger/include/LimeRFE.yaml index 095a88c00..b1704019a 100644 --- a/swagger/sdrangel/api/swagger/include/LimeRFE.yaml +++ b/swagger/sdrangel/api/swagger/include/LimeRFE.yaml @@ -1,6 +1,10 @@ LimeRFESettings: description: LimeRFE properties: + title: + type: string + rgbColor: + type: integer devicePath: description: Path to the device serial interface (ex /dev/ttyUSB2) type: string @@ -102,19 +106,69 @@ LimeRFESettings: SWR measurement source (LimeRFEController::SWRSource) * 0 - External * 1 - Cellular + txRxDriven: + description: Boolean 1 if Tx is copy of Rx else 0 + type: integer + useReverseAPI: + description: Synchronize with reverse API (1 for yes, 0 for no) + type: integer + reverseAPIAddress: + type: string + reverseAPIPort: + type: integer + reverseAPIFeatureSetIndex: + type: integer + reverseAPIFeatureIndex: + type: integer + rollupState: + $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" + +LimeRFEReport: + description: LimeRFE + properties: rxOn: description: Boolean 1 if Rx is active else 0 type: integer txOn: description: Boolean 1 if Tx is active else 0 type: integer - -LimeRFEPower: - description: report of forward and reflected power measurements - properties: - forward: + forwardPower: description: relative forward power in centi-Bels type: integer - reflected: + reflectedPower: description: relative reflected power in centi-Bels - type: integer \ No newline at end of file + type: integer + +LimeRFEActions: + description: LimeRFE + properties: + selectChannel: + type: integer + description: > + Select channel + * 0 - Rx + * 1 - Tx + deviceSetIndex: + type: integer + dexcription: Index of device set to synchronize switch with + switchChannel: + type: integer + description: > + Switch on or off + * 0 - Off + * 1 - On + getState: + type: integer + description: Set to non zero value to get the board state + fromToSettings: + type: integer + description: > + Move from/to settings to/from device + * 0 - From device to settings. The toGUI button in GUI mode + * 1 - From settings to device. The Apply button in GUI mode + openCloseDevice: + type: integer + description: > + Open or close device + * 0 - Close device + * 1 - Open device diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index bc41da17a..321c79e11 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -454,222 +454,6 @@ paths: "501": $ref: "#/responses/Response_501" - /sdrangel/ambe/serial: - x-swagger-router-controller: instance - get: - description: get a list of available DV serial devices - operationId: instanceAMBESerialGet - tags: - - Instance - responses: - "200": - description: On success return list of device paths possibly empty - schema: - $ref: "#/definitions/DVSerialDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/ambe/devices: - x-swagger-router-controller: instance - get: - description: get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes - operationId: InstanceAMBEDevicesGet - tags: - - Instance - responses: - "200": - description: On success return list of devices possibly empty - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - put: - description: Replace the list of active devices - operationId: InstanceAMBEDevicesPut - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - delete: - description: Emtpy the active devices thus effectively closing down AMBE devices support - operationId: InstanceAMBEDevicesDelete - tags: - - Instance - responses: - "200": - description: Success. - schema: - $ref: "#/definitions/SuccessResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - patch: - description: Add and/or delete devices to/from the active list - operationId: InstanceAMBEDevicesPatch - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: List of AMBE devices (serial or address) - required: true - schema: - $ref: "#/definitions/AMBEDevices" - responses: - "200": - description: On success return list of devices - schema: - $ref: "#/definitions/AMBEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/serial: - x-swagger-router-controller: instance - get: - description: get a list of available serial interfaces to LimeRFE device - operationId: instanceLimeRFESerialGet - tags: - - Instance - responses: - "200": - description: On success return list of device paths possibly empty - schema: - $ref: "#/definitions/LimeRFEDevices" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/config: - x-swagger-router-controller: instance - get: - description: get LimeRFE configuration - operationId: instanceLimeRFEConfigGet - tags: - - Instance - parameters: - - name: serial - in: query - description: device serial path - required: true - type: string - responses: - "200": - description: On success return configuration information for the given device in input - schema: - $ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFESettings" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - put: - description: replace LimeRFE configuration - operationId: instanceLimeRFEConfigPut - tags: - - Instance - consumes: - - application/json - parameters: - - name: body - in: body - description: Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API. - required: true - schema: - $ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFESettings" - responses: - "200": - description: Success - schema: - $ref: "#/definitions/SuccessResponse" - "400": - description: Error - schema: - $ref: "#/definitions/ErrorResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/run: - x-swagger-router-controller: instance - put: - description: set Rx and Tx on or off - operationId: instanceLimeRFERunPut - tags: - - Instance - parameters: - - name: body - in: body - description: Give device serial path in devicePath field and run status in rxOn and txOn - required: true - schema: - $ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFESettings" - responses: - "200": - description: Success - schema: - $ref: "#/definitions/SuccessResponse" - "400": - description: Error - schema: - $ref: "#/definitions/ErrorResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - - /sdrangel/limerfe/power: - x-swagger-router-controller: instance - get: - description: get forward and reflected relative powers in centi-Bels - operationId: instanceLimeRFEPowerGet - tags: - - Instance - parameters: - - name: serial - in: query - description: device serial path - required: true - type: string - responses: - "200": - description: On success return forward and reflected powers in centi-Bels - schema: - $ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFEPower" - "400": - description: Error - schema: - $ref: "#/definitions/ErrorResponse" - "500": - $ref: "#/responses/Response_500" - "501": - $ref: "#/responses/Response_501" - /sdrangel/presets: x-swagger-router-controller: instance get: @@ -3433,51 +3217,6 @@ definitions: type: number format: float - DVSerialDevices: - description: "List of DV serial devices available in the system" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - dvSerialDevices: - description: "Device names of DV serial devices" - type: array - items: - $ref: "#/definitions/DVSerialDevice" - - DVSerialDevice: - description: "DV serial device details" - properties: - deviceName: - description: "Name of the serial device in the system" - type: string - - AMBEDevices: - description: "List of AMBE devices (serial or server address)" - required: - - nbDevices - properties: - nbDevices: - description: "Number of DV serial devices" - type: integer - ambeDevices: - description: "List of AMBE devices" - type: array - items: - $ref: "#/definitions/AMBEDevice" - - AMBEDevice: - description: "AMBE devices active in the system" - properties: - deviceRef: - description: "Serial device name or server address" - type: string - delete: - description: "1 if device is to be removed from active list" - type: integer - LimeRFEDevices: description: "List of LimeRFE devices (serial or server address)" required: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index b9bec83ab..120b8e2ef 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1248,6 +1248,19 @@ margin-bottom: 20px; } }, "description" : "AIS settings" +}; + defs.AMBEActions = { + "properties" : { + "updateDevices" : { + "description" : "Add or remove AMBE devices (serial or address) int the list to be used for AMBE frames processing", + "$ref" : "#/definitions/AMBEDevices" + }, + "removeAll" : { + "type" : "integer", + "description" : "Set to a non zero value to remove all AMBE devices from the list of used AMBE devices" + } + }, + "description" : "AMBE" }; defs.AMBEDevice = { "properties" : { @@ -1261,6 +1274,23 @@ margin-bottom: 20px; } }, "description" : "AMBE devices active in the system" +}; + defs.AMBEDeviceReport = { + "properties" : { + "devicePath" : { + "type" : "string", + "description" : "AMBE device full path or AMBE server URL" + }, + "successCount" : { + "type" : "integer", + "description" : "number of frames decoded successfully" + }, + "failureCount" : { + "type" : "integer", + "description" : "number of frames that failed to decode" + } + }, + "description" : "Report of AMBE device in use" }; defs.AMBEDevices = { "required" : [ "nbDevices" ], @@ -1278,6 +1308,52 @@ margin-bottom: 20px; } }, "description" : "List of AMBE devices (serial or server address)" +}; + defs.AMBEReport = { + "properties" : { + "serial" : { + "description" : "List of AMBE serial devices in the system", + "$ref" : "#/definitions/DVSerialDevices" + }, + "devices" : { + "type" : "array", + "description" : "List of AMBE devices or servers in use", + "items" : { + "$ref" : "#/definitions/AMBEDeviceReport" + } + } + }, + "description" : "AMBE" +}; + defs.AMBESettings = { + "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, + "useReverseAPI" : { + "type" : "integer", + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + }, + "rollupState" : { + "$ref" : "#/definitions/RollupState" + } + }, + "description" : "AMBE" }; defs.AMDemodReport = { "properties" : { @@ -4605,6 +4681,14 @@ margin-bottom: 20px; }, "rollupState" : { "$ref" : "#/definitions/RollupState" + }, + "ambeFeatureIndex" : { + "type" : "integer", + "description" : "index of AMBE controller feature to be used for AMBE frames decoding" + }, + "connectAMBE" : { + "type" : "integer", + "description" : "Decode frames with AMBE feature\n * 0 - Do not decode frames with AMBE feature\n * 1 - Decode frames with AMBE feature\n" } }, "description" : "DSDDemod" @@ -5270,9 +5354,15 @@ margin-bottom: 20px; "AFCActions" : { "$ref" : "#/definitions/AFCActions" }, + "AMBEActions" : { + "$ref" : "#/definitions/AMBEActions" + }, "GS232ControllerActions" : { "$ref" : "#/definitions/GS232ControllerActions" }, + "LimeRFEActions" : { + "$ref" : "#/definitions/LimeRFEActions" + }, "MapActions" : { "$ref" : "#/definitions/MapActions" }, @@ -5406,9 +5496,15 @@ margin-bottom: 20px; "AFCReport" : { "$ref" : "#/definitions/AFCReport" }, + "AMBEReport" : { + "$ref" : "#/definitions/AMBEReport" + }, "GS232ControllerReport" : { "$ref" : "#/definitions/GS232ControllerReport" }, + "LimeRFEReport" : { + "$ref" : "#/definitions/LimeRFEReport" + }, "MapReport" : { "$ref" : "#/definitions/MapReport" }, @@ -5489,6 +5585,9 @@ margin-bottom: 20px; "AISSettings" : { "$ref" : "#/definitions/AISSettings" }, + "AMBESettings" : { + "$ref" : "#/definitions/AMBESettings" + }, "AntennaToolsSettings" : { "$ref" : "#/definitions/AntennaToolsSettings" }, @@ -5504,6 +5603,9 @@ margin-bottom: 20px; "GS232ControllerSettings" : { "$ref" : "#/definitions/GS232ControllerSettings" }, + "LimeRFESettings" : { + "$ref" : "#/definitions/LimeRFESettings" + }, "MapSettings" : { "$ref" : "#/definitions/MapSettings" }, @@ -7069,6 +7171,34 @@ margin-bottom: 20px; } }, "description" : "KiwiSDR" +}; + defs.LimeRFEActions = { + "properties" : { + "selectChannel" : { + "type" : "integer", + "description" : "Select channel\n * 0 - Rx\n * 1 - Tx\n" + }, + "deviceSetIndex" : { + "type" : "integer" + }, + "switchChannel" : { + "type" : "integer", + "description" : "Switch on or off\n * 0 - Off\n * 1 - On\n" + }, + "getState" : { + "type" : "integer", + "description" : "Set to non zero value to get the board state" + }, + "fromToSettings" : { + "type" : "integer", + "description" : "Move from/to settings to/from device\n * 0 - From device to settings. The toGUI button in GUI mode\n * 1 - From settings to device. The Apply button in GUI mode\n" + }, + "openCloseDevice" : { + "type" : "integer", + "description" : "Open or close device\n * 0 - Close device\n * 1 - Open device\n" + } + }, + "description" : "LimeRFE" }; defs.LimeRFEDevice = { "properties" : { @@ -7096,21 +7226,35 @@ margin-bottom: 20px; }, "description" : "List of LimeRFE devices (serial or server address)" }; - defs.LimeRFEPower = { + defs.LimeRFEReport = { "properties" : { - "forward" : { + "rxOn" : { + "type" : "integer", + "description" : "Boolean 1 if Rx is active else 0" + }, + "txOn" : { + "type" : "integer", + "description" : "Boolean 1 if Tx is active else 0" + }, + "forwardPower" : { "type" : "integer", "description" : "relative forward power in centi-Bels" }, - "reflected" : { + "reflectedPower" : { "type" : "integer", "description" : "relative reflected power in centi-Bels" } }, - "description" : "report of forward and reflected power measurements" + "description" : "LimeRFE" }; defs.LimeRFESettings = { "properties" : { + "title" : { + "type" : "string" + }, + "rgbColor" : { + "type" : "integer" + }, "devicePath" : { "type" : "string", "description" : "Path to the device serial interface (ex /dev/ttyUSB2)" @@ -7170,13 +7314,28 @@ margin-bottom: 20px; "type" : "integer", "description" : "SWR measurement source (LimeRFEController::SWRSource)\n * 0 - External\n * 1 - Cellular\n" }, - "rxOn" : { + "txRxDriven" : { "type" : "integer", - "description" : "Boolean 1 if Rx is active else 0" + "description" : "Boolean 1 if Tx is copy of Rx else 0" }, - "txOn" : { + "useReverseAPI" : { "type" : "integer", - "description" : "Boolean 1 if Tx is active else 0" + "description" : "Synchronize with reverse API (1 for yes, 0 for no)" + }, + "reverseAPIAddress" : { + "type" : "string" + }, + "reverseAPIPort" : { + "type" : "integer" + }, + "reverseAPIFeatureSetIndex" : { + "type" : "integer" + }, + "reverseAPIFeatureIndex" : { + "type" : "integer" + }, + "rollupState" : { + "$ref" : "#/definitions/RollupState" } }, "description" : "LimeRFE" @@ -14642,21 +14801,6 @@ margin-bottom: 20px; featuresetPresetPut -
  • - instanceAMBEDevicesDelete -
  • -
  • - instanceAMBEDevicesGet -
  • -
  • - instanceAMBEDevicesPatch -
  • -
  • - instanceAMBEDevicesPut -
  • -
  • - instanceAMBESerialGet -
  • instanceAudioGet
  • @@ -14735,21 +14879,6 @@ margin-bottom: 20px;
  • instanceFeatures
  • -
  • - instanceLimeRFEConfigGet -
  • -
  • - instanceLimeRFEConfigPut -
  • -
  • - instanceLimeRFEPowerGet -
  • -
  • - instanceLimeRFERunPut -
  • -
  • - instanceLimeRFESerialGet -
  • instanceLocationGet
  • @@ -38785,1785 +38914,6 @@ $(document).ready(function() {

    Instance

    -
    -
    -
    -

    instanceAMBEDevicesDelete

    -

    -
    -
    -
    -

    -

    Emtpy the active devices thus effectively closing down AMBE devices support

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X DELETE "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesDelete");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesDeleteWithCompletionHandler: 
    -              ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesDelete(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesDeleteExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceAMBEDevicesDelete();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesDelete: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesDelete();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesDelete: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesDelete();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesDelete: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_delete()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesDelete: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - Success.

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesGet

    -

    -
    -
    -
    -

    -

    get the list of AMBE devices (serial or address) used for AMBE frames decoding in digital voice modes

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesGetWithCompletionHandler: 
    -              ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of devices possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPatch

    -

    -
    -
    -
    -

    -

    Add and/or delete devices to/from the active list

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PATCH "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPatch");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPatchWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPatch(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPatchExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPatch(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPatch: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPatch($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPatch: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPatch(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPatch: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_patch(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPatch: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBEDevicesPut

    -

    -
    -
    -
    -

    -

    Replace the list of active devices

    -

    -
    -
    /sdrangel/ambe/devices
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/ambe/devices"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        AMBEDevices body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -        try {
    -            AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBEDevicesPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    AMBEDevices *body = ; // List of AMBE devices (serial or address)
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBEDevicesPutWith:body
    -              completionHandler: ^(AMBEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {AMBEDevices} List of AMBE devices (serial or address)
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBEDevicesPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBEDevicesPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new AMBEDevices(); // AMBEDevices | List of AMBE devices (serial or address)
    -
    -            try
    -            {
    -                AMBEDevices result = apiInstance.instanceAMBEDevicesPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBEDevicesPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // AMBEDevices | List of AMBE devices (serial or address)
    -
    -try {
    -    $result = $api_instance->instanceAMBEDevicesPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBEDevicesPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::AMBEDevices->new(); # AMBEDevices | List of AMBE devices (serial or address)
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBEDevicesPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBEDevicesPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # AMBEDevices | List of AMBE devices (serial or address)
    -
    -try: 
    -    api_response = api_instance.instance_ambe_devices_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBEDevicesPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - On success return list of devices

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceAMBESerialGet

    -

    -
    -
    -
    -

    -

    get a list of available DV serial devices

    -

    -
    -
    /sdrangel/ambe/serial
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/ambe/serial"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceAMBESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceAMBESerialGetWithCompletionHandler: 
    -              ^(DVSerialDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceAMBESerialGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceAMBESerialGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                DVSerialDevices result = apiInstance.instanceAMBESerialGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceAMBESerialGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceAMBESerialGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceAMBESerialGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceAMBESerialGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceAMBESerialGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_ambe_serial_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceAMBESerialGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of device paths possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -51076,1994 +49426,6 @@ except ApiException as e:

    -
    -
    -
    -

    instanceLimeRFEConfigGet

    -

    -
    -
    -
    -

    -

    get LimeRFE configuration

    -

    -
    -
    /sdrangel/limerfe/config
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/limerfe/config?serial="
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFESettings result = apiInstance.instanceLimeRFEConfigGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFESettings result = apiInstance.instanceLimeRFEConfigGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    String *serial = serial_example; // device serial path
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFEConfigGetWith:serial
    -              completionHandler: ^(LimeRFESettings output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var serial = serial_example; // {String} device serial path
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFEConfigGet(serial, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFEConfigGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var serial = serial_example;  // String | device serial path
    -
    -            try
    -            {
    -                LimeRFESettings result = apiInstance.instanceLimeRFEConfigGet(serial);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFEConfigGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$serial = serial_example; // String | device serial path
    -
    -try {
    -    $result = $api_instance->instanceLimeRFEConfigGet($serial);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFEConfigGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $serial = serial_example; # String | device serial path
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFEConfigGet(serial => $serial);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFEConfigGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -serial = serial_example # String | device serial path
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_config_get(serial)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFEConfigGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - -
    NameDescription
    serial* - - -
    -
    -
    - - String - - -
    - device serial path -
    -
    -
    - Required -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - On success return configuration information for the given device in input

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFEConfigPut

    -

    -
    -
    -
    -

    -

    replace LimeRFE configuration

    -

    -
    -
    /sdrangel/limerfe/config
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/limerfe/config"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFEConfigPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFEConfigPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEConfigPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    LimeRFESettings *body = ; // Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFEConfigPutWith:body
    -              completionHandler: ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {LimeRFESettings} Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFEConfigPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFEConfigPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new LimeRFESettings(); // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceLimeRFEConfigPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFEConfigPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -try {
    -    $result = $api_instance->instanceLimeRFEConfigPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFEConfigPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::LimeRFESettings->new(); # LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFEConfigPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFEConfigPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # LimeRFESettings | Give device serial path in devicePath field. To switch Rx and/or Tx on or off use the run API.
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_config_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFEConfigPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFEPowerGet

    -

    -
    -
    -
    -

    -

    get forward and reflected relative powers in centi-Bels

    -

    -
    -
    /sdrangel/limerfe/power
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/limerfe/power?serial="
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFEPower result = apiInstance.instanceLimeRFEPowerGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEPowerGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        String serial = serial_example; // String | device serial path
    -        try {
    -            LimeRFEPower result = apiInstance.instanceLimeRFEPowerGet(serial);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFEPowerGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    String *serial = serial_example; // device serial path
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFEPowerGetWith:serial
    -              completionHandler: ^(LimeRFEPower output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var serial = serial_example; // {String} device serial path
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFEPowerGet(serial, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFEPowerGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var serial = serial_example;  // String | device serial path
    -
    -            try
    -            {
    -                LimeRFEPower result = apiInstance.instanceLimeRFEPowerGet(serial);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFEPowerGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$serial = serial_example; // String | device serial path
    -
    -try {
    -    $result = $api_instance->instanceLimeRFEPowerGet($serial);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFEPowerGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $serial = serial_example; # String | device serial path
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFEPowerGet(serial => $serial);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFEPowerGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -serial = serial_example # String | device serial path
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_power_get(serial)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFEPowerGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - -
    Query parameters
    - - - - - - - - - -
    NameDescription
    serial* - - -
    -
    -
    - - String - - -
    - device serial path -
    -
    -
    - Required -
    -
    -
    -
    - -

    Responses

    -

    Status: 200 - On success return forward and reflected powers in centi-Bels

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFERunPut

    -

    -
    -
    -
    -

    -

    set Rx and Tx on or off

    -

    -
    -
    /sdrangel/limerfe/run
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X PUT "http://localhost/sdrangel/limerfe/run"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFERunPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFERunPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        LimeRFESettings body = ; // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -        try {
    -            SuccessResponse result = apiInstance.instanceLimeRFERunPut(body);
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFERunPut");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    LimeRFESettings *body = ; // Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFERunPutWith:body
    -              completionHandler: ^(SuccessResponse output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var body = ; // {LimeRFESettings} Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFERunPut(body, callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFERunPutExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -            var body = new LimeRFESettings(); // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -            try
    -            {
    -                SuccessResponse result = apiInstance.instanceLimeRFERunPut(body);
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFERunPut: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -try {
    -    $result = $api_instance->instanceLimeRFERunPut($body);
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFERunPut: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::LimeRFESettings->new(); # LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFERunPut(body => $body);
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFERunPut: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -body =  # LimeRFESettings | Give device serial path in devicePath field and run status in rxOn and txOn
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_run_put(body)
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFERunPut: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - -
    Body parameters
    - - - - - - - - - -
    NameDescription
    body * - - - -
    -
    - - - -

    Responses

    -

    Status: 200 - Success

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 400 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -

    instanceLimeRFESerialGet

    -

    -
    -
    -
    -

    -

    get a list of available serial interfaces to LimeRFE device

    -

    -
    -
    /sdrangel/limerfe/serial
    -

    -

    Usage and SDK Samples

    -

    - - -
    -
    -
    curl -X GET "http://localhost/sdrangel/limerfe/serial"
    -
    -
    -
    import SWGSDRangel.*;
    -import SWGSDRangel.auth.*;
    -import SWGSDRangel.model.*;
    -import SWGSDRangel.api.InstanceApi;
    -
    -import java.io.File;
    -import java.util.*;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            LimeRFEDevices result = apiInstance.instanceLimeRFESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    import SWGSDRangel.api.InstanceApi;
    -
    -public class InstanceApiExample {
    -
    -    public static void main(String[] args) {
    -        InstanceApi apiInstance = new InstanceApi();
    -        try {
    -            LimeRFEDevices result = apiInstance.instanceLimeRFESerialGet();
    -            System.out.println(result);
    -        } catch (ApiException e) {
    -            System.err.println("Exception when calling InstanceApi#instanceLimeRFESerialGet");
    -            e.printStackTrace();
    -        }
    -    }
    -}
    -
    - -
    -
    
    -InstanceApi *apiInstance = [[InstanceApi alloc] init];
    -
    -[apiInstance instanceLimeRFESerialGetWithCompletionHandler: 
    -              ^(LimeRFEDevices output, NSError* error) {
    -                            if (output) {
    -                                NSLog(@"%@", output);
    -                            }
    -                            if (error) {
    -                                NSLog(@"Error: %@", error);
    -                            }
    -                        }];
    -
    -
    - -
    -
    var SdRangel = require('sd_rangel');
    -
    -var api = new SdRangel.InstanceApi()
    -
    -var callback = function(error, data, response) {
    -  if (error) {
    -    console.error(error);
    -  } else {
    -    console.log('API called successfully. Returned data: ' + data);
    -  }
    -};
    -api.instanceLimeRFESerialGet(callback);
    -
    -
    - - -
    -
    using System;
    -using System.Diagnostics;
    -using SWGSDRangel.Api;
    -using SWGSDRangel.Client;
    -using SWGSDRangel.Model;
    -
    -namespace Example
    -{
    -    public class instanceLimeRFESerialGetExample
    -    {
    -        public void main()
    -        {
    -            
    -            var apiInstance = new InstanceApi();
    -
    -            try
    -            {
    -                LimeRFEDevices result = apiInstance.instanceLimeRFESerialGet();
    -                Debug.WriteLine(result);
    -            }
    -            catch (Exception e)
    -            {
    -                Debug.Print("Exception when calling InstanceApi.instanceLimeRFESerialGet: " + e.Message );
    -            }
    -        }
    -    }
    -}
    -
    -
    - -
    -
    <?php
    -require_once(__DIR__ . '/vendor/autoload.php');
    -
    -$api_instance = new Swagger\Client\Api\InstanceApi();
    -
    -try {
    -    $result = $api_instance->instanceLimeRFESerialGet();
    -    print_r($result);
    -} catch (Exception $e) {
    -    echo 'Exception when calling InstanceApi->instanceLimeRFESerialGet: ', $e->getMessage(), PHP_EOL;
    -}
    -?>
    -
    - -
    -
    use Data::Dumper;
    -use SWGSDRangel::Configuration;
    -use SWGSDRangel::InstanceApi;
    -
    -my $api_instance = SWGSDRangel::InstanceApi->new();
    -
    -eval { 
    -    my $result = $api_instance->instanceLimeRFESerialGet();
    -    print Dumper($result);
    -};
    -if ($@) {
    -    warn "Exception when calling InstanceApi->instanceLimeRFESerialGet: $@\n";
    -}
    -
    - -
    -
    from __future__ import print_statement
    -import time
    -import swagger_sdrangel
    -from swagger_sdrangel.rest import ApiException
    -from pprint import pprint
    -
    -# create an instance of the API class
    -api_instance = swagger_sdrangel.InstanceApi()
    -
    -try: 
    -    api_response = api_instance.instance_lime_rfe_serial_get()
    -    pprint(api_response)
    -except ApiException as e:
    -    print("Exception when calling InstanceApi->instanceLimeRFESerialGet: %s\n" % e)
    -
    -
    - -

    Parameters

    - - - - - - -

    Responses

    -

    Status: 200 - On success return list of device paths possibly empty

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 500 - Error

    - - - -
    -
    -
    - -
    - -
    -
    - -

    Status: 501 - Function not implemented

    - - - -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    @@ -59698,7 +56060,7 @@ except ApiException as e:
    - Generated 2022-05-19T00:27:23.053+02:00 + Generated 2022-05-25T12:47:57.273+02:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFEPower.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp similarity index 60% rename from swagger/sdrangel/code/qt5/client/SWGLimeRFEPower.cpp rename to swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp index 9f936e750..3b1891dd0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGLimeRFEPower.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.cpp @@ -11,7 +11,7 @@ */ -#include "SWGLimeRFEPower.h" +#include "SWGAMBEActions.h" #include "SWGHelpers.h" @@ -22,38 +22,40 @@ namespace SWGSDRangel { -SWGLimeRFEPower::SWGLimeRFEPower(QString* json) { +SWGAMBEActions::SWGAMBEActions(QString* json) { init(); this->fromJson(*json); } -SWGLimeRFEPower::SWGLimeRFEPower() { - forward = 0; - m_forward_isSet = false; - reflected = 0; - m_reflected_isSet = false; +SWGAMBEActions::SWGAMBEActions() { + update_devices = nullptr; + m_update_devices_isSet = false; + remove_all = 0; + m_remove_all_isSet = false; } -SWGLimeRFEPower::~SWGLimeRFEPower() { +SWGAMBEActions::~SWGAMBEActions() { this->cleanup(); } void -SWGLimeRFEPower::init() { - forward = 0; - m_forward_isSet = false; - reflected = 0; - m_reflected_isSet = false; +SWGAMBEActions::init() { + update_devices = new SWGAMBEDevices(); + m_update_devices_isSet = false; + remove_all = 0; + m_remove_all_isSet = false; } void -SWGLimeRFEPower::cleanup() { - +SWGAMBEActions::cleanup() { + if(update_devices != nullptr) { + delete update_devices; + } } -SWGLimeRFEPower* -SWGLimeRFEPower::fromJson(QString &json) { +SWGAMBEActions* +SWGAMBEActions::fromJson(QString &json) { QByteArray array (json.toStdString().c_str()); QJsonDocument doc = QJsonDocument::fromJson(array); QJsonObject jsonObject = doc.object(); @@ -62,15 +64,15 @@ SWGLimeRFEPower::fromJson(QString &json) { } void -SWGLimeRFEPower::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&forward, pJson["forward"], "qint32", ""); +SWGAMBEActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&update_devices, pJson["updateDevices"], "SWGAMBEDevices", "SWGAMBEDevices"); - ::SWGSDRangel::setValue(&reflected, pJson["reflected"], "qint32", ""); + ::SWGSDRangel::setValue(&remove_all, pJson["removeAll"], "qint32", ""); } QString -SWGLimeRFEPower::asJson () +SWGAMBEActions::asJson () { QJsonObject* obj = this->asJsonObject(); @@ -81,47 +83,47 @@ SWGLimeRFEPower::asJson () } QJsonObject* -SWGLimeRFEPower::asJsonObject() { +SWGAMBEActions::asJsonObject() { QJsonObject* obj = new QJsonObject(); - if(m_forward_isSet){ - obj->insert("forward", QJsonValue(forward)); + if((update_devices != nullptr) && (update_devices->isSet())){ + toJsonValue(QString("updateDevices"), update_devices, obj, QString("SWGAMBEDevices")); } - if(m_reflected_isSet){ - obj->insert("reflected", QJsonValue(reflected)); + if(m_remove_all_isSet){ + obj->insert("removeAll", QJsonValue(remove_all)); } return obj; } -qint32 -SWGLimeRFEPower::getForward() { - return forward; +SWGAMBEDevices* +SWGAMBEActions::getUpdateDevices() { + return update_devices; } void -SWGLimeRFEPower::setForward(qint32 forward) { - this->forward = forward; - this->m_forward_isSet = true; +SWGAMBEActions::setUpdateDevices(SWGAMBEDevices* update_devices) { + this->update_devices = update_devices; + this->m_update_devices_isSet = true; } qint32 -SWGLimeRFEPower::getReflected() { - return reflected; +SWGAMBEActions::getRemoveAll() { + return remove_all; } void -SWGLimeRFEPower::setReflected(qint32 reflected) { - this->reflected = reflected; - this->m_reflected_isSet = true; +SWGAMBEActions::setRemoveAll(qint32 remove_all) { + this->remove_all = remove_all; + this->m_remove_all_isSet = true; } bool -SWGLimeRFEPower::isSet(){ +SWGAMBEActions::isSet(){ bool isObjectUpdated = false; do{ - if(m_forward_isSet){ + if(update_devices && update_devices->isSet()){ isObjectUpdated = true; break; } - if(m_reflected_isSet){ + if(m_remove_all_isSet){ isObjectUpdated = true; break; } }while(false); diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFEPower.h b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h similarity index 75% rename from swagger/sdrangel/code/qt5/client/SWGLimeRFEPower.h rename to swagger/sdrangel/code/qt5/client/SWGAMBEActions.h index fce159f3b..6ef64370d 100644 --- a/swagger/sdrangel/code/qt5/client/SWGLimeRFEPower.h +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEActions.h @@ -11,54 +11,55 @@ */ /* - * SWGLimeRFEPower.h + * SWGAMBEActions.h * - * report of forward and reflected power measurements + * AMBE */ -#ifndef SWGLimeRFEPower_H_ -#define SWGLimeRFEPower_H_ +#ifndef SWGAMBEActions_H_ +#define SWGAMBEActions_H_ #include +#include "SWGAMBEDevices.h" #include "SWGObject.h" #include "export.h" namespace SWGSDRangel { -class SWG_API SWGLimeRFEPower: public SWGObject { +class SWG_API SWGAMBEActions: public SWGObject { public: - SWGLimeRFEPower(); - SWGLimeRFEPower(QString* json); - virtual ~SWGLimeRFEPower(); + SWGAMBEActions(); + SWGAMBEActions(QString* json); + virtual ~SWGAMBEActions(); void init(); void cleanup(); virtual QString asJson () override; virtual QJsonObject* asJsonObject() override; virtual void fromJsonObject(QJsonObject &json) override; - virtual SWGLimeRFEPower* fromJson(QString &jsonString) override; + virtual SWGAMBEActions* fromJson(QString &jsonString) override; - qint32 getForward(); - void setForward(qint32 forward); + SWGAMBEDevices* getUpdateDevices(); + void setUpdateDevices(SWGAMBEDevices* update_devices); - qint32 getReflected(); - void setReflected(qint32 reflected); + qint32 getRemoveAll(); + void setRemoveAll(qint32 remove_all); virtual bool isSet() override; private: - qint32 forward; - bool m_forward_isSet; + SWGAMBEDevices* update_devices; + bool m_update_devices_isSet; - qint32 reflected; - bool m_reflected_isSet; + qint32 remove_all; + bool m_remove_all_isSet; }; } -#endif /* SWGLimeRFEPower_H_ */ +#endif /* SWGAMBEActions_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp new file mode 100644 index 000000000..5b750967e --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.cpp @@ -0,0 +1,156 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGAMBEDeviceReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBEDeviceReport::SWGAMBEDeviceReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBEDeviceReport::SWGAMBEDeviceReport() { + device_path = nullptr; + m_device_path_isSet = false; + success_count = 0; + m_success_count_isSet = false; + failure_count = 0; + m_failure_count_isSet = false; +} + +SWGAMBEDeviceReport::~SWGAMBEDeviceReport() { + this->cleanup(); +} + +void +SWGAMBEDeviceReport::init() { + device_path = new QString(""); + m_device_path_isSet = false; + success_count = 0; + m_success_count_isSet = false; + failure_count = 0; + m_failure_count_isSet = false; +} + +void +SWGAMBEDeviceReport::cleanup() { + if(device_path != nullptr) { + delete device_path; + } + + +} + +SWGAMBEDeviceReport* +SWGAMBEDeviceReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBEDeviceReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&device_path, pJson["devicePath"], "QString", "QString"); + + ::SWGSDRangel::setValue(&success_count, pJson["successCount"], "qint32", ""); + + ::SWGSDRangel::setValue(&failure_count, pJson["failureCount"], "qint32", ""); + +} + +QString +SWGAMBEDeviceReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBEDeviceReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(device_path != nullptr && *device_path != QString("")){ + toJsonValue(QString("devicePath"), device_path, obj, QString("QString")); + } + if(m_success_count_isSet){ + obj->insert("successCount", QJsonValue(success_count)); + } + if(m_failure_count_isSet){ + obj->insert("failureCount", QJsonValue(failure_count)); + } + + return obj; +} + +QString* +SWGAMBEDeviceReport::getDevicePath() { + return device_path; +} +void +SWGAMBEDeviceReport::setDevicePath(QString* device_path) { + this->device_path = device_path; + this->m_device_path_isSet = true; +} + +qint32 +SWGAMBEDeviceReport::getSuccessCount() { + return success_count; +} +void +SWGAMBEDeviceReport::setSuccessCount(qint32 success_count) { + this->success_count = success_count; + this->m_success_count_isSet = true; +} + +qint32 +SWGAMBEDeviceReport::getFailureCount() { + return failure_count; +} +void +SWGAMBEDeviceReport::setFailureCount(qint32 failure_count) { + this->failure_count = failure_count; + this->m_failure_count_isSet = true; +} + + +bool +SWGAMBEDeviceReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(device_path && *device_path != QString("")){ + isObjectUpdated = true; break; + } + if(m_success_count_isSet){ + isObjectUpdated = true; break; + } + if(m_failure_count_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h new file mode 100644 index 000000000..ea3614186 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEDeviceReport.h @@ -0,0 +1,71 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGAMBEDeviceReport.h + * + * Report of AMBE device in use + */ + +#ifndef SWGAMBEDeviceReport_H_ +#define SWGAMBEDeviceReport_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBEDeviceReport: public SWGObject { +public: + SWGAMBEDeviceReport(); + SWGAMBEDeviceReport(QString* json); + virtual ~SWGAMBEDeviceReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBEDeviceReport* fromJson(QString &jsonString) override; + + QString* getDevicePath(); + void setDevicePath(QString* device_path); + + qint32 getSuccessCount(); + void setSuccessCount(qint32 success_count); + + qint32 getFailureCount(); + void setFailureCount(qint32 failure_count); + + + virtual bool isSet() override; + +private: + QString* device_path; + bool m_device_path_isSet; + + qint32 success_count; + bool m_success_count_isSet; + + qint32 failure_count; + bool m_failure_count_isSet; + +}; + +} + +#endif /* SWGAMBEDeviceReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp new file mode 100644 index 000000000..ae3c88090 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.cpp @@ -0,0 +1,139 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGAMBEReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBEReport::SWGAMBEReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBEReport::SWGAMBEReport() { + serial = nullptr; + m_serial_isSet = false; + devices = nullptr; + m_devices_isSet = false; +} + +SWGAMBEReport::~SWGAMBEReport() { + this->cleanup(); +} + +void +SWGAMBEReport::init() { + serial = new SWGDVSerialDevices(); + m_serial_isSet = false; + devices = new QList(); + m_devices_isSet = false; +} + +void +SWGAMBEReport::cleanup() { + if(serial != nullptr) { + delete serial; + } + if(devices != nullptr) { + auto arr = devices; + for(auto o: *arr) { + delete o; + } + delete devices; + } +} + +SWGAMBEReport* +SWGAMBEReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBEReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&serial, pJson["serial"], "SWGDVSerialDevices", "SWGDVSerialDevices"); + + + ::SWGSDRangel::setValue(&devices, pJson["devices"], "QList", "SWGAMBEDeviceReport"); +} + +QString +SWGAMBEReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBEReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if((serial != nullptr) && (serial->isSet())){ + toJsonValue(QString("serial"), serial, obj, QString("SWGDVSerialDevices")); + } + if(devices && devices->size() > 0){ + toJsonArray((QList*)devices, obj, "devices", "SWGAMBEDeviceReport"); + } + + return obj; +} + +SWGDVSerialDevices* +SWGAMBEReport::getSerial() { + return serial; +} +void +SWGAMBEReport::setSerial(SWGDVSerialDevices* serial) { + this->serial = serial; + this->m_serial_isSet = true; +} + +QList* +SWGAMBEReport::getDevices() { + return devices; +} +void +SWGAMBEReport::setDevices(QList* devices) { + this->devices = devices; + this->m_devices_isSet = true; +} + + +bool +SWGAMBEReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(serial && serial->isSet()){ + isObjectUpdated = true; break; + } + if(devices && (devices->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h new file mode 100644 index 000000000..2471dfddd --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBEReport.h @@ -0,0 +1,67 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGAMBEReport.h + * + * AMBE + */ + +#ifndef SWGAMBEReport_H_ +#define SWGAMBEReport_H_ + +#include + + +#include "SWGAMBEDeviceReport.h" +#include "SWGDVSerialDevices.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBEReport: public SWGObject { +public: + SWGAMBEReport(); + SWGAMBEReport(QString* json); + virtual ~SWGAMBEReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBEReport* fromJson(QString &jsonString) override; + + SWGDVSerialDevices* getSerial(); + void setSerial(SWGDVSerialDevices* serial); + + QList* getDevices(); + void setDevices(QList* devices); + + + virtual bool isSet() override; + +private: + SWGDVSerialDevices* serial; + bool m_serial_isSet; + + QList* devices; + bool m_devices_isSet; + +}; + +} + +#endif /* SWGAMBEReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBESettings.cpp b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.cpp new file mode 100644 index 000000000..7f70bf550 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.cpp @@ -0,0 +1,275 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGAMBESettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGAMBESettings::SWGAMBESettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGAMBESettings::SWGAMBESettings() { + title = nullptr; + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_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_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; + rollup_state = nullptr; + m_rollup_state_isSet = false; +} + +SWGAMBESettings::~SWGAMBESettings() { + this->cleanup(); +} + +void +SWGAMBESettings::init() { + title = new QString(""); + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_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_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; + rollup_state = new SWGRollupState(); + m_rollup_state_isSet = false; +} + +void +SWGAMBESettings::cleanup() { + if(title != nullptr) { + delete title; + } + + + if(reverse_api_address != nullptr) { + delete reverse_api_address; + } + + + + if(rollup_state != nullptr) { + delete rollup_state; + } +} + +SWGAMBESettings* +SWGAMBESettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGAMBESettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + + ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); + + ::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_feature_set_index, pJson["reverseAPIFeatureSetIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_feature_index, pJson["reverseAPIFeatureIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState"); + +} + +QString +SWGAMBESettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGAMBESettings::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(title != nullptr && *title != QString("")){ + toJsonValue(QString("title"), title, obj, QString("QString")); + } + if(m_rgb_color_isSet){ + obj->insert("rgbColor", QJsonValue(rgb_color)); + } + 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_feature_set_index_isSet){ + obj->insert("reverseAPIFeatureSetIndex", QJsonValue(reverse_api_feature_set_index)); + } + if(m_reverse_api_feature_index_isSet){ + obj->insert("reverseAPIFeatureIndex", QJsonValue(reverse_api_feature_index)); + } + if((rollup_state != nullptr) && (rollup_state->isSet())){ + toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState")); + } + + return obj; +} + +QString* +SWGAMBESettings::getTitle() { + return title; +} +void +SWGAMBESettings::setTitle(QString* title) { + this->title = title; + this->m_title_isSet = true; +} + +qint32 +SWGAMBESettings::getRgbColor() { + return rgb_color; +} +void +SWGAMBESettings::setRgbColor(qint32 rgb_color) { + this->rgb_color = rgb_color; + this->m_rgb_color_isSet = true; +} + +qint32 +SWGAMBESettings::getUseReverseApi() { + return use_reverse_api; +} +void +SWGAMBESettings::setUseReverseApi(qint32 use_reverse_api) { + this->use_reverse_api = use_reverse_api; + this->m_use_reverse_api_isSet = true; +} + +QString* +SWGAMBESettings::getReverseApiAddress() { + return reverse_api_address; +} +void +SWGAMBESettings::setReverseApiAddress(QString* reverse_api_address) { + this->reverse_api_address = reverse_api_address; + this->m_reverse_api_address_isSet = true; +} + +qint32 +SWGAMBESettings::getReverseApiPort() { + return reverse_api_port; +} +void +SWGAMBESettings::setReverseApiPort(qint32 reverse_api_port) { + this->reverse_api_port = reverse_api_port; + this->m_reverse_api_port_isSet = true; +} + +qint32 +SWGAMBESettings::getReverseApiFeatureSetIndex() { + return reverse_api_feature_set_index; +} +void +SWGAMBESettings::setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index) { + this->reverse_api_feature_set_index = reverse_api_feature_set_index; + this->m_reverse_api_feature_set_index_isSet = true; +} + +qint32 +SWGAMBESettings::getReverseApiFeatureIndex() { + return reverse_api_feature_index; +} +void +SWGAMBESettings::setReverseApiFeatureIndex(qint32 reverse_api_feature_index) { + this->reverse_api_feature_index = reverse_api_feature_index; + this->m_reverse_api_feature_index_isSet = true; +} + +SWGRollupState* +SWGAMBESettings::getRollupState() { + return rollup_state; +} +void +SWGAMBESettings::setRollupState(SWGRollupState* rollup_state) { + this->rollup_state = rollup_state; + this->m_rollup_state_isSet = true; +} + + +bool +SWGAMBESettings::isSet(){ + bool isObjectUpdated = false; + do{ + if(title && *title != QString("")){ + isObjectUpdated = true; break; + } + if(m_rgb_color_isSet){ + isObjectUpdated = true; break; + } + if(m_use_reverse_api_isSet){ + isObjectUpdated = true; break; + } + if(reverse_api_address && *reverse_api_address != QString("")){ + isObjectUpdated = true; break; + } + if(m_reverse_api_port_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_feature_set_index_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_feature_index_isSet){ + isObjectUpdated = true; break; + } + if(rollup_state && rollup_state->isSet()){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGAMBESettings.h b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.h new file mode 100644 index 000000000..36961d06a --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGAMBESettings.h @@ -0,0 +1,102 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGAMBESettings.h + * + * AMBE + */ + +#ifndef SWGAMBESettings_H_ +#define SWGAMBESettings_H_ + +#include + + +#include "SWGRollupState.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGAMBESettings: public SWGObject { +public: + SWGAMBESettings(); + SWGAMBESettings(QString* json); + virtual ~SWGAMBESettings(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGAMBESettings* fromJson(QString &jsonString) override; + + QString* getTitle(); + void setTitle(QString* title); + + qint32 getRgbColor(); + void setRgbColor(qint32 rgb_color); + + 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 getReverseApiFeatureSetIndex(); + void setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index); + + qint32 getReverseApiFeatureIndex(); + void setReverseApiFeatureIndex(qint32 reverse_api_feature_index); + + SWGRollupState* getRollupState(); + void setRollupState(SWGRollupState* rollup_state); + + + virtual bool isSet() override; + +private: + QString* title; + bool m_title_isSet; + + qint32 rgb_color; + bool m_rgb_color_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_feature_set_index; + bool m_reverse_api_feature_set_index_isSet; + + qint32 reverse_api_feature_index; + bool m_reverse_api_feature_index_isSet; + + SWGRollupState* rollup_state; + bool m_rollup_state_isSet; + +}; + +} + +#endif /* SWGAMBESettings_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.cpp index 87ff0024f..53d735f50 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.cpp @@ -88,6 +88,10 @@ SWGDSDDemodSettings::SWGDSDDemodSettings() { m_channel_marker_isSet = false; rollup_state = nullptr; m_rollup_state_isSet = false; + ambe_feature_index = 0; + m_ambe_feature_index_isSet = false; + connect_ambe = 0; + m_connect_ambe_isSet = false; } SWGDSDDemodSettings::~SWGDSDDemodSettings() { @@ -156,6 +160,10 @@ SWGDSDDemodSettings::init() { m_channel_marker_isSet = false; rollup_state = new SWGRollupState(); m_rollup_state_isSet = false; + ambe_feature_index = 0; + m_ambe_feature_index_isSet = false; + connect_ambe = 0; + m_connect_ambe_isSet = false; } void @@ -200,6 +208,8 @@ SWGDSDDemodSettings::cleanup() { if(rollup_state != nullptr) { delete rollup_state; } + + } SWGDSDDemodSettings* @@ -273,6 +283,10 @@ SWGDSDDemodSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState"); + ::SWGSDRangel::setValue(&ambe_feature_index, pJson["ambeFeatureIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&connect_ambe, pJson["connectAMBE"], "qint32", ""); + } QString @@ -379,6 +393,12 @@ SWGDSDDemodSettings::asJsonObject() { if((rollup_state != nullptr) && (rollup_state->isSet())){ toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState")); } + if(m_ambe_feature_index_isSet){ + obj->insert("ambeFeatureIndex", QJsonValue(ambe_feature_index)); + } + if(m_connect_ambe_isSet){ + obj->insert("connectAMBE", QJsonValue(connect_ambe)); + } return obj; } @@ -683,6 +703,26 @@ SWGDSDDemodSettings::setRollupState(SWGRollupState* rollup_state) { this->m_rollup_state_isSet = true; } +qint32 +SWGDSDDemodSettings::getAmbeFeatureIndex() { + return ambe_feature_index; +} +void +SWGDSDDemodSettings::setAmbeFeatureIndex(qint32 ambe_feature_index) { + this->ambe_feature_index = ambe_feature_index; + this->m_ambe_feature_index_isSet = true; +} + +qint32 +SWGDSDDemodSettings::getConnectAmbe() { + return connect_ambe; +} +void +SWGDSDDemodSettings::setConnectAmbe(qint32 connect_ambe) { + this->connect_ambe = connect_ambe; + this->m_connect_ambe_isSet = true; +} + bool SWGDSDDemodSettings::isSet(){ @@ -778,6 +818,12 @@ SWGDSDDemodSettings::isSet(){ if(rollup_state && rollup_state->isSet()){ isObjectUpdated = true; break; } + if(m_ambe_feature_index_isSet){ + isObjectUpdated = true; break; + } + if(m_connect_ambe_isSet){ + isObjectUpdated = true; break; + } }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.h b/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.h index 187574bbe..5e5a9b628 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGDSDDemodSettings.h @@ -134,6 +134,12 @@ public: SWGRollupState* getRollupState(); void setRollupState(SWGRollupState* rollup_state); + qint32 getAmbeFeatureIndex(); + void setAmbeFeatureIndex(qint32 ambe_feature_index); + + qint32 getConnectAmbe(); + void setConnectAmbe(qint32 connect_ambe); + virtual bool isSet() override; @@ -228,6 +234,12 @@ private: SWGRollupState* rollup_state; bool m_rollup_state_isSet; + qint32 ambe_feature_index; + bool m_ambe_feature_index_isSet; + + qint32 connect_ambe; + bool m_connect_ambe_isSet; + }; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp index 7b2a0f520..c6567fdd6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.cpp @@ -36,8 +36,12 @@ SWGFeatureActions::SWGFeatureActions() { m_originator_feature_index_isSet = false; afc_actions = nullptr; m_afc_actions_isSet = false; + ambe_actions = nullptr; + m_ambe_actions_isSet = false; gs232_controller_actions = nullptr; m_gs232_controller_actions_isSet = false; + lime_rfe_actions = nullptr; + m_lime_rfe_actions_isSet = false; map_actions = nullptr; m_map_actions_isSet = false; per_tester_actions = nullptr; @@ -68,8 +72,12 @@ SWGFeatureActions::init() { m_originator_feature_index_isSet = false; afc_actions = new SWGAFCActions(); m_afc_actions_isSet = false; + ambe_actions = new SWGAMBEActions(); + m_ambe_actions_isSet = false; gs232_controller_actions = new SWGGS232ControllerActions(); m_gs232_controller_actions_isSet = false; + lime_rfe_actions = new SWGLimeRFEActions(); + m_lime_rfe_actions_isSet = false; map_actions = new SWGMapActions(); m_map_actions_isSet = false; per_tester_actions = new SWGPERTesterActions(); @@ -96,9 +104,15 @@ SWGFeatureActions::cleanup() { if(afc_actions != nullptr) { delete afc_actions; } + if(ambe_actions != nullptr) { + delete ambe_actions; + } if(gs232_controller_actions != nullptr) { delete gs232_controller_actions; } + if(lime_rfe_actions != nullptr) { + delete lime_rfe_actions; + } if(map_actions != nullptr) { delete map_actions; } @@ -141,8 +155,12 @@ SWGFeatureActions::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&afc_actions, pJson["AFCActions"], "SWGAFCActions", "SWGAFCActions"); + ::SWGSDRangel::setValue(&ambe_actions, pJson["AMBEActions"], "SWGAMBEActions", "SWGAMBEActions"); + ::SWGSDRangel::setValue(&gs232_controller_actions, pJson["GS232ControllerActions"], "SWGGS232ControllerActions", "SWGGS232ControllerActions"); + ::SWGSDRangel::setValue(&lime_rfe_actions, pJson["LimeRFEActions"], "SWGLimeRFEActions", "SWGLimeRFEActions"); + ::SWGSDRangel::setValue(&map_actions, pJson["MapActions"], "SWGMapActions", "SWGMapActions"); ::SWGSDRangel::setValue(&per_tester_actions, pJson["PERTesterActions"], "SWGPERTesterActions", "SWGPERTesterActions"); @@ -185,9 +203,15 @@ SWGFeatureActions::asJsonObject() { if((afc_actions != nullptr) && (afc_actions->isSet())){ toJsonValue(QString("AFCActions"), afc_actions, obj, QString("SWGAFCActions")); } + if((ambe_actions != nullptr) && (ambe_actions->isSet())){ + toJsonValue(QString("AMBEActions"), ambe_actions, obj, QString("SWGAMBEActions")); + } if((gs232_controller_actions != nullptr) && (gs232_controller_actions->isSet())){ toJsonValue(QString("GS232ControllerActions"), gs232_controller_actions, obj, QString("SWGGS232ControllerActions")); } + if((lime_rfe_actions != nullptr) && (lime_rfe_actions->isSet())){ + toJsonValue(QString("LimeRFEActions"), lime_rfe_actions, obj, QString("SWGLimeRFEActions")); + } if((map_actions != nullptr) && (map_actions->isSet())){ toJsonValue(QString("MapActions"), map_actions, obj, QString("SWGMapActions")); } @@ -253,6 +277,16 @@ SWGFeatureActions::setAfcActions(SWGAFCActions* afc_actions) { this->m_afc_actions_isSet = true; } +SWGAMBEActions* +SWGFeatureActions::getAmbeActions() { + return ambe_actions; +} +void +SWGFeatureActions::setAmbeActions(SWGAMBEActions* ambe_actions) { + this->ambe_actions = ambe_actions; + this->m_ambe_actions_isSet = true; +} + SWGGS232ControllerActions* SWGFeatureActions::getGs232ControllerActions() { return gs232_controller_actions; @@ -263,6 +297,16 @@ SWGFeatureActions::setGs232ControllerActions(SWGGS232ControllerActions* gs232_co this->m_gs232_controller_actions_isSet = true; } +SWGLimeRFEActions* +SWGFeatureActions::getLimeRfeActions() { + return lime_rfe_actions; +} +void +SWGFeatureActions::setLimeRfeActions(SWGLimeRFEActions* lime_rfe_actions) { + this->lime_rfe_actions = lime_rfe_actions; + this->m_lime_rfe_actions_isSet = true; +} + SWGMapActions* SWGFeatureActions::getMapActions() { return map_actions; @@ -350,9 +394,15 @@ SWGFeatureActions::isSet(){ if(afc_actions && afc_actions->isSet()){ isObjectUpdated = true; break; } + if(ambe_actions && ambe_actions->isSet()){ + isObjectUpdated = true; break; + } if(gs232_controller_actions && gs232_controller_actions->isSet()){ isObjectUpdated = true; break; } + if(lime_rfe_actions && lime_rfe_actions->isSet()){ + isObjectUpdated = true; break; + } if(map_actions && map_actions->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h index 16c3dc97b..50f7f4b2a 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureActions.h @@ -23,7 +23,9 @@ #include "SWGAFCActions.h" +#include "SWGAMBEActions.h" #include "SWGGS232ControllerActions.h" +#include "SWGLimeRFEActions.h" #include "SWGMapActions.h" #include "SWGPERTesterActions.h" #include "SWGRigCtlServerActions.h" @@ -63,9 +65,15 @@ public: SWGAFCActions* getAfcActions(); void setAfcActions(SWGAFCActions* afc_actions); + SWGAMBEActions* getAmbeActions(); + void setAmbeActions(SWGAMBEActions* ambe_actions); + SWGGS232ControllerActions* getGs232ControllerActions(); void setGs232ControllerActions(SWGGS232ControllerActions* gs232_controller_actions); + SWGLimeRFEActions* getLimeRfeActions(); + void setLimeRfeActions(SWGLimeRFEActions* lime_rfe_actions); + SWGMapActions* getMapActions(); void setMapActions(SWGMapActions* map_actions); @@ -103,9 +111,15 @@ private: SWGAFCActions* afc_actions; bool m_afc_actions_isSet; + SWGAMBEActions* ambe_actions; + bool m_ambe_actions_isSet; + SWGGS232ControllerActions* gs232_controller_actions; bool m_gs232_controller_actions_isSet; + SWGLimeRFEActions* lime_rfe_actions; + bool m_lime_rfe_actions_isSet; + SWGMapActions* map_actions; bool m_map_actions_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp index 20adc1677..087a514f0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.cpp @@ -32,8 +32,12 @@ SWGFeatureReport::SWGFeatureReport() { m_feature_type_isSet = false; afc_report = nullptr; m_afc_report_isSet = false; + ambe_report = nullptr; + m_ambe_report_isSet = false; gs232_controller_report = nullptr; m_gs232_controller_report_isSet = false; + lime_rfe_report = nullptr; + m_lime_rfe_report_isSet = false; map_report = nullptr; m_map_report_isSet = false; per_tester_report = nullptr; @@ -60,8 +64,12 @@ SWGFeatureReport::init() { m_feature_type_isSet = false; afc_report = new SWGAFCReport(); m_afc_report_isSet = false; + ambe_report = new SWGAMBEReport(); + m_ambe_report_isSet = false; gs232_controller_report = new SWGGS232ControllerReport(); m_gs232_controller_report_isSet = false; + lime_rfe_report = new SWGLimeRFEReport(); + m_lime_rfe_report_isSet = false; map_report = new SWGMapReport(); m_map_report_isSet = false; per_tester_report = new SWGPERTesterReport(); @@ -86,9 +94,15 @@ SWGFeatureReport::cleanup() { if(afc_report != nullptr) { delete afc_report; } + if(ambe_report != nullptr) { + delete ambe_report; + } if(gs232_controller_report != nullptr) { delete gs232_controller_report; } + if(lime_rfe_report != nullptr) { + delete lime_rfe_report; + } if(map_report != nullptr) { delete map_report; } @@ -127,8 +141,12 @@ SWGFeatureReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&afc_report, pJson["AFCReport"], "SWGAFCReport", "SWGAFCReport"); + ::SWGSDRangel::setValue(&ambe_report, pJson["AMBEReport"], "SWGAMBEReport", "SWGAMBEReport"); + ::SWGSDRangel::setValue(&gs232_controller_report, pJson["GS232ControllerReport"], "SWGGS232ControllerReport", "SWGGS232ControllerReport"); + ::SWGSDRangel::setValue(&lime_rfe_report, pJson["LimeRFEReport"], "SWGLimeRFEReport", "SWGLimeRFEReport"); + ::SWGSDRangel::setValue(&map_report, pJson["MapReport"], "SWGMapReport", "SWGMapReport"); ::SWGSDRangel::setValue(&per_tester_report, pJson["PERTesterReport"], "SWGPERTesterReport", "SWGPERTesterReport"); @@ -165,9 +183,15 @@ SWGFeatureReport::asJsonObject() { if((afc_report != nullptr) && (afc_report->isSet())){ toJsonValue(QString("AFCReport"), afc_report, obj, QString("SWGAFCReport")); } + if((ambe_report != nullptr) && (ambe_report->isSet())){ + toJsonValue(QString("AMBEReport"), ambe_report, obj, QString("SWGAMBEReport")); + } if((gs232_controller_report != nullptr) && (gs232_controller_report->isSet())){ toJsonValue(QString("GS232ControllerReport"), gs232_controller_report, obj, QString("SWGGS232ControllerReport")); } + if((lime_rfe_report != nullptr) && (lime_rfe_report->isSet())){ + toJsonValue(QString("LimeRFEReport"), lime_rfe_report, obj, QString("SWGLimeRFEReport")); + } if((map_report != nullptr) && (map_report->isSet())){ toJsonValue(QString("MapReport"), map_report, obj, QString("SWGMapReport")); } @@ -213,6 +237,16 @@ SWGFeatureReport::setAfcReport(SWGAFCReport* afc_report) { this->m_afc_report_isSet = true; } +SWGAMBEReport* +SWGFeatureReport::getAmbeReport() { + return ambe_report; +} +void +SWGFeatureReport::setAmbeReport(SWGAMBEReport* ambe_report) { + this->ambe_report = ambe_report; + this->m_ambe_report_isSet = true; +} + SWGGS232ControllerReport* SWGFeatureReport::getGs232ControllerReport() { return gs232_controller_report; @@ -223,6 +257,16 @@ SWGFeatureReport::setGs232ControllerReport(SWGGS232ControllerReport* gs232_contr this->m_gs232_controller_report_isSet = true; } +SWGLimeRFEReport* +SWGFeatureReport::getLimeRfeReport() { + return lime_rfe_report; +} +void +SWGFeatureReport::setLimeRfeReport(SWGLimeRFEReport* lime_rfe_report) { + this->lime_rfe_report = lime_rfe_report; + this->m_lime_rfe_report_isSet = true; +} + SWGMapReport* SWGFeatureReport::getMapReport() { return map_report; @@ -304,9 +348,15 @@ SWGFeatureReport::isSet(){ if(afc_report && afc_report->isSet()){ isObjectUpdated = true; break; } + if(ambe_report && ambe_report->isSet()){ + isObjectUpdated = true; break; + } if(gs232_controller_report && gs232_controller_report->isSet()){ isObjectUpdated = true; break; } + if(lime_rfe_report && lime_rfe_report->isSet()){ + isObjectUpdated = true; break; + } if(map_report && map_report->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h index 00267e15c..563e26163 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureReport.h @@ -23,7 +23,9 @@ #include "SWGAFCReport.h" +#include "SWGAMBEReport.h" #include "SWGGS232ControllerReport.h" +#include "SWGLimeRFEReport.h" #include "SWGMapReport.h" #include "SWGPERTesterReport.h" #include "SWGRigCtlServerReport.h" @@ -57,9 +59,15 @@ public: SWGAFCReport* getAfcReport(); void setAfcReport(SWGAFCReport* afc_report); + SWGAMBEReport* getAmbeReport(); + void setAmbeReport(SWGAMBEReport* ambe_report); + SWGGS232ControllerReport* getGs232ControllerReport(); void setGs232ControllerReport(SWGGS232ControllerReport* gs232_controller_report); + SWGLimeRFEReport* getLimeRfeReport(); + void setLimeRfeReport(SWGLimeRFEReport* lime_rfe_report); + SWGMapReport* getMapReport(); void setMapReport(SWGMapReport* map_report); @@ -91,9 +99,15 @@ private: SWGAFCReport* afc_report; bool m_afc_report_isSet; + SWGAMBEReport* ambe_report; + bool m_ambe_report_isSet; + SWGGS232ControllerReport* gs232_controller_report; bool m_gs232_controller_report_isSet; + SWGLimeRFEReport* lime_rfe_report; + bool m_lime_rfe_report_isSet; + SWGMapReport* map_report; bool m_map_report_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp index c1a5dca05..992647cd0 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.cpp @@ -38,6 +38,8 @@ SWGFeatureSettings::SWGFeatureSettings() { m_afc_settings_isSet = false; ais_settings = nullptr; m_ais_settings_isSet = false; + ambe_settings = nullptr; + m_ambe_settings_isSet = false; antenna_tools_settings = nullptr; m_antenna_tools_settings_isSet = false; aprs_settings = nullptr; @@ -48,6 +50,8 @@ SWGFeatureSettings::SWGFeatureSettings() { m_jogdial_controller_settings_isSet = false; gs232_controller_settings = nullptr; m_gs232_controller_settings_isSet = false; + lime_rfe_settings = nullptr; + m_lime_rfe_settings_isSet = false; map_settings = nullptr; m_map_settings_isSet = false; per_tester_settings = nullptr; @@ -82,6 +86,8 @@ SWGFeatureSettings::init() { m_afc_settings_isSet = false; ais_settings = new SWGAISSettings(); m_ais_settings_isSet = false; + ambe_settings = new SWGAMBESettings(); + m_ambe_settings_isSet = false; antenna_tools_settings = new SWGAntennaToolsSettings(); m_antenna_tools_settings_isSet = false; aprs_settings = new SWGAPRSSettings(); @@ -92,6 +98,8 @@ SWGFeatureSettings::init() { m_jogdial_controller_settings_isSet = false; gs232_controller_settings = new SWGGS232ControllerSettings(); m_gs232_controller_settings_isSet = false; + lime_rfe_settings = new SWGLimeRFESettings(); + m_lime_rfe_settings_isSet = false; map_settings = new SWGMapSettings(); m_map_settings_isSet = false; per_tester_settings = new SWGPERTesterSettings(); @@ -123,6 +131,9 @@ SWGFeatureSettings::cleanup() { if(ais_settings != nullptr) { delete ais_settings; } + if(ambe_settings != nullptr) { + delete ambe_settings; + } if(antenna_tools_settings != nullptr) { delete antenna_tools_settings; } @@ -138,6 +149,9 @@ SWGFeatureSettings::cleanup() { if(gs232_controller_settings != nullptr) { delete gs232_controller_settings; } + if(lime_rfe_settings != nullptr) { + delete lime_rfe_settings; + } if(map_settings != nullptr) { delete map_settings; } @@ -185,6 +199,8 @@ SWGFeatureSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&ais_settings, pJson["AISSettings"], "SWGAISSettings", "SWGAISSettings"); + ::SWGSDRangel::setValue(&ambe_settings, pJson["AMBESettings"], "SWGAMBESettings", "SWGAMBESettings"); + ::SWGSDRangel::setValue(&antenna_tools_settings, pJson["AntennaToolsSettings"], "SWGAntennaToolsSettings", "SWGAntennaToolsSettings"); ::SWGSDRangel::setValue(&aprs_settings, pJson["APRSSettings"], "SWGAPRSSettings", "SWGAPRSSettings"); @@ -195,6 +211,8 @@ SWGFeatureSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&gs232_controller_settings, pJson["GS232ControllerSettings"], "SWGGS232ControllerSettings", "SWGGS232ControllerSettings"); + ::SWGSDRangel::setValue(&lime_rfe_settings, pJson["LimeRFESettings"], "SWGLimeRFESettings", "SWGLimeRFESettings"); + ::SWGSDRangel::setValue(&map_settings, pJson["MapSettings"], "SWGMapSettings", "SWGMapSettings"); ::SWGSDRangel::setValue(&per_tester_settings, pJson["PERTesterSettings"], "SWGPERTesterSettings", "SWGPERTesterSettings"); @@ -242,6 +260,9 @@ SWGFeatureSettings::asJsonObject() { if((ais_settings != nullptr) && (ais_settings->isSet())){ toJsonValue(QString("AISSettings"), ais_settings, obj, QString("SWGAISSettings")); } + if((ambe_settings != nullptr) && (ambe_settings->isSet())){ + toJsonValue(QString("AMBESettings"), ambe_settings, obj, QString("SWGAMBESettings")); + } if((antenna_tools_settings != nullptr) && (antenna_tools_settings->isSet())){ toJsonValue(QString("AntennaToolsSettings"), antenna_tools_settings, obj, QString("SWGAntennaToolsSettings")); } @@ -257,6 +278,9 @@ SWGFeatureSettings::asJsonObject() { if((gs232_controller_settings != nullptr) && (gs232_controller_settings->isSet())){ toJsonValue(QString("GS232ControllerSettings"), gs232_controller_settings, obj, QString("SWGGS232ControllerSettings")); } + if((lime_rfe_settings != nullptr) && (lime_rfe_settings->isSet())){ + toJsonValue(QString("LimeRFESettings"), lime_rfe_settings, obj, QString("SWGLimeRFESettings")); + } if((map_settings != nullptr) && (map_settings->isSet())){ toJsonValue(QString("MapSettings"), map_settings, obj, QString("SWGMapSettings")); } @@ -335,6 +359,16 @@ SWGFeatureSettings::setAisSettings(SWGAISSettings* ais_settings) { this->m_ais_settings_isSet = true; } +SWGAMBESettings* +SWGFeatureSettings::getAmbeSettings() { + return ambe_settings; +} +void +SWGFeatureSettings::setAmbeSettings(SWGAMBESettings* ambe_settings) { + this->ambe_settings = ambe_settings; + this->m_ambe_settings_isSet = true; +} + SWGAntennaToolsSettings* SWGFeatureSettings::getAntennaToolsSettings() { return antenna_tools_settings; @@ -385,6 +419,16 @@ SWGFeatureSettings::setGs232ControllerSettings(SWGGS232ControllerSettings* gs232 this->m_gs232_controller_settings_isSet = true; } +SWGLimeRFESettings* +SWGFeatureSettings::getLimeRfeSettings() { + return lime_rfe_settings; +} +void +SWGFeatureSettings::setLimeRfeSettings(SWGLimeRFESettings* lime_rfe_settings) { + this->lime_rfe_settings = lime_rfe_settings; + this->m_lime_rfe_settings_isSet = true; +} + SWGMapSettings* SWGFeatureSettings::getMapSettings() { return map_settings; @@ -485,6 +529,9 @@ SWGFeatureSettings::isSet(){ if(ais_settings && ais_settings->isSet()){ isObjectUpdated = true; break; } + if(ambe_settings && ambe_settings->isSet()){ + isObjectUpdated = true; break; + } if(antenna_tools_settings && antenna_tools_settings->isSet()){ isObjectUpdated = true; break; } @@ -500,6 +547,9 @@ SWGFeatureSettings::isSet(){ if(gs232_controller_settings && gs232_controller_settings->isSet()){ isObjectUpdated = true; break; } + if(lime_rfe_settings && lime_rfe_settings->isSet()){ + isObjectUpdated = true; break; + } if(map_settings && map_settings->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h index 64993003d..27b5d305a 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSettings.h @@ -24,11 +24,13 @@ #include "SWGAFCSettings.h" #include "SWGAISSettings.h" +#include "SWGAMBESettings.h" #include "SWGAPRSSettings.h" #include "SWGAntennaToolsSettings.h" #include "SWGDemodAnalyzerSettings.h" #include "SWGGS232ControllerSettings.h" #include "SWGJogdialControllerSettings.h" +#include "SWGLimeRFESettings.h" #include "SWGMapSettings.h" #include "SWGPERTesterSettings.h" #include "SWGRadiosondeSettings.h" @@ -72,6 +74,9 @@ public: SWGAISSettings* getAisSettings(); void setAisSettings(SWGAISSettings* ais_settings); + SWGAMBESettings* getAmbeSettings(); + void setAmbeSettings(SWGAMBESettings* ambe_settings); + SWGAntennaToolsSettings* getAntennaToolsSettings(); void setAntennaToolsSettings(SWGAntennaToolsSettings* antenna_tools_settings); @@ -87,6 +92,9 @@ public: SWGGS232ControllerSettings* getGs232ControllerSettings(); void setGs232ControllerSettings(SWGGS232ControllerSettings* gs232_controller_settings); + SWGLimeRFESettings* getLimeRfeSettings(); + void setLimeRfeSettings(SWGLimeRFESettings* lime_rfe_settings); + SWGMapSettings* getMapSettings(); void setMapSettings(SWGMapSettings* map_settings); @@ -130,6 +138,9 @@ private: SWGAISSettings* ais_settings; bool m_ais_settings_isSet; + SWGAMBESettings* ambe_settings; + bool m_ambe_settings_isSet; + SWGAntennaToolsSettings* antenna_tools_settings; bool m_antenna_tools_settings_isSet; @@ -145,6 +156,9 @@ private: SWGGS232ControllerSettings* gs232_controller_settings; bool m_gs232_controller_settings_isSet; + SWGLimeRFESettings* lime_rfe_settings; + bool m_lime_rfe_settings_isSet; + SWGMapSettings* map_settings; bool m_map_settings_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp index 288dd007b..08f2ff927 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp @@ -28,272 +28,6 @@ SWGInstanceApi::SWGInstanceApi(QString host, QString basePath) { this->basePath = basePath; } -void -SWGInstanceApi::instanceAMBEDevicesDelete() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "DELETE"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesDeleteCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesDeleteCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGSuccessResponse* output = static_cast(create(json, QString("SWGSuccessResponse"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesDeleteSignal(output); - } else { - emit instanceAMBEDevicesDeleteSignalE(output, error_type, error_str); - emit instanceAMBEDevicesDeleteSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBEDevicesGet() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "GET"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesGetCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesGetCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGAMBEDevices* output = static_cast(create(json, QString("SWGAMBEDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesGetSignal(output); - } else { - emit instanceAMBEDevicesGetSignalE(output, error_type, error_str); - emit instanceAMBEDevicesGetSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBEDevicesPatch(SWGAMBEDevices& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "PATCH"); - - - - QString output = body.asJson(); - input.request_body.append(output.toUtf8()); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesPatchCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesPatchCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGAMBEDevices* output = static_cast(create(json, QString("SWGAMBEDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesPatchSignal(output); - } else { - emit instanceAMBEDevicesPatchSignalE(output, error_type, error_str); - emit instanceAMBEDevicesPatchSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBEDevicesPut(SWGAMBEDevices& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/devices"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "PUT"); - - - - QString output = body.asJson(); - input.request_body.append(output.toUtf8()); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBEDevicesPutCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBEDevicesPutCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGAMBEDevices* output = static_cast(create(json, QString("SWGAMBEDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBEDevicesPutSignal(output); - } else { - emit instanceAMBEDevicesPutSignalE(output, error_type, error_str); - emit instanceAMBEDevicesPutSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceAMBESerialGet() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/ambe/serial"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "GET"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceAMBESerialGetCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceAMBESerialGetCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGDVSerialDevices* output = static_cast(create(json, QString("SWGDVSerialDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceAMBESerialGetSignal(output); - } else { - emit instanceAMBESerialGetSignalE(output, error_type, error_str); - emit instanceAMBESerialGetSignalEFull(worker, error_type, error_str); - } -} - void SWGInstanceApi::instanceAudioGet() { QString fullPath; @@ -1707,288 +1441,6 @@ SWGInstanceApi::instanceFeaturesCallback(SWGHttpRequestWorker * worker) { } } -void -SWGInstanceApi::instanceLimeRFEConfigGet(QString* serial) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/limerfe/config"); - - - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append(QUrl::toPercentEncoding("serial")) - .append("=") - .append(QUrl::toPercentEncoding(stringValue(serial))); - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "GET"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceLimeRFEConfigGetCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceLimeRFEConfigGetCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGLimeRFESettings* output = static_cast(create(json, QString("SWGLimeRFESettings"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceLimeRFEConfigGetSignal(output); - } else { - emit instanceLimeRFEConfigGetSignalE(output, error_type, error_str); - emit instanceLimeRFEConfigGetSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceLimeRFEConfigPut(SWGLimeRFESettings& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/limerfe/config"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "PUT"); - - - - QString output = body.asJson(); - input.request_body.append(output.toUtf8()); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceLimeRFEConfigPutCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceLimeRFEConfigPutCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGSuccessResponse* output = static_cast(create(json, QString("SWGSuccessResponse"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceLimeRFEConfigPutSignal(output); - } else { - emit instanceLimeRFEConfigPutSignalE(output, error_type, error_str); - emit instanceLimeRFEConfigPutSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceLimeRFEPowerGet(QString* serial) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/limerfe/power"); - - - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append(QUrl::toPercentEncoding("serial")) - .append("=") - .append(QUrl::toPercentEncoding(stringValue(serial))); - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "GET"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceLimeRFEPowerGetCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceLimeRFEPowerGetCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGLimeRFEPower* output = static_cast(create(json, QString("SWGLimeRFEPower"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceLimeRFEPowerGetSignal(output); - } else { - emit instanceLimeRFEPowerGetSignalE(output, error_type, error_str); - emit instanceLimeRFEPowerGetSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceLimeRFERunPut(SWGLimeRFESettings& body) { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/limerfe/run"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "PUT"); - - - - QString output = body.asJson(); - input.request_body.append(output.toUtf8()); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceLimeRFERunPutCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceLimeRFERunPutCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGSuccessResponse* output = static_cast(create(json, QString("SWGSuccessResponse"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceLimeRFERunPutSignal(output); - } else { - emit instanceLimeRFERunPutSignalE(output, error_type, error_str); - emit instanceLimeRFERunPutSignalEFull(worker, error_type, error_str); - } -} - -void -SWGInstanceApi::instanceLimeRFESerialGet() { - QString fullPath; - fullPath.append(this->host).append(this->basePath).append("/sdrangel/limerfe/serial"); - - - - SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); - SWGHttpRequestInput input(fullPath, "GET"); - - - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &SWGHttpRequestWorker::on_execution_finished, - this, - &SWGInstanceApi::instanceLimeRFESerialGetCallback); - - worker->execute(&input); -} - -void -SWGInstanceApi::instanceLimeRFESerialGetCallback(SWGHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - - - QString json(worker->response); - SWGLimeRFEDevices* output = static_cast(create(json, QString("SWGLimeRFEDevices"))); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit instanceLimeRFESerialGetSignal(output); - } else { - emit instanceLimeRFESerialGetSignalE(output, error_type, error_str); - emit instanceLimeRFESerialGetSignalEFull(worker, error_type, error_str); - } -} - void SWGInstanceApi::instanceLocationGet() { QString fullPath; diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h index e5b916a85..3ea0cb05d 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h @@ -15,8 +15,6 @@ #include "SWGHttpRequest.h" -#include -#include "SWGAMBEDevices.h" #include "SWGAudioDevices.h" #include "SWGAudioInputDevice.h" #include "SWGAudioOutputDevice.h" @@ -24,7 +22,6 @@ #include "SWGConfigurationIdentifier.h" #include "SWGConfigurationImportExport.h" #include "SWGConfigurations.h" -#include "SWGDVSerialDevices.h" #include "SWGDeviceSetList.h" #include "SWGErrorResponse.h" #include "SWGFeaturePresetIdentifier.h" @@ -35,9 +32,6 @@ #include "SWGInstanceDevicesResponse.h" #include "SWGInstanceFeaturesResponse.h" #include "SWGInstanceSummaryResponse.h" -#include "SWGLimeRFEDevices.h" -#include "SWGLimeRFEPower.h" -#include "SWGLimeRFESettings.h" #include "SWGLocationInformation.h" #include "SWGLoggingInfo.h" #include "SWGPresetExport.h" @@ -62,11 +56,6 @@ public: QString basePath; QMap defaultHeaders; - void instanceAMBEDevicesDelete(); - void instanceAMBEDevicesGet(); - void instanceAMBEDevicesPatch(SWGAMBEDevices& body); - void instanceAMBEDevicesPut(SWGAMBEDevices& body); - void instanceAMBESerialGet(); void instanceAudioGet(); void instanceAudioInputCleanupPatch(); void instanceAudioInputDelete(SWGAudioInputDevice& body); @@ -93,11 +82,6 @@ public: void instanceFeaturePresetDelete(SWGFeaturePresetIdentifier& body); void instanceFeaturePresetGet(); void instanceFeatures(); - void instanceLimeRFEConfigGet(QString* serial); - void instanceLimeRFEConfigPut(SWGLimeRFESettings& body); - void instanceLimeRFEPowerGet(QString* serial); - void instanceLimeRFERunPut(SWGLimeRFESettings& body); - void instanceLimeRFESerialGet(); void instanceLocationGet(); void instanceLocationPut(SWGLocationInformation& body); void instanceLoggingGet(); @@ -114,11 +98,6 @@ public: void instanceSummary(); private: - void instanceAMBEDevicesDeleteCallback (SWGHttpRequestWorker * worker); - void instanceAMBEDevicesGetCallback (SWGHttpRequestWorker * worker); - void instanceAMBEDevicesPatchCallback (SWGHttpRequestWorker * worker); - void instanceAMBEDevicesPutCallback (SWGHttpRequestWorker * worker); - void instanceAMBESerialGetCallback (SWGHttpRequestWorker * worker); void instanceAudioGetCallback (SWGHttpRequestWorker * worker); void instanceAudioInputCleanupPatchCallback (SWGHttpRequestWorker * worker); void instanceAudioInputDeleteCallback (SWGHttpRequestWorker * worker); @@ -145,11 +124,6 @@ private: void instanceFeaturePresetDeleteCallback (SWGHttpRequestWorker * worker); void instanceFeaturePresetGetCallback (SWGHttpRequestWorker * worker); void instanceFeaturesCallback (SWGHttpRequestWorker * worker); - void instanceLimeRFEConfigGetCallback (SWGHttpRequestWorker * worker); - void instanceLimeRFEConfigPutCallback (SWGHttpRequestWorker * worker); - void instanceLimeRFEPowerGetCallback (SWGHttpRequestWorker * worker); - void instanceLimeRFERunPutCallback (SWGHttpRequestWorker * worker); - void instanceLimeRFESerialGetCallback (SWGHttpRequestWorker * worker); void instanceLocationGetCallback (SWGHttpRequestWorker * worker); void instanceLocationPutCallback (SWGHttpRequestWorker * worker); void instanceLoggingGetCallback (SWGHttpRequestWorker * worker); @@ -166,11 +140,6 @@ private: void instanceSummaryCallback (SWGHttpRequestWorker * worker); signals: - void instanceAMBEDevicesDeleteSignal(SWGSuccessResponse* summary); - void instanceAMBEDevicesGetSignal(SWGAMBEDevices* summary); - void instanceAMBEDevicesPatchSignal(SWGAMBEDevices* summary); - void instanceAMBEDevicesPutSignal(SWGAMBEDevices* summary); - void instanceAMBESerialGetSignal(SWGDVSerialDevices* summary); void instanceAudioGetSignal(SWGAudioDevices* summary); void instanceAudioInputCleanupPatchSignal(SWGSuccessResponse* summary); void instanceAudioInputDeleteSignal(SWGAudioInputDevice* summary); @@ -197,11 +166,6 @@ signals: void instanceFeaturePresetDeleteSignal(SWGFeaturePresetIdentifier* summary); void instanceFeaturePresetGetSignal(SWGFeaturePresets* summary); void instanceFeaturesSignal(SWGInstanceFeaturesResponse* summary); - void instanceLimeRFEConfigGetSignal(SWGLimeRFESettings* summary); - void instanceLimeRFEConfigPutSignal(SWGSuccessResponse* summary); - void instanceLimeRFEPowerGetSignal(SWGLimeRFEPower* summary); - void instanceLimeRFERunPutSignal(SWGSuccessResponse* summary); - void instanceLimeRFESerialGetSignal(SWGLimeRFEDevices* summary); void instanceLocationGetSignal(SWGLocationInformation* summary); void instanceLocationPutSignal(SWGLocationInformation* summary); void instanceLoggingGetSignal(SWGLoggingInfo* summary); @@ -217,11 +181,6 @@ signals: void instancePresetPutSignal(SWGPresetIdentifier* summary); void instanceSummarySignal(SWGInstanceSummaryResponse* summary); - void instanceAMBEDevicesDeleteSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesGetSignalE(SWGAMBEDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPatchSignalE(SWGAMBEDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPutSignalE(SWGAMBEDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBESerialGetSignalE(SWGDVSerialDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioGetSignalE(SWGAudioDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputCleanupPatchSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputDeleteSignalE(SWGAudioInputDevice* summary, QNetworkReply::NetworkError error_type, QString& error_str); @@ -248,11 +207,6 @@ signals: void instanceFeaturePresetDeleteSignalE(SWGFeaturePresetIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceFeaturePresetGetSignalE(SWGFeaturePresets* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceFeaturesSignalE(SWGInstanceFeaturesResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFEConfigGetSignalE(SWGLimeRFESettings* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFEConfigPutSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFEPowerGetSignalE(SWGLimeRFEPower* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFERunPutSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFESerialGetSignalE(SWGLimeRFEDevices* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLocationGetSignalE(SWGLocationInformation* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLocationPutSignalE(SWGLocationInformation* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLoggingGetSignalE(SWGLoggingInfo* summary, QNetworkReply::NetworkError error_type, QString& error_str); @@ -268,11 +222,6 @@ signals: void instancePresetPutSignalE(SWGPresetIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceSummarySignalE(SWGInstanceSummaryResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBEDevicesPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceAMBESerialGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputCleanupPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceAudioInputDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); @@ -299,11 +248,6 @@ signals: void instanceFeaturePresetDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceFeaturePresetGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceFeaturesSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFEConfigGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFEConfigPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFEPowerGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFERunPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); - void instanceLimeRFESerialGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLocationGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLocationPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLoggingGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFEActions.cpp b/swagger/sdrangel/code/qt5/client/SWGLimeRFEActions.cpp new file mode 100644 index 000000000..0ca4f36b8 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGLimeRFEActions.cpp @@ -0,0 +1,223 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGLimeRFEActions.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGLimeRFEActions::SWGLimeRFEActions(QString* json) { + init(); + this->fromJson(*json); +} + +SWGLimeRFEActions::SWGLimeRFEActions() { + select_channel = 0; + m_select_channel_isSet = false; + device_set_index = 0; + m_device_set_index_isSet = false; + switch_channel = 0; + m_switch_channel_isSet = false; + get_state = 0; + m_get_state_isSet = false; + from_to_settings = 0; + m_from_to_settings_isSet = false; + open_close_device = 0; + m_open_close_device_isSet = false; +} + +SWGLimeRFEActions::~SWGLimeRFEActions() { + this->cleanup(); +} + +void +SWGLimeRFEActions::init() { + select_channel = 0; + m_select_channel_isSet = false; + device_set_index = 0; + m_device_set_index_isSet = false; + switch_channel = 0; + m_switch_channel_isSet = false; + get_state = 0; + m_get_state_isSet = false; + from_to_settings = 0; + m_from_to_settings_isSet = false; + open_close_device = 0; + m_open_close_device_isSet = false; +} + +void +SWGLimeRFEActions::cleanup() { + + + + + + +} + +SWGLimeRFEActions* +SWGLimeRFEActions::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGLimeRFEActions::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&select_channel, pJson["selectChannel"], "qint32", ""); + + ::SWGSDRangel::setValue(&device_set_index, pJson["deviceSetIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&switch_channel, pJson["switchChannel"], "qint32", ""); + + ::SWGSDRangel::setValue(&get_state, pJson["getState"], "qint32", ""); + + ::SWGSDRangel::setValue(&from_to_settings, pJson["fromToSettings"], "qint32", ""); + + ::SWGSDRangel::setValue(&open_close_device, pJson["openCloseDevice"], "qint32", ""); + +} + +QString +SWGLimeRFEActions::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGLimeRFEActions::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_select_channel_isSet){ + obj->insert("selectChannel", QJsonValue(select_channel)); + } + if(m_device_set_index_isSet){ + obj->insert("deviceSetIndex", QJsonValue(device_set_index)); + } + if(m_switch_channel_isSet){ + obj->insert("switchChannel", QJsonValue(switch_channel)); + } + if(m_get_state_isSet){ + obj->insert("getState", QJsonValue(get_state)); + } + if(m_from_to_settings_isSet){ + obj->insert("fromToSettings", QJsonValue(from_to_settings)); + } + if(m_open_close_device_isSet){ + obj->insert("openCloseDevice", QJsonValue(open_close_device)); + } + + return obj; +} + +qint32 +SWGLimeRFEActions::getSelectChannel() { + return select_channel; +} +void +SWGLimeRFEActions::setSelectChannel(qint32 select_channel) { + this->select_channel = select_channel; + this->m_select_channel_isSet = true; +} + +qint32 +SWGLimeRFEActions::getDeviceSetIndex() { + return device_set_index; +} +void +SWGLimeRFEActions::setDeviceSetIndex(qint32 device_set_index) { + this->device_set_index = device_set_index; + this->m_device_set_index_isSet = true; +} + +qint32 +SWGLimeRFEActions::getSwitchChannel() { + return switch_channel; +} +void +SWGLimeRFEActions::setSwitchChannel(qint32 switch_channel) { + this->switch_channel = switch_channel; + this->m_switch_channel_isSet = true; +} + +qint32 +SWGLimeRFEActions::getGetState() { + return get_state; +} +void +SWGLimeRFEActions::setGetState(qint32 get_state) { + this->get_state = get_state; + this->m_get_state_isSet = true; +} + +qint32 +SWGLimeRFEActions::getFromToSettings() { + return from_to_settings; +} +void +SWGLimeRFEActions::setFromToSettings(qint32 from_to_settings) { + this->from_to_settings = from_to_settings; + this->m_from_to_settings_isSet = true; +} + +qint32 +SWGLimeRFEActions::getOpenCloseDevice() { + return open_close_device; +} +void +SWGLimeRFEActions::setOpenCloseDevice(qint32 open_close_device) { + this->open_close_device = open_close_device; + this->m_open_close_device_isSet = true; +} + + +bool +SWGLimeRFEActions::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_select_channel_isSet){ + isObjectUpdated = true; break; + } + if(m_device_set_index_isSet){ + isObjectUpdated = true; break; + } + if(m_switch_channel_isSet){ + isObjectUpdated = true; break; + } + if(m_get_state_isSet){ + isObjectUpdated = true; break; + } + if(m_from_to_settings_isSet){ + isObjectUpdated = true; break; + } + if(m_open_close_device_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFEActions.h b/swagger/sdrangel/code/qt5/client/SWGLimeRFEActions.h new file mode 100644 index 000000000..74e1dc096 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGLimeRFEActions.h @@ -0,0 +1,88 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGLimeRFEActions.h + * + * LimeRFE + */ + +#ifndef SWGLimeRFEActions_H_ +#define SWGLimeRFEActions_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGLimeRFEActions: public SWGObject { +public: + SWGLimeRFEActions(); + SWGLimeRFEActions(QString* json); + virtual ~SWGLimeRFEActions(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGLimeRFEActions* fromJson(QString &jsonString) override; + + qint32 getSelectChannel(); + void setSelectChannel(qint32 select_channel); + + qint32 getDeviceSetIndex(); + void setDeviceSetIndex(qint32 device_set_index); + + qint32 getSwitchChannel(); + void setSwitchChannel(qint32 switch_channel); + + qint32 getGetState(); + void setGetState(qint32 get_state); + + qint32 getFromToSettings(); + void setFromToSettings(qint32 from_to_settings); + + qint32 getOpenCloseDevice(); + void setOpenCloseDevice(qint32 open_close_device); + + + virtual bool isSet() override; + +private: + qint32 select_channel; + bool m_select_channel_isSet; + + qint32 device_set_index; + bool m_device_set_index_isSet; + + qint32 switch_channel; + bool m_switch_channel_isSet; + + qint32 get_state; + bool m_get_state_isSet; + + qint32 from_to_settings; + bool m_from_to_settings_isSet; + + qint32 open_close_device; + bool m_open_close_device_isSet; + +}; + +} + +#endif /* SWGLimeRFEActions_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFEReport.cpp b/swagger/sdrangel/code/qt5/client/SWGLimeRFEReport.cpp new file mode 100644 index 000000000..1b2078baa --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGLimeRFEReport.cpp @@ -0,0 +1,177 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGLimeRFEReport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGLimeRFEReport::SWGLimeRFEReport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGLimeRFEReport::SWGLimeRFEReport() { + rx_on = 0; + m_rx_on_isSet = false; + tx_on = 0; + m_tx_on_isSet = false; + forward_power = 0; + m_forward_power_isSet = false; + reflected_power = 0; + m_reflected_power_isSet = false; +} + +SWGLimeRFEReport::~SWGLimeRFEReport() { + this->cleanup(); +} + +void +SWGLimeRFEReport::init() { + rx_on = 0; + m_rx_on_isSet = false; + tx_on = 0; + m_tx_on_isSet = false; + forward_power = 0; + m_forward_power_isSet = false; + reflected_power = 0; + m_reflected_power_isSet = false; +} + +void +SWGLimeRFEReport::cleanup() { + + + + +} + +SWGLimeRFEReport* +SWGLimeRFEReport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGLimeRFEReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&rx_on, pJson["rxOn"], "qint32", ""); + + ::SWGSDRangel::setValue(&tx_on, pJson["txOn"], "qint32", ""); + + ::SWGSDRangel::setValue(&forward_power, pJson["forwardPower"], "qint32", ""); + + ::SWGSDRangel::setValue(&reflected_power, pJson["reflectedPower"], "qint32", ""); + +} + +QString +SWGLimeRFEReport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGLimeRFEReport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_rx_on_isSet){ + obj->insert("rxOn", QJsonValue(rx_on)); + } + if(m_tx_on_isSet){ + obj->insert("txOn", QJsonValue(tx_on)); + } + if(m_forward_power_isSet){ + obj->insert("forwardPower", QJsonValue(forward_power)); + } + if(m_reflected_power_isSet){ + obj->insert("reflectedPower", QJsonValue(reflected_power)); + } + + return obj; +} + +qint32 +SWGLimeRFEReport::getRxOn() { + return rx_on; +} +void +SWGLimeRFEReport::setRxOn(qint32 rx_on) { + this->rx_on = rx_on; + this->m_rx_on_isSet = true; +} + +qint32 +SWGLimeRFEReport::getTxOn() { + return tx_on; +} +void +SWGLimeRFEReport::setTxOn(qint32 tx_on) { + this->tx_on = tx_on; + this->m_tx_on_isSet = true; +} + +qint32 +SWGLimeRFEReport::getForwardPower() { + return forward_power; +} +void +SWGLimeRFEReport::setForwardPower(qint32 forward_power) { + this->forward_power = forward_power; + this->m_forward_power_isSet = true; +} + +qint32 +SWGLimeRFEReport::getReflectedPower() { + return reflected_power; +} +void +SWGLimeRFEReport::setReflectedPower(qint32 reflected_power) { + this->reflected_power = reflected_power; + this->m_reflected_power_isSet = true; +} + + +bool +SWGLimeRFEReport::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_rx_on_isSet){ + isObjectUpdated = true; break; + } + if(m_tx_on_isSet){ + isObjectUpdated = true; break; + } + if(m_forward_power_isSet){ + isObjectUpdated = true; break; + } + if(m_reflected_power_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFEReport.h b/swagger/sdrangel/code/qt5/client/SWGLimeRFEReport.h new file mode 100644 index 000000000..49006caba --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGLimeRFEReport.h @@ -0,0 +1,76 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 7.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGLimeRFEReport.h + * + * LimeRFE + */ + +#ifndef SWGLimeRFEReport_H_ +#define SWGLimeRFEReport_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGLimeRFEReport: public SWGObject { +public: + SWGLimeRFEReport(); + SWGLimeRFEReport(QString* json); + virtual ~SWGLimeRFEReport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGLimeRFEReport* fromJson(QString &jsonString) override; + + qint32 getRxOn(); + void setRxOn(qint32 rx_on); + + qint32 getTxOn(); + void setTxOn(qint32 tx_on); + + qint32 getForwardPower(); + void setForwardPower(qint32 forward_power); + + qint32 getReflectedPower(); + void setReflectedPower(qint32 reflected_power); + + + virtual bool isSet() override; + +private: + qint32 rx_on; + bool m_rx_on_isSet; + + qint32 tx_on; + bool m_tx_on_isSet; + + qint32 forward_power; + bool m_forward_power_isSet; + + qint32 reflected_power; + bool m_reflected_power_isSet; + +}; + +} + +#endif /* SWGLimeRFEReport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.cpp b/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.cpp index fba79d1d8..cce21df5c 100644 --- a/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.cpp @@ -28,6 +28,10 @@ SWGLimeRFESettings::SWGLimeRFESettings(QString* json) { } SWGLimeRFESettings::SWGLimeRFESettings() { + title = nullptr; + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_isSet = false; device_path = nullptr; m_device_path_isSet = false; rx_channels = 0; @@ -58,10 +62,20 @@ SWGLimeRFESettings::SWGLimeRFESettings() { m_swr_enable_isSet = false; swr_source = 0; m_swr_source_isSet = false; - rx_on = 0; - m_rx_on_isSet = false; - tx_on = 0; - m_tx_on_isSet = false; + tx_rx_driven = 0; + m_tx_rx_driven_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_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; + rollup_state = nullptr; + m_rollup_state_isSet = false; } SWGLimeRFESettings::~SWGLimeRFESettings() { @@ -70,6 +84,10 @@ SWGLimeRFESettings::~SWGLimeRFESettings() { void SWGLimeRFESettings::init() { + title = new QString(""); + m_title_isSet = false; + rgb_color = 0; + m_rgb_color_isSet = false; device_path = new QString(""); m_device_path_isSet = false; rx_channels = 0; @@ -100,14 +118,28 @@ SWGLimeRFESettings::init() { m_swr_enable_isSet = false; swr_source = 0; m_swr_source_isSet = false; - rx_on = 0; - m_rx_on_isSet = false; - tx_on = 0; - m_tx_on_isSet = false; + tx_rx_driven = 0; + m_tx_rx_driven_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_feature_set_index = 0; + m_reverse_api_feature_set_index_isSet = false; + reverse_api_feature_index = 0; + m_reverse_api_feature_index_isSet = false; + rollup_state = new SWGRollupState(); + m_rollup_state_isSet = false; } void SWGLimeRFESettings::cleanup() { + if(title != nullptr) { + delete title; + } + if(device_path != nullptr) { delete device_path; } @@ -127,6 +159,15 @@ SWGLimeRFESettings::cleanup() { + if(reverse_api_address != nullptr) { + delete reverse_api_address; + } + + + + if(rollup_state != nullptr) { + delete rollup_state; + } } SWGLimeRFESettings* @@ -140,6 +181,10 @@ SWGLimeRFESettings::fromJson(QString &json) { void SWGLimeRFESettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + + ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); + ::SWGSDRangel::setValue(&device_path, pJson["devicePath"], "QString", "QString"); ::SWGSDRangel::setValue(&rx_channels, pJson["rxChannels"], "qint32", ""); @@ -170,9 +215,19 @@ SWGLimeRFESettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&swr_source, pJson["swrSource"], "qint32", ""); - ::SWGSDRangel::setValue(&rx_on, pJson["rxOn"], "qint32", ""); + ::SWGSDRangel::setValue(&tx_rx_driven, pJson["txRxDriven"], "qint32", ""); - ::SWGSDRangel::setValue(&tx_on, pJson["txOn"], "qint32", ""); + ::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_feature_set_index, pJson["reverseAPIFeatureSetIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&reverse_api_feature_index, pJson["reverseAPIFeatureIndex"], "qint32", ""); + + ::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState"); } @@ -190,6 +245,12 @@ SWGLimeRFESettings::asJson () QJsonObject* SWGLimeRFESettings::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(title != nullptr && *title != QString("")){ + toJsonValue(QString("title"), title, obj, QString("QString")); + } + if(m_rgb_color_isSet){ + obj->insert("rgbColor", QJsonValue(rgb_color)); + } if(device_path != nullptr && *device_path != QString("")){ toJsonValue(QString("devicePath"), device_path, obj, QString("QString")); } @@ -235,16 +296,51 @@ SWGLimeRFESettings::asJsonObject() { if(m_swr_source_isSet){ obj->insert("swrSource", QJsonValue(swr_source)); } - if(m_rx_on_isSet){ - obj->insert("rxOn", QJsonValue(rx_on)); + if(m_tx_rx_driven_isSet){ + obj->insert("txRxDriven", QJsonValue(tx_rx_driven)); } - if(m_tx_on_isSet){ - obj->insert("txOn", QJsonValue(tx_on)); + 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_feature_set_index_isSet){ + obj->insert("reverseAPIFeatureSetIndex", QJsonValue(reverse_api_feature_set_index)); + } + if(m_reverse_api_feature_index_isSet){ + obj->insert("reverseAPIFeatureIndex", QJsonValue(reverse_api_feature_index)); + } + if((rollup_state != nullptr) && (rollup_state->isSet())){ + toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState")); } return obj; } +QString* +SWGLimeRFESettings::getTitle() { + return title; +} +void +SWGLimeRFESettings::setTitle(QString* title) { + this->title = title; + this->m_title_isSet = true; +} + +qint32 +SWGLimeRFESettings::getRgbColor() { + return rgb_color; +} +void +SWGLimeRFESettings::setRgbColor(qint32 rgb_color) { + this->rgb_color = rgb_color; + this->m_rgb_color_isSet = true; +} + QString* SWGLimeRFESettings::getDevicePath() { return device_path; @@ -396,23 +492,73 @@ SWGLimeRFESettings::setSwrSource(qint32 swr_source) { } qint32 -SWGLimeRFESettings::getRxOn() { - return rx_on; +SWGLimeRFESettings::getTxRxDriven() { + return tx_rx_driven; } void -SWGLimeRFESettings::setRxOn(qint32 rx_on) { - this->rx_on = rx_on; - this->m_rx_on_isSet = true; +SWGLimeRFESettings::setTxRxDriven(qint32 tx_rx_driven) { + this->tx_rx_driven = tx_rx_driven; + this->m_tx_rx_driven_isSet = true; } qint32 -SWGLimeRFESettings::getTxOn() { - return tx_on; +SWGLimeRFESettings::getUseReverseApi() { + return use_reverse_api; } void -SWGLimeRFESettings::setTxOn(qint32 tx_on) { - this->tx_on = tx_on; - this->m_tx_on_isSet = true; +SWGLimeRFESettings::setUseReverseApi(qint32 use_reverse_api) { + this->use_reverse_api = use_reverse_api; + this->m_use_reverse_api_isSet = true; +} + +QString* +SWGLimeRFESettings::getReverseApiAddress() { + return reverse_api_address; +} +void +SWGLimeRFESettings::setReverseApiAddress(QString* reverse_api_address) { + this->reverse_api_address = reverse_api_address; + this->m_reverse_api_address_isSet = true; +} + +qint32 +SWGLimeRFESettings::getReverseApiPort() { + return reverse_api_port; +} +void +SWGLimeRFESettings::setReverseApiPort(qint32 reverse_api_port) { + this->reverse_api_port = reverse_api_port; + this->m_reverse_api_port_isSet = true; +} + +qint32 +SWGLimeRFESettings::getReverseApiFeatureSetIndex() { + return reverse_api_feature_set_index; +} +void +SWGLimeRFESettings::setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index) { + this->reverse_api_feature_set_index = reverse_api_feature_set_index; + this->m_reverse_api_feature_set_index_isSet = true; +} + +qint32 +SWGLimeRFESettings::getReverseApiFeatureIndex() { + return reverse_api_feature_index; +} +void +SWGLimeRFESettings::setReverseApiFeatureIndex(qint32 reverse_api_feature_index) { + this->reverse_api_feature_index = reverse_api_feature_index; + this->m_reverse_api_feature_index_isSet = true; +} + +SWGRollupState* +SWGLimeRFESettings::getRollupState() { + return rollup_state; +} +void +SWGLimeRFESettings::setRollupState(SWGRollupState* rollup_state) { + this->rollup_state = rollup_state; + this->m_rollup_state_isSet = true; } @@ -420,6 +566,12 @@ bool SWGLimeRFESettings::isSet(){ bool isObjectUpdated = false; do{ + if(title && *title != QString("")){ + isObjectUpdated = true; break; + } + if(m_rgb_color_isSet){ + isObjectUpdated = true; break; + } if(device_path && *device_path != QString("")){ isObjectUpdated = true; break; } @@ -465,10 +617,25 @@ SWGLimeRFESettings::isSet(){ if(m_swr_source_isSet){ isObjectUpdated = true; break; } - if(m_rx_on_isSet){ + if(m_tx_rx_driven_isSet){ isObjectUpdated = true; break; } - if(m_tx_on_isSet){ + if(m_use_reverse_api_isSet){ + isObjectUpdated = true; break; + } + if(reverse_api_address && *reverse_api_address != QString("")){ + isObjectUpdated = true; break; + } + if(m_reverse_api_port_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_feature_set_index_isSet){ + isObjectUpdated = true; break; + } + if(m_reverse_api_feature_index_isSet){ + isObjectUpdated = true; break; + } + if(rollup_state && rollup_state->isSet()){ isObjectUpdated = true; break; } }while(false); diff --git a/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.h b/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.h index 90517b823..a36df8076 100644 --- a/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGLimeRFESettings.h @@ -22,6 +22,7 @@ #include +#include "SWGRollupState.h" #include #include "SWGObject.h" @@ -42,6 +43,12 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGLimeRFESettings* fromJson(QString &jsonString) override; + QString* getTitle(); + void setTitle(QString* title); + + qint32 getRgbColor(); + void setRgbColor(qint32 rgb_color); + QString* getDevicePath(); void setDevicePath(QString* device_path); @@ -87,16 +94,37 @@ public: qint32 getSwrSource(); void setSwrSource(qint32 swr_source); - qint32 getRxOn(); - void setRxOn(qint32 rx_on); + qint32 getTxRxDriven(); + void setTxRxDriven(qint32 tx_rx_driven); - qint32 getTxOn(); - void setTxOn(qint32 tx_on); + 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 getReverseApiFeatureSetIndex(); + void setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index); + + qint32 getReverseApiFeatureIndex(); + void setReverseApiFeatureIndex(qint32 reverse_api_feature_index); + + SWGRollupState* getRollupState(); + void setRollupState(SWGRollupState* rollup_state); virtual bool isSet() override; private: + QString* title; + bool m_title_isSet; + + qint32 rgb_color; + bool m_rgb_color_isSet; + QString* device_path; bool m_device_path_isSet; @@ -142,11 +170,26 @@ private: qint32 swr_source; bool m_swr_source_isSet; - qint32 rx_on; - bool m_rx_on_isSet; + qint32 tx_rx_driven; + bool m_tx_rx_driven_isSet; - qint32 tx_on; - bool m_tx_on_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_feature_set_index; + bool m_reverse_api_feature_set_index_isSet; + + qint32 reverse_api_feature_index; + bool m_reverse_api_feature_index_isSet; + + SWGRollupState* rollup_state; + bool m_rollup_state_isSet; }; diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 8c8c47b41..cf694db10 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -25,8 +25,12 @@ #include "SWGAISModReport.h" #include "SWGAISModSettings.h" #include "SWGAISSettings.h" +#include "SWGAMBEActions.h" #include "SWGAMBEDevice.h" +#include "SWGAMBEDeviceReport.h" #include "SWGAMBEDevices.h" +#include "SWGAMBEReport.h" +#include "SWGAMBESettings.h" #include "SWGAMDemodReport.h" #include "SWGAMDemodSettings.h" #include "SWGAMModReport.h" @@ -158,9 +162,10 @@ #include "SWGJogdialControllerSettings.h" #include "SWGKiwiSDRReport.h" #include "SWGKiwiSDRSettings.h" +#include "SWGLimeRFEActions.h" #include "SWGLimeRFEDevice.h" #include "SWGLimeRFEDevices.h" -#include "SWGLimeRFEPower.h" +#include "SWGLimeRFEReport.h" #include "SWGLimeRFESettings.h" #include "SWGLimeSdrInputReport.h" #include "SWGLimeSdrInputSettings.h" @@ -383,16 +388,36 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGAMBEActions").compare(type) == 0) { + SWGAMBEActions *obj = new SWGAMBEActions(); + obj->init(); + return obj; + } if(QString("SWGAMBEDevice").compare(type) == 0) { SWGAMBEDevice *obj = new SWGAMBEDevice(); obj->init(); return obj; } + if(QString("SWGAMBEDeviceReport").compare(type) == 0) { + SWGAMBEDeviceReport *obj = new SWGAMBEDeviceReport(); + obj->init(); + return obj; + } if(QString("SWGAMBEDevices").compare(type) == 0) { SWGAMBEDevices *obj = new SWGAMBEDevices(); obj->init(); return obj; } + if(QString("SWGAMBEReport").compare(type) == 0) { + SWGAMBEReport *obj = new SWGAMBEReport(); + obj->init(); + return obj; + } + if(QString("SWGAMBESettings").compare(type) == 0) { + SWGAMBESettings *obj = new SWGAMBESettings(); + obj->init(); + return obj; + } if(QString("SWGAMDemodReport").compare(type) == 0) { SWGAMDemodReport *obj = new SWGAMDemodReport(); obj->init(); @@ -1048,6 +1073,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGLimeRFEActions").compare(type) == 0) { + SWGLimeRFEActions *obj = new SWGLimeRFEActions(); + obj->init(); + return obj; + } if(QString("SWGLimeRFEDevice").compare(type) == 0) { SWGLimeRFEDevice *obj = new SWGLimeRFEDevice(); obj->init(); @@ -1058,8 +1088,8 @@ namespace SWGSDRangel { obj->init(); return obj; } - if(QString("SWGLimeRFEPower").compare(type) == 0) { - SWGLimeRFEPower *obj = new SWGLimeRFEPower(); + if(QString("SWGLimeRFEReport").compare(type) == 0) { + SWGLimeRFEReport *obj = new SWGLimeRFEReport(); obj->init(); return obj; }