REST API: removed old SDRDaemon code

This commit is contained in:
f4exb 2018-09-11 14:52:16 +02:00
parent 86598d1bd8
commit 9cfaf47a00
216 changed files with 384 additions and 13702 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1236,366 +1236,12 @@ paths:
"501":
$ref: "#/responses/Response_501"
/sdrdaemon:
x-swagger-router-controller: daemon
get:
description: get SDRdaemon summary information
operationId: daemonInstanceSummary
tags:
- Daemon
responses:
"200":
description: Success
schema:
# a pointer to a definition
$ref: "#/definitions/DaemonSummaryResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/logging:
x-swagger-router-controller: daemon
get:
description: Get logging information for this instance
operationId: daemonInstanceLoggingGet
tags:
- Daemon
responses:
"200":
description: Success
schema:
$ref: "#/definitions/LoggingInfo"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Change logging parmeters for this instance
operationId: daemonInstanceLoggingPut
tags:
- Daemon
consumes:
- application/json
parameters:
- name: body
in: body
description: Logging information
required: true
schema:
$ref: "#/definitions/LoggingInfo"
responses:
"200":
description: Return new data on success
schema:
$ref: "#/definitions/LoggingInfo"
"400":
description: Invalid data
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/channel/settings:
x-swagger-router-controller: daemon
get:
description: Get channel handling details
operationId: daemonChannelSettingsGet
tags:
- Daemon
responses:
"200":
description: On success return channel settings
schema:
$ref: "#/definitions/ChannelSettings"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Apply channel handling details unconditionally (force)
operationId: daemonChannelSettingsPut
tags:
- Daemon
parameters:
- name: body
in: body
description: Channel handling details to apply
required: true
schema:
$ref: "#/definitions/ChannelSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/ChannelSettings"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
patch:
description: Apply channel handling details differentially (no force)
operationId: daemonChannelSettingsPatch
tags:
- Daemon
parameters:
- name: body
in: body
description: Data handling detail to apply
required: true
schema:
$ref: "#/definitions/ChannelSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/ChannelSettings"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/device/settings:
x-swagger-router-controller: daemon
get:
description: Get device settings
operationId: daemonDeviceSettingsGet
tags:
- Daemon
responses:
"200":
description: On success returns current settings values
schema:
$ref: "#/definitions/DeviceSettings"
"404":
description: Invalid device set index or device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Apply all settings unconditionally (force)
operationId: daemonDeviceSettingsPut
tags:
- Daemon
parameters:
- name: body
in: body
description: Device settings to apply
required: true
schema:
$ref: "#/definitions/DeviceSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/DeviceSettings"
"404":
description: Invalid device set index or device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
patch:
description: Apply settings differentially (no force)
operationId: daemonDeviceSettingsPatch
tags:
- Daemon
parameters:
- name: body
in: body
description: Device settings to apply
required: true
schema:
$ref: "#/definitions/DeviceSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/DeviceSettings"
"404":
description: Invalid device set index or device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/run:
x-swagger-router-controller: daemon
get:
description: get device run status
operationId: daemonRunGet
tags:
- Daemon
responses:
"200":
description: On success return current state
schema:
$ref: "#/definitions/DeviceState"
"400":
description: Invalid device set index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
post:
description: start device
operationId: daemonRunPost
tags:
- Daemon
responses:
"200":
description: On success return state before change
schema:
$ref: "#/definitions/DeviceState"
"400":
description: Invalid device set index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
delete:
description: stop device
operationId: daemonRunDelete
tags:
- Daemon
responses:
"200":
description: On success return state before change
schema:
$ref: "#/definitions/DeviceState"
"400":
description: Invalid device set index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/device/report:
x-swagger-router-controller: daemon
get:
description: get the device report
operationId: daemonDeviceReportGet
tags:
- Daemon
responses:
"200":
description: On success return device report
schema:
$ref: "#/definitions/DeviceReport"
"400":
description: Invalid device set
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/channel/report:
x-swagger-router-controller: daemon
get:
description: get the channel report
operationId: daemonChannelReportGet
tags:
- Daemon
responses:
"200":
description: On success return channel report
schema:
$ref: "#/definitions/ChannelReport"
"400":
description: Invalid device set or channel index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device or channel not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/swagger:
x-swagger-pipe: swagger_raw
# complex objects have schema definitions
definitions:
DaemonSummaryResponse:
description: "Summarized information about this SDRdaemon instance"
required:
- version
- qtVersion
- dspRxBits
- dspTxBits
- pid
- appname
- architecture
- os
properties:
version:
description: "Current software version"
type: string
qtVersion:
description: "Qt version with which the software was compiled"
type: string
dspRxBits:
description: "Number of samples significant bits in software Rx DSP"
type: integer
dspTxBits:
description: "Number of samples significant bits in software Tx DSP"
type: integer
pid:
description: "PID of the SDRangel instance"
type: integer
appname:
description: "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance"
type: string
architecture:
description: "Codename of the CPU architecture on which the instance is running (available with Qt >= 5.4)"
type: string
os:
description: "Descriptive text of the operating system running the instance (available with Qt >= 5.4)"
type: string
logging:
$ref: "#/definitions/LoggingInfo"
samplingDevice:
$ref: "#/definitions/SamplingDevice"
InstanceSummaryResponse:
description: "Summarized information about this SDRangel instance"
required:

View File

@ -1236,366 +1236,12 @@ paths:
"501":
$ref: "#/responses/Response_501"
/sdrdaemon:
x-swagger-router-controller: daemon
get:
description: get SDRdaemon summary information
operationId: daemonInstanceSummary
tags:
- Daemon
responses:
"200":
description: Success
schema:
# a pointer to a definition
$ref: "#/definitions/DaemonSummaryResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/logging:
x-swagger-router-controller: daemon
get:
description: Get logging information for this instance
operationId: daemonInstanceLoggingGet
tags:
- Daemon
responses:
"200":
description: Success
schema:
$ref: "#/definitions/LoggingInfo"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Change logging parmeters for this instance
operationId: daemonInstanceLoggingPut
tags:
- Daemon
consumes:
- application/json
parameters:
- name: body
in: body
description: Logging information
required: true
schema:
$ref: "#/definitions/LoggingInfo"
responses:
"200":
description: Return new data on success
schema:
$ref: "#/definitions/LoggingInfo"
"400":
description: Invalid data
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/channel/settings:
x-swagger-router-controller: daemon
get:
description: Get channel handling details
operationId: daemonChannelSettingsGet
tags:
- Daemon
responses:
"200":
description: On success return channel settings
schema:
$ref: "#/definitions/ChannelSettings"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Apply channel handling details unconditionally (force)
operationId: daemonChannelSettingsPut
tags:
- Daemon
parameters:
- name: body
in: body
description: Channel handling details to apply
required: true
schema:
$ref: "#/definitions/ChannelSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/ChannelSettings"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
patch:
description: Apply channel handling details differentially (no force)
operationId: daemonChannelSettingsPatch
tags:
- Daemon
parameters:
- name: body
in: body
description: Data handling detail to apply
required: true
schema:
$ref: "#/definitions/ChannelSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/ChannelSettings"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/device/settings:
x-swagger-router-controller: daemon
get:
description: Get device settings
operationId: daemonDeviceSettingsGet
tags:
- Daemon
responses:
"200":
description: On success returns current settings values
schema:
$ref: "#/definitions/DeviceSettings"
"404":
description: Invalid device set index or device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Apply all settings unconditionally (force)
operationId: daemonDeviceSettingsPut
tags:
- Daemon
parameters:
- name: body
in: body
description: Device settings to apply
required: true
schema:
$ref: "#/definitions/DeviceSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/DeviceSettings"
"404":
description: Invalid device set index or device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
patch:
description: Apply settings differentially (no force)
operationId: daemonDeviceSettingsPatch
tags:
- Daemon
parameters:
- name: body
in: body
description: Device settings to apply
required: true
schema:
$ref: "#/definitions/DeviceSettings"
responses:
"200":
description: On success returns new settings values
schema:
$ref: "#/definitions/DeviceSettings"
"404":
description: Invalid device set index or device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/run:
x-swagger-router-controller: daemon
get:
description: get device run status
operationId: daemonRunGet
tags:
- Daemon
responses:
"200":
description: On success return current state
schema:
$ref: "#/definitions/DeviceState"
"400":
description: Invalid device set index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
post:
description: start device
operationId: daemonRunPost
tags:
- Daemon
responses:
"200":
description: On success return state before change
schema:
$ref: "#/definitions/DeviceState"
"400":
description: Invalid device set index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
delete:
description: stop device
operationId: daemonRunDelete
tags:
- Daemon
responses:
"200":
description: On success return state before change
schema:
$ref: "#/definitions/DeviceState"
"400":
description: Invalid device set index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/device/report:
x-swagger-router-controller: daemon
get:
description: get the device report
operationId: daemonDeviceReportGet
tags:
- Daemon
responses:
"200":
description: On success return device report
schema:
$ref: "#/definitions/DeviceReport"
"400":
description: Invalid device set
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrdaemon/channel/report:
x-swagger-router-controller: daemon
get:
description: get the channel report
operationId: daemonChannelReportGet
tags:
- Daemon
responses:
"200":
description: On success return channel report
schema:
$ref: "#/definitions/ChannelReport"
"400":
description: Invalid device set or channel index
schema:
$ref: "#/definitions/ErrorResponse"
"404":
description: Device or channel not found
schema:
$ref: "#/definitions/ErrorResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/swagger:
x-swagger-pipe: swagger_raw
# complex objects have schema definitions
definitions:
DaemonSummaryResponse:
description: "Summarized information about this SDRdaemon instance"
required:
- version
- qtVersion
- dspRxBits
- dspTxBits
- pid
- appname
- architecture
- os
properties:
version:
description: "Current software version"
type: string
qtVersion:
description: "Qt version with which the software was compiled"
type: string
dspRxBits:
description: "Number of samples significant bits in software Rx DSP"
type: integer
dspTxBits:
description: "Number of samples significant bits in software Tx DSP"
type: integer
pid:
description: "PID of the SDRangel instance"
type: integer
appname:
description: "Application name: SDRangel for a GUI instance and SDRangelSrv for a server instance"
type: string
architecture:
description: "Codename of the CPU architecture on which the instance is running (available with Qt >= 5.4)"
type: string
os:
description: "Descriptive text of the operating system running the instance (available with Qt >= 5.4)"
type: string
logging:
$ref: "#/definitions/LoggingInfo"
samplingDevice:
$ref: "#/definitions/SamplingDevice"
InstanceSummaryResponse:
description: "Summarized information about this SDRangel instance"
required:

File diff suppressed because it is too large Load Diff

View File

@ -1,775 +0,0 @@
/**
* 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: 4.1.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 "SWGDaemonApi.h"
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include <QJsonArray>
#include <QJsonDocument>
namespace SWGSDRangel {
SWGDaemonApi::SWGDaemonApi() {}
SWGDaemonApi::~SWGDaemonApi() {}
SWGDaemonApi::SWGDaemonApi(QString host, QString basePath) {
this->host = host;
this->basePath = basePath;
}
void
SWGDaemonApi::daemonChannelReportGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/report");
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,
&SWGDaemonApi::daemonChannelReportGetCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonChannelReportGetCallback(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);
SWGChannelReport* output = static_cast<SWGChannelReport*>(create(json, QString("SWGChannelReport")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonChannelReportGetSignal(output);
} else {
emit daemonChannelReportGetSignalE(output, error_type, error_str);
emit daemonChannelReportGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonChannelSettingsGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/settings");
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,
&SWGDaemonApi::daemonChannelSettingsGetCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonChannelSettingsGetCallback(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);
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonChannelSettingsGetSignal(output);
} else {
emit daemonChannelSettingsGetSignalE(output, error_type, error_str);
emit daemonChannelSettingsGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonChannelSettingsPatch(SWGChannelSettings& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/settings");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "PATCH");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDaemonApi::daemonChannelSettingsPatchCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonChannelSettingsPatchCallback(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);
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonChannelSettingsPatchSignal(output);
} else {
emit daemonChannelSettingsPatchSignalE(output, error_type, error_str);
emit daemonChannelSettingsPatchSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonChannelSettingsPut(SWGChannelSettings& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/channel/settings");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDaemonApi::daemonChannelSettingsPutCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonChannelSettingsPutCallback(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);
SWGChannelSettings* output = static_cast<SWGChannelSettings*>(create(json, QString("SWGChannelSettings")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonChannelSettingsPutSignal(output);
} else {
emit daemonChannelSettingsPutSignalE(output, error_type, error_str);
emit daemonChannelSettingsPutSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonDeviceReportGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/device/report");
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,
&SWGDaemonApi::daemonDeviceReportGetCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonDeviceReportGetCallback(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);
SWGDeviceReport* output = static_cast<SWGDeviceReport*>(create(json, QString("SWGDeviceReport")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonDeviceReportGetSignal(output);
} else {
emit daemonDeviceReportGetSignalE(output, error_type, error_str);
emit daemonDeviceReportGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonDeviceSettingsGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/device/settings");
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,
&SWGDaemonApi::daemonDeviceSettingsGetCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonDeviceSettingsGetCallback(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);
SWGDeviceSettings* output = static_cast<SWGDeviceSettings*>(create(json, QString("SWGDeviceSettings")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonDeviceSettingsGetSignal(output);
} else {
emit daemonDeviceSettingsGetSignalE(output, error_type, error_str);
emit daemonDeviceSettingsGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonDeviceSettingsPatch(SWGDeviceSettings& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/device/settings");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "PATCH");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDaemonApi::daemonDeviceSettingsPatchCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonDeviceSettingsPatchCallback(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);
SWGDeviceSettings* output = static_cast<SWGDeviceSettings*>(create(json, QString("SWGDeviceSettings")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonDeviceSettingsPatchSignal(output);
} else {
emit daemonDeviceSettingsPatchSignalE(output, error_type, error_str);
emit daemonDeviceSettingsPatchSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonDeviceSettingsPut(SWGDeviceSettings& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/device/settings");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDaemonApi::daemonDeviceSettingsPutCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonDeviceSettingsPutCallback(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);
SWGDeviceSettings* output = static_cast<SWGDeviceSettings*>(create(json, QString("SWGDeviceSettings")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonDeviceSettingsPutSignal(output);
} else {
emit daemonDeviceSettingsPutSignalE(output, error_type, error_str);
emit daemonDeviceSettingsPutSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonInstanceLoggingGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/logging");
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,
&SWGDaemonApi::daemonInstanceLoggingGetCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonInstanceLoggingGetCallback(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);
SWGLoggingInfo* output = static_cast<SWGLoggingInfo*>(create(json, QString("SWGLoggingInfo")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonInstanceLoggingGetSignal(output);
} else {
emit daemonInstanceLoggingGetSignalE(output, error_type, error_str);
emit daemonInstanceLoggingGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonInstanceLoggingPut(SWGLoggingInfo& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/logging");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDaemonApi::daemonInstanceLoggingPutCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonInstanceLoggingPutCallback(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);
SWGLoggingInfo* output = static_cast<SWGLoggingInfo*>(create(json, QString("SWGLoggingInfo")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonInstanceLoggingPutSignal(output);
} else {
emit daemonInstanceLoggingPutSignalE(output, error_type, error_str);
emit daemonInstanceLoggingPutSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonInstanceSummary() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon");
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,
&SWGDaemonApi::daemonInstanceSummaryCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonInstanceSummaryCallback(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);
SWGDaemonSummaryResponse* output = static_cast<SWGDaemonSummaryResponse*>(create(json, QString("SWGDaemonSummaryResponse")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonInstanceSummarySignal(output);
} else {
emit daemonInstanceSummarySignalE(output, error_type, error_str);
emit daemonInstanceSummarySignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonRunDelete() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/run");
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,
&SWGDaemonApi::daemonRunDeleteCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonRunDeleteCallback(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);
SWGDeviceState* output = static_cast<SWGDeviceState*>(create(json, QString("SWGDeviceState")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonRunDeleteSignal(output);
} else {
emit daemonRunDeleteSignalE(output, error_type, error_str);
emit daemonRunDeleteSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonRunGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/run");
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,
&SWGDaemonApi::daemonRunGetCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonRunGetCallback(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);
SWGDeviceState* output = static_cast<SWGDeviceState*>(create(json, QString("SWGDeviceState")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonRunGetSignal(output);
} else {
emit daemonRunGetSignalE(output, error_type, error_str);
emit daemonRunGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGDaemonApi::daemonRunPost() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrdaemon/run");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "POST");
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGDaemonApi::daemonRunPostCallback);
worker->execute(&input);
}
void
SWGDaemonApi::daemonRunPostCallback(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);
SWGDeviceState* output = static_cast<SWGDeviceState*>(create(json, QString("SWGDeviceState")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit daemonRunPostSignal(output);
} else {
emit daemonRunPostSignalE(output, error_type, error_str);
emit daemonRunPostSignalEFull(worker, error_type, error_str);
}
}
}

View File

@ -1,123 +0,0 @@
/**
* 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: 4.1.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.
*/
#ifndef _SWG_SWGDaemonApi_H_
#define _SWG_SWGDaemonApi_H_
#include "SWGHttpRequest.h"
#include "SWGChannelReport.h"
#include "SWGChannelSettings.h"
#include "SWGDaemonSummaryResponse.h"
#include "SWGDeviceReport.h"
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
#include "SWGErrorResponse.h"
#include "SWGLoggingInfo.h"
#include <QObject>
namespace SWGSDRangel {
class SWGDaemonApi: public QObject {
Q_OBJECT
public:
SWGDaemonApi();
SWGDaemonApi(QString host, QString basePath);
~SWGDaemonApi();
QString host;
QString basePath;
QMap<QString, QString> defaultHeaders;
void daemonChannelReportGet();
void daemonChannelSettingsGet();
void daemonChannelSettingsPatch(SWGChannelSettings& body);
void daemonChannelSettingsPut(SWGChannelSettings& body);
void daemonDeviceReportGet();
void daemonDeviceSettingsGet();
void daemonDeviceSettingsPatch(SWGDeviceSettings& body);
void daemonDeviceSettingsPut(SWGDeviceSettings& body);
void daemonInstanceLoggingGet();
void daemonInstanceLoggingPut(SWGLoggingInfo& body);
void daemonInstanceSummary();
void daemonRunDelete();
void daemonRunGet();
void daemonRunPost();
private:
void daemonChannelReportGetCallback (SWGHttpRequestWorker * worker);
void daemonChannelSettingsGetCallback (SWGHttpRequestWorker * worker);
void daemonChannelSettingsPatchCallback (SWGHttpRequestWorker * worker);
void daemonChannelSettingsPutCallback (SWGHttpRequestWorker * worker);
void daemonDeviceReportGetCallback (SWGHttpRequestWorker * worker);
void daemonDeviceSettingsGetCallback (SWGHttpRequestWorker * worker);
void daemonDeviceSettingsPatchCallback (SWGHttpRequestWorker * worker);
void daemonDeviceSettingsPutCallback (SWGHttpRequestWorker * worker);
void daemonInstanceLoggingGetCallback (SWGHttpRequestWorker * worker);
void daemonInstanceLoggingPutCallback (SWGHttpRequestWorker * worker);
void daemonInstanceSummaryCallback (SWGHttpRequestWorker * worker);
void daemonRunDeleteCallback (SWGHttpRequestWorker * worker);
void daemonRunGetCallback (SWGHttpRequestWorker * worker);
void daemonRunPostCallback (SWGHttpRequestWorker * worker);
signals:
void daemonChannelReportGetSignal(SWGChannelReport* summary);
void daemonChannelSettingsGetSignal(SWGChannelSettings* summary);
void daemonChannelSettingsPatchSignal(SWGChannelSettings* summary);
void daemonChannelSettingsPutSignal(SWGChannelSettings* summary);
void daemonDeviceReportGetSignal(SWGDeviceReport* summary);
void daemonDeviceSettingsGetSignal(SWGDeviceSettings* summary);
void daemonDeviceSettingsPatchSignal(SWGDeviceSettings* summary);
void daemonDeviceSettingsPutSignal(SWGDeviceSettings* summary);
void daemonInstanceLoggingGetSignal(SWGLoggingInfo* summary);
void daemonInstanceLoggingPutSignal(SWGLoggingInfo* summary);
void daemonInstanceSummarySignal(SWGDaemonSummaryResponse* summary);
void daemonRunDeleteSignal(SWGDeviceState* summary);
void daemonRunGetSignal(SWGDeviceState* summary);
void daemonRunPostSignal(SWGDeviceState* summary);
void daemonChannelReportGetSignalE(SWGChannelReport* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsGetSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPatchSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPutSignalE(SWGChannelSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceReportGetSignalE(SWGDeviceReport* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceSettingsGetSignalE(SWGDeviceSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceSettingsPatchSignalE(SWGDeviceSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceSettingsPutSignalE(SWGDeviceSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonInstanceLoggingGetSignalE(SWGLoggingInfo* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonInstanceLoggingPutSignalE(SWGLoggingInfo* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonInstanceSummarySignalE(SWGDaemonSummaryResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonRunDeleteSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonRunGetSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonRunPostSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelReportGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonChannelSettingsPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceReportGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceSettingsGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceSettingsPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonDeviceSettingsPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonInstanceLoggingGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonInstanceLoggingPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonInstanceSummarySignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonRunDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonRunGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void daemonRunPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
};
}
#endif

View File

@ -1,309 +0,0 @@
/**
* 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: 4.1.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 "SWGDaemonSummaryResponse.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGDaemonSummaryResponse::SWGDaemonSummaryResponse(QString* json) {
init();
this->fromJson(*json);
}
SWGDaemonSummaryResponse::SWGDaemonSummaryResponse() {
version = nullptr;
m_version_isSet = false;
qt_version = nullptr;
m_qt_version_isSet = false;
dsp_rx_bits = 0;
m_dsp_rx_bits_isSet = false;
dsp_tx_bits = 0;
m_dsp_tx_bits_isSet = false;
pid = 0;
m_pid_isSet = false;
appname = nullptr;
m_appname_isSet = false;
architecture = nullptr;
m_architecture_isSet = false;
os = nullptr;
m_os_isSet = false;
logging = nullptr;
m_logging_isSet = false;
sampling_device = nullptr;
m_sampling_device_isSet = false;
}
SWGDaemonSummaryResponse::~SWGDaemonSummaryResponse() {
this->cleanup();
}
void
SWGDaemonSummaryResponse::init() {
version = new QString("");
m_version_isSet = false;
qt_version = new QString("");
m_qt_version_isSet = false;
dsp_rx_bits = 0;
m_dsp_rx_bits_isSet = false;
dsp_tx_bits = 0;
m_dsp_tx_bits_isSet = false;
pid = 0;
m_pid_isSet = false;
appname = new QString("");
m_appname_isSet = false;
architecture = new QString("");
m_architecture_isSet = false;
os = new QString("");
m_os_isSet = false;
logging = new SWGLoggingInfo();
m_logging_isSet = false;
sampling_device = new SWGSamplingDevice();
m_sampling_device_isSet = false;
}
void
SWGDaemonSummaryResponse::cleanup() {
if(version != nullptr) {
delete version;
}
if(qt_version != nullptr) {
delete qt_version;
}
if(appname != nullptr) {
delete appname;
}
if(architecture != nullptr) {
delete architecture;
}
if(os != nullptr) {
delete os;
}
if(logging != nullptr) {
delete logging;
}
if(sampling_device != nullptr) {
delete sampling_device;
}
}
SWGDaemonSummaryResponse*
SWGDaemonSummaryResponse::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDaemonSummaryResponse::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
::SWGSDRangel::setValue(&qt_version, pJson["qtVersion"], "QString", "QString");
::SWGSDRangel::setValue(&dsp_rx_bits, pJson["dspRxBits"], "qint32", "");
::SWGSDRangel::setValue(&dsp_tx_bits, pJson["dspTxBits"], "qint32", "");
::SWGSDRangel::setValue(&pid, pJson["pid"], "qint32", "");
::SWGSDRangel::setValue(&appname, pJson["appname"], "QString", "QString");
::SWGSDRangel::setValue(&architecture, pJson["architecture"], "QString", "QString");
::SWGSDRangel::setValue(&os, pJson["os"], "QString", "QString");
::SWGSDRangel::setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo");
::SWGSDRangel::setValue(&sampling_device, pJson["samplingDevice"], "SWGSamplingDevice", "SWGSamplingDevice");
}
QString
SWGDaemonSummaryResponse::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGDaemonSummaryResponse::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(version != nullptr && *version != QString("")){
toJsonValue(QString("version"), version, obj, QString("QString"));
}
if(qt_version != nullptr && *qt_version != QString("")){
toJsonValue(QString("qtVersion"), qt_version, obj, QString("QString"));
}
if(m_dsp_rx_bits_isSet){
obj->insert("dspRxBits", QJsonValue(dsp_rx_bits));
}
if(m_dsp_tx_bits_isSet){
obj->insert("dspTxBits", QJsonValue(dsp_tx_bits));
}
if(m_pid_isSet){
obj->insert("pid", QJsonValue(pid));
}
if(appname != nullptr && *appname != QString("")){
toJsonValue(QString("appname"), appname, obj, QString("QString"));
}
if(architecture != nullptr && *architecture != QString("")){
toJsonValue(QString("architecture"), architecture, obj, QString("QString"));
}
if(os != nullptr && *os != QString("")){
toJsonValue(QString("os"), os, obj, QString("QString"));
}
if((logging != nullptr) && (logging->isSet())){
toJsonValue(QString("logging"), logging, obj, QString("SWGLoggingInfo"));
}
if((sampling_device != nullptr) && (sampling_device->isSet())){
toJsonValue(QString("samplingDevice"), sampling_device, obj, QString("SWGSamplingDevice"));
}
return obj;
}
QString*
SWGDaemonSummaryResponse::getVersion() {
return version;
}
void
SWGDaemonSummaryResponse::setVersion(QString* version) {
this->version = version;
this->m_version_isSet = true;
}
QString*
SWGDaemonSummaryResponse::getQtVersion() {
return qt_version;
}
void
SWGDaemonSummaryResponse::setQtVersion(QString* qt_version) {
this->qt_version = qt_version;
this->m_qt_version_isSet = true;
}
qint32
SWGDaemonSummaryResponse::getDspRxBits() {
return dsp_rx_bits;
}
void
SWGDaemonSummaryResponse::setDspRxBits(qint32 dsp_rx_bits) {
this->dsp_rx_bits = dsp_rx_bits;
this->m_dsp_rx_bits_isSet = true;
}
qint32
SWGDaemonSummaryResponse::getDspTxBits() {
return dsp_tx_bits;
}
void
SWGDaemonSummaryResponse::setDspTxBits(qint32 dsp_tx_bits) {
this->dsp_tx_bits = dsp_tx_bits;
this->m_dsp_tx_bits_isSet = true;
}
qint32
SWGDaemonSummaryResponse::getPid() {
return pid;
}
void
SWGDaemonSummaryResponse::setPid(qint32 pid) {
this->pid = pid;
this->m_pid_isSet = true;
}
QString*
SWGDaemonSummaryResponse::getAppname() {
return appname;
}
void
SWGDaemonSummaryResponse::setAppname(QString* appname) {
this->appname = appname;
this->m_appname_isSet = true;
}
QString*
SWGDaemonSummaryResponse::getArchitecture() {
return architecture;
}
void
SWGDaemonSummaryResponse::setArchitecture(QString* architecture) {
this->architecture = architecture;
this->m_architecture_isSet = true;
}
QString*
SWGDaemonSummaryResponse::getOs() {
return os;
}
void
SWGDaemonSummaryResponse::setOs(QString* os) {
this->os = os;
this->m_os_isSet = true;
}
SWGLoggingInfo*
SWGDaemonSummaryResponse::getLogging() {
return logging;
}
void
SWGDaemonSummaryResponse::setLogging(SWGLoggingInfo* logging) {
this->logging = logging;
this->m_logging_isSet = true;
}
SWGSamplingDevice*
SWGDaemonSummaryResponse::getSamplingDevice() {
return sampling_device;
}
void
SWGDaemonSummaryResponse::setSamplingDevice(SWGSamplingDevice* sampling_device) {
this->sampling_device = sampling_device;
this->m_sampling_device_isSet = true;
}
bool
SWGDaemonSummaryResponse::isSet(){
bool isObjectUpdated = false;
do{
if(version != nullptr && *version != QString("")){ isObjectUpdated = true; break;}
if(qt_version != nullptr && *qt_version != QString("")){ isObjectUpdated = true; break;}
if(m_dsp_rx_bits_isSet){ isObjectUpdated = true; break;}
if(m_dsp_tx_bits_isSet){ isObjectUpdated = true; break;}
if(m_pid_isSet){ isObjectUpdated = true; break;}
if(appname != nullptr && *appname != QString("")){ isObjectUpdated = true; break;}
if(architecture != nullptr && *architecture != QString("")){ isObjectUpdated = true; break;}
if(os != nullptr && *os != QString("")){ isObjectUpdated = true; break;}
if(logging != nullptr && logging->isSet()){ isObjectUpdated = true; break;}
if(sampling_device != nullptr && sampling_device->isSet()){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -1,115 +0,0 @@
/**
* 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: 4.1.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.
*/
/*
* SWGDaemonSummaryResponse.h
*
* Summarized information about this SDRdaemon instance
*/
#ifndef SWGDaemonSummaryResponse_H_
#define SWGDaemonSummaryResponse_H_
#include <QJsonObject>
#include "SWGLoggingInfo.h"
#include "SWGSamplingDevice.h"
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGDaemonSummaryResponse: public SWGObject {
public:
SWGDaemonSummaryResponse();
SWGDaemonSummaryResponse(QString* json);
virtual ~SWGDaemonSummaryResponse();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGDaemonSummaryResponse* fromJson(QString &jsonString) override;
QString* getVersion();
void setVersion(QString* version);
QString* getQtVersion();
void setQtVersion(QString* qt_version);
qint32 getDspRxBits();
void setDspRxBits(qint32 dsp_rx_bits);
qint32 getDspTxBits();
void setDspTxBits(qint32 dsp_tx_bits);
qint32 getPid();
void setPid(qint32 pid);
QString* getAppname();
void setAppname(QString* appname);
QString* getArchitecture();
void setArchitecture(QString* architecture);
QString* getOs();
void setOs(QString* os);
SWGLoggingInfo* getLogging();
void setLogging(SWGLoggingInfo* logging);
SWGSamplingDevice* getSamplingDevice();
void setSamplingDevice(SWGSamplingDevice* sampling_device);
virtual bool isSet() override;
private:
QString* version;
bool m_version_isSet;
QString* qt_version;
bool m_qt_version_isSet;
qint32 dsp_rx_bits;
bool m_dsp_rx_bits_isSet;
qint32 dsp_tx_bits;
bool m_dsp_tx_bits_isSet;
qint32 pid;
bool m_pid_isSet;
QString* appname;
bool m_appname_isSet;
QString* architecture;
bool m_architecture_isSet;
QString* os;
bool m_os_isSet;
SWGLoggingInfo* logging;
bool m_logging_isSet;
SWGSamplingDevice* sampling_device;
bool m_sampling_device_isSet;
};
}
#endif /* SWGDaemonSummaryResponse_H_ */

View File

@ -45,7 +45,6 @@
#include "SWGDaemonSinkSettings.h"
#include "SWGDaemonSourceReport.h"
#include "SWGDaemonSourceSettings.h"
#include "SWGDaemonSummaryResponse.h"
#include "SWGDeviceListItem.h"
#include "SWGDeviceReport.h"
#include "SWGDeviceSet.h"
@ -211,9 +210,6 @@ namespace SWGSDRangel {
if(QString("SWGDaemonSourceSettings").compare(type) == 0) {
return new SWGDaemonSourceSettings();
}
if(QString("SWGDaemonSummaryResponse").compare(type) == 0) {
return new SWGDaemonSummaryResponse();
}
if(QString("SWGDeviceListItem").compare(type) == 0) {
return new SWGDeviceListItem();
}