diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp index 20bfee715..dddcff9ed 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp @@ -780,6 +780,8 @@ void RTLSDRInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& respons response.getRtlSdrReport()->getGains()->append(new SWGSDRangel::SWGGain); response.getRtlSdrReport()->getGains()->back()->setGainCb(*it); } + + response.getRtlSdrReport()->setTunerType(new QString(getTunerName())); } void RTLSDRInput::webapiReverseSendSettings(const QList& deviceSettingsKeys, const RTLSDRSettings& settings, bool force) diff --git a/swagger/sdrangel/api/swagger/include/RtlSdr.yaml b/swagger/sdrangel/api/swagger/include/RtlSdr.yaml index f66b0d360..82a467c42 100644 --- a/swagger/sdrangel/api/swagger/include/RtlSdr.yaml +++ b/swagger/sdrangel/api/swagger/include/RtlSdr.yaml @@ -62,3 +62,5 @@ RtlSdrReport: type: array items: $ref: "http://swgserver:8081/api/swagger/include/Structs.yaml#/Gain" + tunerType: + type: string diff --git a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp index 56f2778c6..d149e628f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.cpp @@ -30,6 +30,8 @@ SWGRtlSdrReport::SWGRtlSdrReport(QString* json) { SWGRtlSdrReport::SWGRtlSdrReport() { gains = nullptr; m_gains_isSet = false; + tuner_type = nullptr; + m_tuner_type_isSet = false; } SWGRtlSdrReport::~SWGRtlSdrReport() { @@ -40,6 +42,8 @@ void SWGRtlSdrReport::init() { gains = new QList(); m_gains_isSet = false; + tuner_type = new QString(""); + m_tuner_type_isSet = false; } void @@ -51,6 +55,9 @@ SWGRtlSdrReport::cleanup() { } delete gains; } + if(tuner_type != nullptr) { + delete tuner_type; + } } SWGRtlSdrReport* @@ -66,6 +73,8 @@ void SWGRtlSdrReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&gains, pJson["gains"], "QList", "SWGGain"); + ::SWGSDRangel::setValue(&tuner_type, pJson["tunerType"], "QString", "QString"); + } QString @@ -85,6 +94,9 @@ SWGRtlSdrReport::asJsonObject() { if(gains && gains->size() > 0){ toJsonArray((QList*)gains, obj, "gains", "SWGGain"); } + if(tuner_type != nullptr && *tuner_type != QString("")){ + toJsonValue(QString("tunerType"), tuner_type, obj, QString("QString")); + } return obj; } @@ -99,6 +111,16 @@ SWGRtlSdrReport::setGains(QList* gains) { this->m_gains_isSet = true; } +QString* +SWGRtlSdrReport::getTunerType() { + return tuner_type; +} +void +SWGRtlSdrReport::setTunerType(QString* tuner_type) { + this->tuner_type = tuner_type; + this->m_tuner_type_isSet = true; +} + bool SWGRtlSdrReport::isSet(){ @@ -107,6 +129,9 @@ SWGRtlSdrReport::isSet(){ if(gains && (gains->size() > 0)){ isObjectUpdated = true; break; } + if(tuner_type && *tuner_type != QString("")){ + isObjectUpdated = true; break; + } }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h index c5248ff8c..493e93ab1 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGRtlSdrReport.h @@ -24,6 +24,7 @@ #include "SWGGain.h" #include +#include #include "SWGObject.h" #include "export.h" @@ -46,6 +47,9 @@ public: QList* getGains(); void setGains(QList* gains); + QString* getTunerType(); + void setTunerType(QString* tuner_type); + virtual bool isSet() override; @@ -53,6 +57,9 @@ private: QList* gains; bool m_gains_isSet; + QString* tuner_type; + bool m_tuner_type_isSet; + }; }