From 6d18d6358a94ebd43e3198992274bb7d8b2e4713 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 24 May 2022 17:14:22 +0200 Subject: [PATCH] AMBE feature: changes to DSD demod API --- plugins/channelrx/demoddsd/dsddemod.cpp | 14 ++++++ sdrbase/resources/webapi/doc/html2/index.html | 10 +++- .../webapi/doc/swagger/include/DSDDemod.yaml | 10 +++- .../api/swagger/include/DSDDemod.yaml | 10 +++- swagger/sdrangel/code/html2/index.html | 10 +++- .../code/qt5/client/SWGDSDDemodSettings.cpp | 46 +++++++++++++++++++ .../code/qt5/client/SWGDSDDemodSettings.h | 12 +++++ 7 files changed, 108 insertions(+), 4 deletions(-) diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index e2fc815db..45c93b3b7 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -566,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()); } @@ -632,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) { @@ -818,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)) { diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 474dfdf12..a74ba0c83 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -4605,6 +4605,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" @@ -57761,7 +57769,7 @@ except ApiException as e:
- Generated 2022-05-22T20:12:13.506+02:00 + Generated 2022-05-24T15:35:23.001+02:00
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/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/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 474dfdf12..a74ba0c83 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -4605,6 +4605,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" @@ -57761,7 +57769,7 @@ except ApiException as e:
- Generated 2022-05-22T20:12:13.506+02:00 + Generated 2022-05-24T15:35:23.001+02:00
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; + }; }