diff --git a/plugins/samplesink/bladerfoutput/bladerfoutput.cpp b/plugins/samplesink/bladerfoutput/bladerfoutput.cpp index 4c0d340db..670145da4 100644 --- a/plugins/samplesink/bladerfoutput/bladerfoutput.cpp +++ b/plugins/samplesink/bladerfoutput/bladerfoutput.cpp @@ -535,6 +535,78 @@ bool BladerfOutput::applySettings(const BladeRFOutputSettings& settings, bool fo return true; } +int BladerfOutput::webapiSettingsGet( + SWGSDRangel::SWGDeviceSettings& response, + QString& errorMessage __attribute__((unused))) +{ + response.setBladeRfOutputSettings(new SWGSDRangel::SWGBladeRFOutputSettings()); + response.getBladeRfOutputSettings()->init(); + webapiFormatDeviceSettings(response, m_settings); + return 200; +} + +void BladerfOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const BladeRFOutputSettings& settings) +{ + response.getBladeRfOutputSettings()->setCenterFrequency(settings.m_centerFrequency); + response.getBladeRfOutputSettings()->setDevSampleRate(settings.m_devSampleRate); + response.getBladeRfOutputSettings()->setVga1(settings.m_vga1); + response.getBladeRfOutputSettings()->setVga2(settings.m_vga2); + response.getBladeRfOutputSettings()->setBandwidth(settings.m_bandwidth); + response.getBladeRfOutputSettings()->setLog2Interp(settings.m_log2Interp); + response.getBladeRfOutputSettings()->setXb200(settings.m_xb200 ? 1 : 0); + response.getBladeRfOutputSettings()->setXb200Path((int) settings.m_xb200Path); + response.getBladeRfOutputSettings()->setXb200Filter((int) settings.m_xb200Filter); +} + +int BladerfOutput::webapiSettingsPutPatch( + bool force, + const QStringList& deviceSettingsKeys, + SWGSDRangel::SWGDeviceSettings& response, // query + response + QString& errorMessage __attribute__((unused))) +{ + BladeRFOutputSettings settings = m_settings; + + if (deviceSettingsKeys.contains("centerFrequency")) { + settings.m_centerFrequency = response.getBladeRfOutputSettings()->getCenterFrequency(); + } + if (deviceSettingsKeys.contains("devSampleRate")) { + settings.m_devSampleRate = response.getBladeRfOutputSettings()->getDevSampleRate(); + } + if (deviceSettingsKeys.contains("vga1")) { + settings.m_vga1 = response.getBladeRfOutputSettings()->getVga1(); + } + if (deviceSettingsKeys.contains("vga2")) { + settings.m_vga2 = response.getBladeRfOutputSettings()->getVga2(); + } + if (deviceSettingsKeys.contains("bandwidth")) { + settings.m_bandwidth = response.getBladeRfOutputSettings()->getBandwidth(); + } + if (deviceSettingsKeys.contains("log2Interp")) { + settings.m_log2Interp = response.getBladeRfOutputSettings()->getLog2Interp(); + } + if (deviceSettingsKeys.contains("xb200")) { + settings.m_xb200 = response.getBladeRfOutputSettings()->getXb200() == 0 ? 0 : 1; + } + if (deviceSettingsKeys.contains("xb200Path")) { + settings.m_xb200Path = static_cast(response.getBladeRfOutputSettings()->getXb200Path()); + } + if (deviceSettingsKeys.contains("xb200Filter")) { + settings.m_xb200Filter = static_cast(response.getBladeRfOutputSettings()->getXb200Filter()); + } + + MsgConfigureBladerf *msg = MsgConfigureBladerf::create(settings, force); + m_inputMessageQueue.push(msg); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureBladerf *msgToGUI = MsgConfigureBladerf::create(settings, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatDeviceSettings(response, settings); + return 200; +} + int BladerfOutput::webapiRunGet( SWGSDRangel::SWGDeviceState& response, QString& errorMessage __attribute__((unused))) diff --git a/plugins/samplesink/bladerfoutput/bladerfoutput.h b/plugins/samplesink/bladerfoutput/bladerfoutput.h index 256df577a..9bc3c88c2 100644 --- a/plugins/samplesink/bladerfoutput/bladerfoutput.h +++ b/plugins/samplesink/bladerfoutput/bladerfoutput.h @@ -109,6 +109,16 @@ public: virtual bool handleMessage(const Message& message); + virtual int webapiSettingsGet( + SWGSDRangel::SWGDeviceSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& deviceSettingsKeys, + SWGSDRangel::SWGDeviceSettings& response, // query + response + QString& errorMessage); + virtual int webapiRunGet( SWGSDRangel::SWGDeviceState& response, QString& errorMessage); @@ -122,6 +132,7 @@ private: bool openDevice(); void closeDevice(); bool applySettings(const BladeRFOutputSettings& settings, bool force); + void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const BladeRFOutputSettings& settings); DeviceSinkAPI *m_deviceAPI; QMutex m_mutex; diff --git a/plugins/samplesource/bladerfinput/bladerfinput.cpp b/plugins/samplesource/bladerfinput/bladerfinput.cpp index 62331faf0..aa0ef0ade 100644 --- a/plugins/samplesource/bladerfinput/bladerfinput.cpp +++ b/plugins/samplesource/bladerfinput/bladerfinput.cpp @@ -609,6 +609,94 @@ bladerf_lna_gain BladerfInput::getLnaGain(int lnaGain) } } +int BladerfInput::webapiSettingsGet( + SWGSDRangel::SWGDeviceSettings& response, + QString& errorMessage __attribute__((unused))) +{ + response.setBladeRfInputSettings(new SWGSDRangel::SWGBladeRFInputSettings()); + response.getBladeRfInputSettings()->init(); + webapiFormatDeviceSettings(response, m_settings); + return 200; +} + +void BladerfInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const BladeRFInputSettings& settings) +{ + response.getBladeRfInputSettings()->setCenterFrequency(settings.m_centerFrequency); + response.getBladeRfInputSettings()->setDevSampleRate(settings.m_devSampleRate); + response.getBladeRfInputSettings()->setLnaGain(settings.m_lnaGain); + response.getBladeRfInputSettings()->setVga1(settings.m_vga1); + response.getBladeRfInputSettings()->setVga2(settings.m_vga2); + response.getBladeRfInputSettings()->setBandwidth(settings.m_bandwidth); + response.getBladeRfInputSettings()->setLog2Decim(settings.m_log2Decim); + response.getBladeRfInputSettings()->setFcPos((int) settings.m_fcPos); + response.getBladeRfInputSettings()->setXb200(settings.m_xb200 ? 1 : 0); + response.getBladeRfInputSettings()->setXb200Path((int) settings.m_xb200Path); + response.getBladeRfInputSettings()->setXb200Filter((int) settings.m_xb200Filter); + response.getBladeRfInputSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0); + response.getBladeRfInputSettings()->setIqCorrection(settings.m_iqCorrection ? 1 : 0); +} + +int BladerfInput::webapiSettingsPutPatch( + bool force, + const QStringList& deviceSettingsKeys, + SWGSDRangel::SWGDeviceSettings& response, // query + response + QString& errorMessage __attribute__((unused))) +{ + BladeRFInputSettings settings = m_settings; + + if (deviceSettingsKeys.contains("centerFrequency")) { + settings.m_centerFrequency = response.getBladeRfInputSettings()->getCenterFrequency(); + } + if (deviceSettingsKeys.contains("devSampleRate")) { + settings.m_devSampleRate = response.getBladeRfInputSettings()->getDevSampleRate(); + } + if (deviceSettingsKeys.contains("lnaGain")) { + settings.m_lnaGain = response.getBladeRfInputSettings()->getLnaGain(); + } + if (deviceSettingsKeys.contains("vga1")) { + settings.m_vga1 = response.getBladeRfInputSettings()->getVga1(); + } + if (deviceSettingsKeys.contains("vga2")) { + settings.m_vga2 = response.getBladeRfInputSettings()->getVga2(); + } + if (deviceSettingsKeys.contains("bandwidth")) { + settings.m_bandwidth = response.getBladeRfInputSettings()->getBandwidth(); + } + if (deviceSettingsKeys.contains("log2Decim")) { + settings.m_log2Decim = response.getBladeRfInputSettings()->getLog2Decim(); + } + if (deviceSettingsKeys.contains("fcPos")) { + settings.m_fcPos = static_cast(response.getBladeRfInputSettings()->getFcPos()); + } + if (deviceSettingsKeys.contains("xb200")) { + settings.m_xb200 = response.getBladeRfInputSettings()->getXb200() == 0 ? 0 : 1; + } + if (deviceSettingsKeys.contains("xb200Path")) { + settings.m_xb200Path = static_cast(response.getBladeRfInputSettings()->getXb200Path()); + } + if (deviceSettingsKeys.contains("xb200Filter")) { + settings.m_xb200Filter = static_cast(response.getBladeRfInputSettings()->getXb200Filter()); + } + if (deviceSettingsKeys.contains("dcBlock")) { + settings.m_dcBlock = response.getBladeRfInputSettings()->getDcBlock() != 0; + } + if (deviceSettingsKeys.contains("iqCorrection")) { + settings.m_iqCorrection = response.getBladeRfInputSettings()->getIqCorrection() != 0; + } + + MsgConfigureBladerf *msg = MsgConfigureBladerf::create(settings, force); + m_inputMessageQueue.push(msg); + + if (m_guiMessageQueue) // forward to GUI if any + { + MsgConfigureBladerf *msgToGUI = MsgConfigureBladerf::create(settings, force); + m_guiMessageQueue->push(msgToGUI); + } + + webapiFormatDeviceSettings(response, settings); + return 200; +} + int BladerfInput::webapiRunGet( SWGSDRangel::SWGDeviceState& response, QString& errorMessage __attribute__((unused))) @@ -634,42 +722,3 @@ int BladerfInput::webapiRun( return 200; } - -//struct bladerf *BladerfInput::open_bladerf_from_serial(const char *serial) -//{ -// int status; -// struct bladerf *dev; -// struct bladerf_devinfo info; -// -// /* Initialize all fields to "don't care" wildcard values. -// * -// * Immediately passing this to bladerf_open_with_devinfo() would cause -// * libbladeRF to open any device on any available backend. */ -// bladerf_init_devinfo(&info); -// -// /* Specify the desired device's serial number, while leaving all other -// * fields in the info structure wildcard values */ -// if (serial != NULL) -// { -// strncpy(info.serial, serial, BLADERF_SERIAL_LENGTH - 1); -// info.serial[BLADERF_SERIAL_LENGTH - 1] = '\0'; -// } -// -// status = bladerf_open_with_devinfo(&dev, &info); -// -// if (status == BLADERF_ERR_NODEV) -// { -// fprintf(stderr, "No devices available with serial=%s\n", serial); -// return NULL; -// } -// else if (status != 0) -// { -// fprintf(stderr, "Failed to open device with serial=%s (%s)\n", -// serial, bladerf_strerror(status)); -// return NULL; -// } -// else -// { -// return dev; -// } -//} diff --git a/plugins/samplesource/bladerfinput/bladerfinput.h b/plugins/samplesource/bladerfinput/bladerfinput.h index 1498623eb..74254a5a4 100644 --- a/plugins/samplesource/bladerfinput/bladerfinput.h +++ b/plugins/samplesource/bladerfinput/bladerfinput.h @@ -112,6 +112,16 @@ public: virtual bool handleMessage(const Message& message); + virtual int webapiSettingsGet( + SWGSDRangel::SWGDeviceSettings& response, + QString& errorMessage); + + virtual int webapiSettingsPutPatch( + bool force, + const QStringList& deviceSettingsKeys, + SWGSDRangel::SWGDeviceSettings& response, // query + response + QString& errorMessage); + virtual int webapiRunGet( SWGSDRangel::SWGDeviceState& response, QString& errorMessage); @@ -126,7 +136,7 @@ private: void closeDevice(); bool applySettings(const BladeRFInputSettings& settings, bool force); bladerf_lna_gain getLnaGain(int lnaGain); -// struct bladerf *open_bladerf_from_serial(const char *serial); + void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const BladeRFInputSettings& settings); DeviceSourceAPI *m_deviceAPI; QMutex m_mutex; diff --git a/sdrbase/resources/res.qrc b/sdrbase/resources/res.qrc index 240442a8e..e825ce6dc 100644 --- a/sdrbase/resources/res.qrc +++ b/sdrbase/resources/res.qrc @@ -4,6 +4,7 @@ webapi/doc/swagger/swagger.yaml webapi/doc/swagger/include/CWKeyer.yaml webapi/doc/swagger/include/AirspyHF.yaml + webapi/doc/swagger/include/BladeRF.yaml webapi/doc/swagger/include/FileSource.yaml webapi/doc/swagger/include/HackRF.yaml webapi/doc/swagger/include/LimeSdr.yaml diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index cfff66bdd..48b129fcf 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -886,6 +886,84 @@ margin-bottom: 20px; } }, "description" : "Audio output device" +}; + defs.BladeRFInputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "lnaGain" : { + "type" : "integer" + }, + "vga1" : { + "type" : "integer" + }, + "vga2" : { + "type" : "integer" + }, + "bandwidth" : { + "type" : "integer" + }, + "log2Decim" : { + "type" : "integer" + }, + "fcPos" : { + "type" : "integer" + }, + "xb200" : { + "type" : "integer" + }, + "xb200Path" : { + "type" : "integer" + }, + "xb200Filter" : { + "type" : "integer" + }, + "dcBlock" : { + "type" : "integer" + }, + "iqCorrection" : { + "type" : "integer" + } + }, + "description" : "BladeRF" +}; + defs.BladeRFOutputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "vga1" : { + "type" : "integer" + }, + "vga2" : { + "type" : "integer" + }, + "bandwidth" : { + "type" : "integer" + }, + "log2Interp" : { + "type" : "integer" + }, + "xb200" : { + "type" : "integer" + }, + "xb200Path" : { + "type" : "integer" + }, + "xb200Filter" : { + "type" : "integer" + } + }, + "description" : "BladeRF" }; defs.CWKeyerSettings = { "properties" : { @@ -1152,6 +1230,12 @@ margin-bottom: 20px; "airspyHFSettings" : { "$ref" : "#/definitions/AirspyHFSettings" }, + "bladeRFInputSettings" : { + "$ref" : "#/definitions/BladeRFInputSettings" + }, + "bladeRFOutputSettings" : { + "$ref" : "#/definitions/BladeRFOutputSettings" + }, "fileSourceSettings" : { "$ref" : "#/definitions/FileSourceSettings" }, @@ -20106,7 +20190,7 @@ except ApiException as e:
- Generated 2018-03-29T15:31:47.724+02:00 + Generated 2018-03-31T18:20:57.874+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/BladeRF.yaml b/sdrbase/resources/webapi/doc/swagger/include/BladeRF.yaml new file mode 100644 index 000000000..8f75f9460 --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/BladeRF.yaml @@ -0,0 +1,54 @@ +BladeRFInputSettings: + description: BladeRF + properties: + centerFrequency: + type: integer + format: int64 + devSampleRate: + type: integer + lnaGain: + type: integer + vga1: + type: integer + vga2: + type: integer + bandwidth: + type: integer + log2Decim: + type: integer + fcPos: + type: integer + xb200: + type: integer + xb200Path: + type: integer + xb200Filter: + type: integer + dcBlock: + type: integer + iqCorrection: + type: integer + +BladeRFOutputSettings: + description: BladeRF + properties: + centerFrequency: + type: integer + format: int64 + devSampleRate: + type: integer + vga1: + type: integer + vga2: + type: integer + bandwidth: + type: integer + log2Interp: + type: integer + xb200: + type: integer + xb200Path: + type: integer + xb200Filter: + type: integer + \ No newline at end of file diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index 052ee876b..d5380e57e 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -1715,6 +1715,10 @@ definitions: type: integer airspyHFSettings: $ref: "/doc/swagger/include/AirspyHF.yaml#/AirspyHFSettings" + bladeRFInputSettings: + $ref: "/doc/swagger/include/BladeRF.yaml#/BladeRFInputSettings" + bladeRFOutputSettings: + $ref: "/doc/swagger/include/BladeRF.yaml#/BladeRFOutputSettings" fileSourceSettings: $ref: "/doc/swagger/include/FileSource.yaml#/FileSourceSettings" hackRFInputSettings: diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 8423b1a83..7c60fc521 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -1696,6 +1696,36 @@ bool WebAPIRequestMapper::validateDeviceSettings( return false; } } + else if ((*deviceHwType == "BladeRF") && (deviceSettings.getTx() == 0)) + { + if (jsonObject.contains("bladeRFInputSettings") && jsonObject["bladeRFInputSettings"].isObject()) + { + QJsonObject bladeRFInputSettingsJsonObject = jsonObject["bladeRFInputSettings"].toObject(); + deviceSettingsKeys = bladeRFInputSettingsJsonObject.keys(); + deviceSettings.setBladeRfInputSettings(new SWGSDRangel::SWGBladeRFInputSettings()); + deviceSettings.getBladeRfInputSettings()->fromJsonObject(bladeRFInputSettingsJsonObject); + return true; + } + else + { + return false; + } + } + else if ((*deviceHwType == "BladeRF") && (deviceSettings.getTx() != 0)) + { + if (jsonObject.contains("bladeRFOutputSettings") && jsonObject["bladeRFOutputSettings"].isObject()) + { + QJsonObject bladeRFOutputSettingsJsonObject = jsonObject["bladeRFOutputSettings"].toObject(); + deviceSettingsKeys = bladeRFOutputSettingsJsonObject.keys(); + deviceSettings.setBladeRfOutputSettings(new SWGSDRangel::SWGBladeRFOutputSettings()); + deviceSettings.getBladeRfOutputSettings()->fromJsonObject(bladeRFOutputSettingsJsonObject); + return true; + } + else + { + return false; + } + } else if ((*deviceHwType == "HackRF") && (deviceSettings.getTx() == 0)) { if (jsonObject.contains("hackRFInputSettings") && jsonObject["hackRFInputSettings"].isObject()) diff --git a/swagger/sdrangel/api/swagger/include/BladeRF.yaml b/swagger/sdrangel/api/swagger/include/BladeRF.yaml new file mode 100644 index 000000000..8f75f9460 --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/BladeRF.yaml @@ -0,0 +1,54 @@ +BladeRFInputSettings: + description: BladeRF + properties: + centerFrequency: + type: integer + format: int64 + devSampleRate: + type: integer + lnaGain: + type: integer + vga1: + type: integer + vga2: + type: integer + bandwidth: + type: integer + log2Decim: + type: integer + fcPos: + type: integer + xb200: + type: integer + xb200Path: + type: integer + xb200Filter: + type: integer + dcBlock: + type: integer + iqCorrection: + type: integer + +BladeRFOutputSettings: + description: BladeRF + properties: + centerFrequency: + type: integer + format: int64 + devSampleRate: + type: integer + vga1: + type: integer + vga2: + type: integer + bandwidth: + type: integer + log2Interp: + type: integer + xb200: + type: integer + xb200Path: + type: integer + xb200Filter: + type: integer + \ No newline at end of file diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index e2a9f5d88..350eba899 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -1715,6 +1715,10 @@ definitions: type: integer airspyHFSettings: $ref: "http://localhost:8081/api/swagger/include/AirspyHF.yaml#/AirspyHFSettings" + bladeRFInputSettings: + $ref: "http://localhost:8081/api/swagger/include/BladeRF.yaml#/BladeRFInputSettings" + bladeRFOutputSettings: + $ref: "http://localhost:8081/api/swagger/include/BladeRF.yaml#/BladeRFOutputSettings" fileSourceSettings: $ref: "http://localhost:8081/api/swagger/include/FileSource.yaml#/FileSourceSettings" hackRFInputSettings: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index cfff66bdd..48b129fcf 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -886,6 +886,84 @@ margin-bottom: 20px; } }, "description" : "Audio output device" +}; + defs.BladeRFInputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "lnaGain" : { + "type" : "integer" + }, + "vga1" : { + "type" : "integer" + }, + "vga2" : { + "type" : "integer" + }, + "bandwidth" : { + "type" : "integer" + }, + "log2Decim" : { + "type" : "integer" + }, + "fcPos" : { + "type" : "integer" + }, + "xb200" : { + "type" : "integer" + }, + "xb200Path" : { + "type" : "integer" + }, + "xb200Filter" : { + "type" : "integer" + }, + "dcBlock" : { + "type" : "integer" + }, + "iqCorrection" : { + "type" : "integer" + } + }, + "description" : "BladeRF" +}; + defs.BladeRFOutputSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "devSampleRate" : { + "type" : "integer" + }, + "vga1" : { + "type" : "integer" + }, + "vga2" : { + "type" : "integer" + }, + "bandwidth" : { + "type" : "integer" + }, + "log2Interp" : { + "type" : "integer" + }, + "xb200" : { + "type" : "integer" + }, + "xb200Path" : { + "type" : "integer" + }, + "xb200Filter" : { + "type" : "integer" + } + }, + "description" : "BladeRF" }; defs.CWKeyerSettings = { "properties" : { @@ -1152,6 +1230,12 @@ margin-bottom: 20px; "airspyHFSettings" : { "$ref" : "#/definitions/AirspyHFSettings" }, + "bladeRFInputSettings" : { + "$ref" : "#/definitions/BladeRFInputSettings" + }, + "bladeRFOutputSettings" : { + "$ref" : "#/definitions/BladeRFOutputSettings" + }, "fileSourceSettings" : { "$ref" : "#/definitions/FileSourceSettings" }, @@ -20106,7 +20190,7 @@ except ApiException as e:
- Generated 2018-03-29T15:31:47.724+02:00 + Generated 2018-03-31T18:20:57.874+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGBladeRFInputSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGBladeRFInputSettings.cpp new file mode 100644 index 000000000..3485436f4 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBladeRFInputSettings.cpp @@ -0,0 +1,358 @@ +/** + * 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. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * 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 demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * OpenAPI spec version: 4.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 "SWGBladeRFInputSettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGBladeRFInputSettings::SWGBladeRFInputSettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGBladeRFInputSettings::SWGBladeRFInputSettings() { + center_frequency = 0L; + m_center_frequency_isSet = false; + dev_sample_rate = 0; + m_dev_sample_rate_isSet = false; + lna_gain = 0; + m_lna_gain_isSet = false; + vga1 = 0; + m_vga1_isSet = false; + vga2 = 0; + m_vga2_isSet = false; + bandwidth = 0; + m_bandwidth_isSet = false; + log2_decim = 0; + m_log2_decim_isSet = false; + fc_pos = 0; + m_fc_pos_isSet = false; + xb200 = 0; + m_xb200_isSet = false; + xb200_path = 0; + m_xb200_path_isSet = false; + xb200_filter = 0; + m_xb200_filter_isSet = false; + dc_block = 0; + m_dc_block_isSet = false; + iq_correction = 0; + m_iq_correction_isSet = false; +} + +SWGBladeRFInputSettings::~SWGBladeRFInputSettings() { + this->cleanup(); +} + +void +SWGBladeRFInputSettings::init() { + center_frequency = 0L; + m_center_frequency_isSet = false; + dev_sample_rate = 0; + m_dev_sample_rate_isSet = false; + lna_gain = 0; + m_lna_gain_isSet = false; + vga1 = 0; + m_vga1_isSet = false; + vga2 = 0; + m_vga2_isSet = false; + bandwidth = 0; + m_bandwidth_isSet = false; + log2_decim = 0; + m_log2_decim_isSet = false; + fc_pos = 0; + m_fc_pos_isSet = false; + xb200 = 0; + m_xb200_isSet = false; + xb200_path = 0; + m_xb200_path_isSet = false; + xb200_filter = 0; + m_xb200_filter_isSet = false; + dc_block = 0; + m_dc_block_isSet = false; + iq_correction = 0; + m_iq_correction_isSet = false; +} + +void +SWGBladeRFInputSettings::cleanup() { + + + + + + + + + + + + + +} + +SWGBladeRFInputSettings* +SWGBladeRFInputSettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGBladeRFInputSettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", ""); + + ::SWGSDRangel::setValue(&lna_gain, pJson["lnaGain"], "qint32", ""); + + ::SWGSDRangel::setValue(&vga1, pJson["vga1"], "qint32", ""); + + ::SWGSDRangel::setValue(&vga2, pJson["vga2"], "qint32", ""); + + ::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", ""); + + ::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", ""); + + ::SWGSDRangel::setValue(&fc_pos, pJson["fcPos"], "qint32", ""); + + ::SWGSDRangel::setValue(&xb200, pJson["xb200"], "qint32", ""); + + ::SWGSDRangel::setValue(&xb200_path, pJson["xb200Path"], "qint32", ""); + + ::SWGSDRangel::setValue(&xb200_filter, pJson["xb200Filter"], "qint32", ""); + + ::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", ""); + + ::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "qint32", ""); + +} + +QString +SWGBladeRFInputSettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGBladeRFInputSettings::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_center_frequency_isSet){ + obj->insert("centerFrequency", QJsonValue(center_frequency)); + } + if(m_dev_sample_rate_isSet){ + obj->insert("devSampleRate", QJsonValue(dev_sample_rate)); + } + if(m_lna_gain_isSet){ + obj->insert("lnaGain", QJsonValue(lna_gain)); + } + if(m_vga1_isSet){ + obj->insert("vga1", QJsonValue(vga1)); + } + if(m_vga2_isSet){ + obj->insert("vga2", QJsonValue(vga2)); + } + if(m_bandwidth_isSet){ + obj->insert("bandwidth", QJsonValue(bandwidth)); + } + if(m_log2_decim_isSet){ + obj->insert("log2Decim", QJsonValue(log2_decim)); + } + if(m_fc_pos_isSet){ + obj->insert("fcPos", QJsonValue(fc_pos)); + } + if(m_xb200_isSet){ + obj->insert("xb200", QJsonValue(xb200)); + } + if(m_xb200_path_isSet){ + obj->insert("xb200Path", QJsonValue(xb200_path)); + } + if(m_xb200_filter_isSet){ + obj->insert("xb200Filter", QJsonValue(xb200_filter)); + } + if(m_dc_block_isSet){ + obj->insert("dcBlock", QJsonValue(dc_block)); + } + if(m_iq_correction_isSet){ + obj->insert("iqCorrection", QJsonValue(iq_correction)); + } + + return obj; +} + +qint64 +SWGBladeRFInputSettings::getCenterFrequency() { + return center_frequency; +} +void +SWGBladeRFInputSettings::setCenterFrequency(qint64 center_frequency) { + this->center_frequency = center_frequency; + this->m_center_frequency_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getDevSampleRate() { + return dev_sample_rate; +} +void +SWGBladeRFInputSettings::setDevSampleRate(qint32 dev_sample_rate) { + this->dev_sample_rate = dev_sample_rate; + this->m_dev_sample_rate_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getLnaGain() { + return lna_gain; +} +void +SWGBladeRFInputSettings::setLnaGain(qint32 lna_gain) { + this->lna_gain = lna_gain; + this->m_lna_gain_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getVga1() { + return vga1; +} +void +SWGBladeRFInputSettings::setVga1(qint32 vga1) { + this->vga1 = vga1; + this->m_vga1_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getVga2() { + return vga2; +} +void +SWGBladeRFInputSettings::setVga2(qint32 vga2) { + this->vga2 = vga2; + this->m_vga2_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getBandwidth() { + return bandwidth; +} +void +SWGBladeRFInputSettings::setBandwidth(qint32 bandwidth) { + this->bandwidth = bandwidth; + this->m_bandwidth_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getLog2Decim() { + return log2_decim; +} +void +SWGBladeRFInputSettings::setLog2Decim(qint32 log2_decim) { + this->log2_decim = log2_decim; + this->m_log2_decim_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getFcPos() { + return fc_pos; +} +void +SWGBladeRFInputSettings::setFcPos(qint32 fc_pos) { + this->fc_pos = fc_pos; + this->m_fc_pos_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getXb200() { + return xb200; +} +void +SWGBladeRFInputSettings::setXb200(qint32 xb200) { + this->xb200 = xb200; + this->m_xb200_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getXb200Path() { + return xb200_path; +} +void +SWGBladeRFInputSettings::setXb200Path(qint32 xb200_path) { + this->xb200_path = xb200_path; + this->m_xb200_path_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getXb200Filter() { + return xb200_filter; +} +void +SWGBladeRFInputSettings::setXb200Filter(qint32 xb200_filter) { + this->xb200_filter = xb200_filter; + this->m_xb200_filter_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getDcBlock() { + return dc_block; +} +void +SWGBladeRFInputSettings::setDcBlock(qint32 dc_block) { + this->dc_block = dc_block; + this->m_dc_block_isSet = true; +} + +qint32 +SWGBladeRFInputSettings::getIqCorrection() { + return iq_correction; +} +void +SWGBladeRFInputSettings::setIqCorrection(qint32 iq_correction) { + this->iq_correction = iq_correction; + this->m_iq_correction_isSet = true; +} + + +bool +SWGBladeRFInputSettings::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_center_frequency_isSet){ isObjectUpdated = true; break;} + if(m_dev_sample_rate_isSet){ isObjectUpdated = true; break;} + if(m_lna_gain_isSet){ isObjectUpdated = true; break;} + if(m_vga1_isSet){ isObjectUpdated = true; break;} + if(m_vga2_isSet){ isObjectUpdated = true; break;} + if(m_bandwidth_isSet){ isObjectUpdated = true; break;} + if(m_log2_decim_isSet){ isObjectUpdated = true; break;} + if(m_fc_pos_isSet){ isObjectUpdated = true; break;} + if(m_xb200_isSet){ isObjectUpdated = true; break;} + if(m_xb200_path_isSet){ isObjectUpdated = true; break;} + if(m_xb200_filter_isSet){ isObjectUpdated = true; break;} + if(m_dc_block_isSet){ isObjectUpdated = true; break;} + if(m_iq_correction_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGBladeRFInputSettings.h b/swagger/sdrangel/code/qt5/client/SWGBladeRFInputSettings.h new file mode 100644 index 000000000..89e8465b9 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBladeRFInputSettings.h @@ -0,0 +1,130 @@ +/** + * 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. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * 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 demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * OpenAPI spec version: 4.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. + */ + +/* + * SWGBladeRFInputSettings.h + * + * BladeRF + */ + +#ifndef SWGBladeRFInputSettings_H_ +#define SWGBladeRFInputSettings_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGBladeRFInputSettings: public SWGObject { +public: + SWGBladeRFInputSettings(); + SWGBladeRFInputSettings(QString* json); + virtual ~SWGBladeRFInputSettings(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGBladeRFInputSettings* fromJson(QString &jsonString) override; + + qint64 getCenterFrequency(); + void setCenterFrequency(qint64 center_frequency); + + qint32 getDevSampleRate(); + void setDevSampleRate(qint32 dev_sample_rate); + + qint32 getLnaGain(); + void setLnaGain(qint32 lna_gain); + + qint32 getVga1(); + void setVga1(qint32 vga1); + + qint32 getVga2(); + void setVga2(qint32 vga2); + + qint32 getBandwidth(); + void setBandwidth(qint32 bandwidth); + + qint32 getLog2Decim(); + void setLog2Decim(qint32 log2_decim); + + qint32 getFcPos(); + void setFcPos(qint32 fc_pos); + + qint32 getXb200(); + void setXb200(qint32 xb200); + + qint32 getXb200Path(); + void setXb200Path(qint32 xb200_path); + + qint32 getXb200Filter(); + void setXb200Filter(qint32 xb200_filter); + + qint32 getDcBlock(); + void setDcBlock(qint32 dc_block); + + qint32 getIqCorrection(); + void setIqCorrection(qint32 iq_correction); + + + virtual bool isSet() override; + +private: + qint64 center_frequency; + bool m_center_frequency_isSet; + + qint32 dev_sample_rate; + bool m_dev_sample_rate_isSet; + + qint32 lna_gain; + bool m_lna_gain_isSet; + + qint32 vga1; + bool m_vga1_isSet; + + qint32 vga2; + bool m_vga2_isSet; + + qint32 bandwidth; + bool m_bandwidth_isSet; + + qint32 log2_decim; + bool m_log2_decim_isSet; + + qint32 fc_pos; + bool m_fc_pos_isSet; + + qint32 xb200; + bool m_xb200_isSet; + + qint32 xb200_path; + bool m_xb200_path_isSet; + + qint32 xb200_filter; + bool m_xb200_filter_isSet; + + qint32 dc_block; + bool m_dc_block_isSet; + + qint32 iq_correction; + bool m_iq_correction_isSet; + +}; + +} + +#endif /* SWGBladeRFInputSettings_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGBladeRFOutputSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGBladeRFOutputSettings.cpp new file mode 100644 index 000000000..f60d18998 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBladeRFOutputSettings.cpp @@ -0,0 +1,274 @@ +/** + * 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. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * 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 demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * OpenAPI spec version: 4.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 "SWGBladeRFOutputSettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGBladeRFOutputSettings::SWGBladeRFOutputSettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGBladeRFOutputSettings::SWGBladeRFOutputSettings() { + center_frequency = 0L; + m_center_frequency_isSet = false; + dev_sample_rate = 0; + m_dev_sample_rate_isSet = false; + vga1 = 0; + m_vga1_isSet = false; + vga2 = 0; + m_vga2_isSet = false; + bandwidth = 0; + m_bandwidth_isSet = false; + log2_interp = 0; + m_log2_interp_isSet = false; + xb200 = 0; + m_xb200_isSet = false; + xb200_path = 0; + m_xb200_path_isSet = false; + xb200_filter = 0; + m_xb200_filter_isSet = false; +} + +SWGBladeRFOutputSettings::~SWGBladeRFOutputSettings() { + this->cleanup(); +} + +void +SWGBladeRFOutputSettings::init() { + center_frequency = 0L; + m_center_frequency_isSet = false; + dev_sample_rate = 0; + m_dev_sample_rate_isSet = false; + vga1 = 0; + m_vga1_isSet = false; + vga2 = 0; + m_vga2_isSet = false; + bandwidth = 0; + m_bandwidth_isSet = false; + log2_interp = 0; + m_log2_interp_isSet = false; + xb200 = 0; + m_xb200_isSet = false; + xb200_path = 0; + m_xb200_path_isSet = false; + xb200_filter = 0; + m_xb200_filter_isSet = false; +} + +void +SWGBladeRFOutputSettings::cleanup() { + + + + + + + + + +} + +SWGBladeRFOutputSettings* +SWGBladeRFOutputSettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGBladeRFOutputSettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&dev_sample_rate, pJson["devSampleRate"], "qint32", ""); + + ::SWGSDRangel::setValue(&vga1, pJson["vga1"], "qint32", ""); + + ::SWGSDRangel::setValue(&vga2, pJson["vga2"], "qint32", ""); + + ::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", ""); + + ::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", ""); + + ::SWGSDRangel::setValue(&xb200, pJson["xb200"], "qint32", ""); + + ::SWGSDRangel::setValue(&xb200_path, pJson["xb200Path"], "qint32", ""); + + ::SWGSDRangel::setValue(&xb200_filter, pJson["xb200Filter"], "qint32", ""); + +} + +QString +SWGBladeRFOutputSettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGBladeRFOutputSettings::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_center_frequency_isSet){ + obj->insert("centerFrequency", QJsonValue(center_frequency)); + } + if(m_dev_sample_rate_isSet){ + obj->insert("devSampleRate", QJsonValue(dev_sample_rate)); + } + if(m_vga1_isSet){ + obj->insert("vga1", QJsonValue(vga1)); + } + if(m_vga2_isSet){ + obj->insert("vga2", QJsonValue(vga2)); + } + if(m_bandwidth_isSet){ + obj->insert("bandwidth", QJsonValue(bandwidth)); + } + if(m_log2_interp_isSet){ + obj->insert("log2Interp", QJsonValue(log2_interp)); + } + if(m_xb200_isSet){ + obj->insert("xb200", QJsonValue(xb200)); + } + if(m_xb200_path_isSet){ + obj->insert("xb200Path", QJsonValue(xb200_path)); + } + if(m_xb200_filter_isSet){ + obj->insert("xb200Filter", QJsonValue(xb200_filter)); + } + + return obj; +} + +qint64 +SWGBladeRFOutputSettings::getCenterFrequency() { + return center_frequency; +} +void +SWGBladeRFOutputSettings::setCenterFrequency(qint64 center_frequency) { + this->center_frequency = center_frequency; + this->m_center_frequency_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getDevSampleRate() { + return dev_sample_rate; +} +void +SWGBladeRFOutputSettings::setDevSampleRate(qint32 dev_sample_rate) { + this->dev_sample_rate = dev_sample_rate; + this->m_dev_sample_rate_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getVga1() { + return vga1; +} +void +SWGBladeRFOutputSettings::setVga1(qint32 vga1) { + this->vga1 = vga1; + this->m_vga1_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getVga2() { + return vga2; +} +void +SWGBladeRFOutputSettings::setVga2(qint32 vga2) { + this->vga2 = vga2; + this->m_vga2_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getBandwidth() { + return bandwidth; +} +void +SWGBladeRFOutputSettings::setBandwidth(qint32 bandwidth) { + this->bandwidth = bandwidth; + this->m_bandwidth_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getLog2Interp() { + return log2_interp; +} +void +SWGBladeRFOutputSettings::setLog2Interp(qint32 log2_interp) { + this->log2_interp = log2_interp; + this->m_log2_interp_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getXb200() { + return xb200; +} +void +SWGBladeRFOutputSettings::setXb200(qint32 xb200) { + this->xb200 = xb200; + this->m_xb200_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getXb200Path() { + return xb200_path; +} +void +SWGBladeRFOutputSettings::setXb200Path(qint32 xb200_path) { + this->xb200_path = xb200_path; + this->m_xb200_path_isSet = true; +} + +qint32 +SWGBladeRFOutputSettings::getXb200Filter() { + return xb200_filter; +} +void +SWGBladeRFOutputSettings::setXb200Filter(qint32 xb200_filter) { + this->xb200_filter = xb200_filter; + this->m_xb200_filter_isSet = true; +} + + +bool +SWGBladeRFOutputSettings::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_center_frequency_isSet){ isObjectUpdated = true; break;} + if(m_dev_sample_rate_isSet){ isObjectUpdated = true; break;} + if(m_vga1_isSet){ isObjectUpdated = true; break;} + if(m_vga2_isSet){ isObjectUpdated = true; break;} + if(m_bandwidth_isSet){ isObjectUpdated = true; break;} + if(m_log2_interp_isSet){ isObjectUpdated = true; break;} + if(m_xb200_isSet){ isObjectUpdated = true; break;} + if(m_xb200_path_isSet){ isObjectUpdated = true; break;} + if(m_xb200_filter_isSet){ isObjectUpdated = true; break;} + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGBladeRFOutputSettings.h b/swagger/sdrangel/code/qt5/client/SWGBladeRFOutputSettings.h new file mode 100644 index 000000000..c24a434df --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBladeRFOutputSettings.h @@ -0,0 +1,106 @@ +/** + * 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. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * 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 demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 --- + * + * OpenAPI spec version: 4.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. + */ + +/* + * SWGBladeRFOutputSettings.h + * + * BladeRF + */ + +#ifndef SWGBladeRFOutputSettings_H_ +#define SWGBladeRFOutputSettings_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGBladeRFOutputSettings: public SWGObject { +public: + SWGBladeRFOutputSettings(); + SWGBladeRFOutputSettings(QString* json); + virtual ~SWGBladeRFOutputSettings(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGBladeRFOutputSettings* fromJson(QString &jsonString) override; + + qint64 getCenterFrequency(); + void setCenterFrequency(qint64 center_frequency); + + qint32 getDevSampleRate(); + void setDevSampleRate(qint32 dev_sample_rate); + + qint32 getVga1(); + void setVga1(qint32 vga1); + + qint32 getVga2(); + void setVga2(qint32 vga2); + + qint32 getBandwidth(); + void setBandwidth(qint32 bandwidth); + + qint32 getLog2Interp(); + void setLog2Interp(qint32 log2_interp); + + qint32 getXb200(); + void setXb200(qint32 xb200); + + qint32 getXb200Path(); + void setXb200Path(qint32 xb200_path); + + qint32 getXb200Filter(); + void setXb200Filter(qint32 xb200_filter); + + + virtual bool isSet() override; + +private: + qint64 center_frequency; + bool m_center_frequency_isSet; + + qint32 dev_sample_rate; + bool m_dev_sample_rate_isSet; + + qint32 vga1; + bool m_vga1_isSet; + + qint32 vga2; + bool m_vga2_isSet; + + qint32 bandwidth; + bool m_bandwidth_isSet; + + qint32 log2_interp; + bool m_log2_interp_isSet; + + qint32 xb200; + bool m_xb200_isSet; + + qint32 xb200_path; + bool m_xb200_path_isSet; + + qint32 xb200_filter; + bool m_xb200_filter_isSet; + +}; + +} + +#endif /* SWGBladeRFOutputSettings_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp index 28f28926b..d798ead5b 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp @@ -34,6 +34,10 @@ SWGDeviceSettings::SWGDeviceSettings() { m_tx_isSet = false; airspy_hf_settings = nullptr; m_airspy_hf_settings_isSet = false; + blade_rf_input_settings = nullptr; + m_blade_rf_input_settings_isSet = false; + blade_rf_output_settings = nullptr; + m_blade_rf_output_settings_isSet = false; file_source_settings = nullptr; m_file_source_settings_isSet = false; hack_rf_input_settings = nullptr; @@ -60,6 +64,10 @@ SWGDeviceSettings::init() { m_tx_isSet = false; airspy_hf_settings = new SWGAirspyHFSettings(); m_airspy_hf_settings_isSet = false; + blade_rf_input_settings = new SWGBladeRFInputSettings(); + m_blade_rf_input_settings_isSet = false; + blade_rf_output_settings = new SWGBladeRFOutputSettings(); + m_blade_rf_output_settings_isSet = false; file_source_settings = new SWGFileSourceSettings(); m_file_source_settings_isSet = false; hack_rf_input_settings = new SWGHackRFInputSettings(); @@ -83,6 +91,12 @@ SWGDeviceSettings::cleanup() { if(airspy_hf_settings != nullptr) { delete airspy_hf_settings; } + if(blade_rf_input_settings != nullptr) { + delete blade_rf_input_settings; + } + if(blade_rf_output_settings != nullptr) { + delete blade_rf_output_settings; + } if(file_source_settings != nullptr) { delete file_source_settings; } @@ -120,6 +134,10 @@ SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&airspy_hf_settings, pJson["airspyHFSettings"], "SWGAirspyHFSettings", "SWGAirspyHFSettings"); + ::SWGSDRangel::setValue(&blade_rf_input_settings, pJson["bladeRFInputSettings"], "SWGBladeRFInputSettings", "SWGBladeRFInputSettings"); + + ::SWGSDRangel::setValue(&blade_rf_output_settings, pJson["bladeRFOutputSettings"], "SWGBladeRFOutputSettings", "SWGBladeRFOutputSettings"); + ::SWGSDRangel::setValue(&file_source_settings, pJson["fileSourceSettings"], "SWGFileSourceSettings", "SWGFileSourceSettings"); ::SWGSDRangel::setValue(&hack_rf_input_settings, pJson["hackRFInputSettings"], "SWGHackRFInputSettings", "SWGHackRFInputSettings"); @@ -157,6 +175,12 @@ SWGDeviceSettings::asJsonObject() { if((airspy_hf_settings != nullptr) && (airspy_hf_settings->isSet())){ toJsonValue(QString("airspyHFSettings"), airspy_hf_settings, obj, QString("SWGAirspyHFSettings")); } + if((blade_rf_input_settings != nullptr) && (blade_rf_input_settings->isSet())){ + toJsonValue(QString("bladeRFInputSettings"), blade_rf_input_settings, obj, QString("SWGBladeRFInputSettings")); + } + if((blade_rf_output_settings != nullptr) && (blade_rf_output_settings->isSet())){ + toJsonValue(QString("bladeRFOutputSettings"), blade_rf_output_settings, obj, QString("SWGBladeRFOutputSettings")); + } if((file_source_settings != nullptr) && (file_source_settings->isSet())){ toJsonValue(QString("fileSourceSettings"), file_source_settings, obj, QString("SWGFileSourceSettings")); } @@ -209,6 +233,26 @@ SWGDeviceSettings::setAirspyHfSettings(SWGAirspyHFSettings* airspy_hf_settings) this->m_airspy_hf_settings_isSet = true; } +SWGBladeRFInputSettings* +SWGDeviceSettings::getBladeRfInputSettings() { + return blade_rf_input_settings; +} +void +SWGDeviceSettings::setBladeRfInputSettings(SWGBladeRFInputSettings* blade_rf_input_settings) { + this->blade_rf_input_settings = blade_rf_input_settings; + this->m_blade_rf_input_settings_isSet = true; +} + +SWGBladeRFOutputSettings* +SWGDeviceSettings::getBladeRfOutputSettings() { + return blade_rf_output_settings; +} +void +SWGDeviceSettings::setBladeRfOutputSettings(SWGBladeRFOutputSettings* blade_rf_output_settings) { + this->blade_rf_output_settings = blade_rf_output_settings; + this->m_blade_rf_output_settings_isSet = true; +} + SWGFileSourceSettings* SWGDeviceSettings::getFileSourceSettings() { return file_source_settings; @@ -277,6 +321,8 @@ SWGDeviceSettings::isSet(){ if(device_hw_type != nullptr && *device_hw_type != QString("")){ isObjectUpdated = true; break;} if(m_tx_isSet){ isObjectUpdated = true; break;} if(airspy_hf_settings != nullptr && airspy_hf_settings->isSet()){ isObjectUpdated = true; break;} + if(blade_rf_input_settings != nullptr && blade_rf_input_settings->isSet()){ isObjectUpdated = true; break;} + if(blade_rf_output_settings != nullptr && blade_rf_output_settings->isSet()){ isObjectUpdated = true; break;} if(file_source_settings != nullptr && file_source_settings->isSet()){ isObjectUpdated = true; break;} if(hack_rf_input_settings != nullptr && hack_rf_input_settings->isSet()){ isObjectUpdated = true; break;} if(hack_rf_output_settings != nullptr && hack_rf_output_settings->isSet()){ isObjectUpdated = true; break;} diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h index 2268a2c77..c9ec69600 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h @@ -23,6 +23,8 @@ #include "SWGAirspyHFSettings.h" +#include "SWGBladeRFInputSettings.h" +#include "SWGBladeRFOutputSettings.h" #include "SWGFileSourceSettings.h" #include "SWGHackRFInputSettings.h" #include "SWGHackRFOutputSettings.h" @@ -58,6 +60,12 @@ public: SWGAirspyHFSettings* getAirspyHfSettings(); void setAirspyHfSettings(SWGAirspyHFSettings* airspy_hf_settings); + SWGBladeRFInputSettings* getBladeRfInputSettings(); + void setBladeRfInputSettings(SWGBladeRFInputSettings* blade_rf_input_settings); + + SWGBladeRFOutputSettings* getBladeRfOutputSettings(); + void setBladeRfOutputSettings(SWGBladeRFOutputSettings* blade_rf_output_settings); + SWGFileSourceSettings* getFileSourceSettings(); void setFileSourceSettings(SWGFileSourceSettings* file_source_settings); @@ -89,6 +97,12 @@ private: SWGAirspyHFSettings* airspy_hf_settings; bool m_airspy_hf_settings_isSet; + SWGBladeRFInputSettings* blade_rf_input_settings; + bool m_blade_rf_input_settings_isSet; + + SWGBladeRFOutputSettings* blade_rf_output_settings; + bool m_blade_rf_output_settings_isSet; + SWGFileSourceSettings* file_source_settings; bool m_file_source_settings_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index a4425de8e..5232fc21f 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -20,6 +20,8 @@ #include "SWGAudioDevices.h" #include "SWGAudioInputDevice.h" #include "SWGAudioOutputDevice.h" +#include "SWGBladeRFInputSettings.h" +#include "SWGBladeRFOutputSettings.h" #include "SWGCWKeyerSettings.h" #include "SWGChannel.h" #include "SWGChannelListItem.h" @@ -80,6 +82,12 @@ namespace SWGSDRangel { if(QString("SWGAudioOutputDevice").compare(type) == 0) { return new SWGAudioOutputDevice(); } + if(QString("SWGBladeRFInputSettings").compare(type) == 0) { + return new SWGBladeRFInputSettings(); + } + if(QString("SWGBladeRFOutputSettings").compare(type) == 0) { + return new SWGBladeRFOutputSettings(); + } if(QString("SWGCWKeyerSettings").compare(type) == 0) { return new SWGCWKeyerSettings(); }