1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-01 16:38:06 -04:00

REST API device and channel actions: generated code

This commit is contained in:
f4exb
2020-03-09 04:00:39 +01:00
parent 4b5178cf2b
commit 29d86ac947
18 changed files with 3513 additions and 4 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
ChannelActions:
description: Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present.
discriminator: channelType
required:
- channelType
- direction
properties:
channelType:
description: Channel type code
type: string
direction:
description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)
type: integer
originatorDeviceSetIndex:
description: Optional for reverse API. This is the device set index from where the message comes from.
type: integer
originatorChannelIndex:
description: Optional for reverse API. This is the channel index from where the message comes from.
type: integer
FileSourceActions:
$ref: "/doc/swagger/include/FileSource.yaml#/FileSourceActions"
@@ -0,0 +1,18 @@
DeviceActions:
description: Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present.
discriminator: deviceHwType
required:
- deviceHwType
- direction
properties:
deviceHwType:
description: Device hardware type code
type: string
direction:
description: 0 for Rx only, 1 for Tx only or 2 for any number and direction (default 0)
type: integer
originatorIndex:
description: Optional for reverse API. This is the device set index from where the message comes from.
type: integer
rtlSdrActions:
$ref: "/doc/swagger/include/RtlSdr.yaml#/RtlSdrActions"
@@ -59,3 +59,13 @@ FileSourceReport:
description: power transmitted in channel (dB)
type: number
format: float
FileSourceActions:
description: FileSource
properties:
play:
type: integer
description: >
Play or Pause stream
* 0 - Pause
* 1 - Play
@@ -43,7 +43,7 @@ RtlSdrSettings:
reverseAPIPort:
type: integer
reverseAPIDeviceIndex:
type: integer
type: integer
RtlSdrReport:
description: RTLSDR
@@ -51,4 +51,14 @@ RtlSdrReport:
gains:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/Gain"
$ref: "/doc/swagger/include/Structs.yaml#/Gain"
RtlSdrActions:
description: RTLSDR
properties:
record:
type: integer
description: >
Record IQ stream action
* 0 - stop recording
* 1 - start recording
@@ -1382,6 +1382,42 @@ paths:
"501":
$ref: "#/responses/Response_501"
/sdrangel/deviceset/{deviceSetIndex}/device/actions:
x-swagger-router-controller: deviceset
post:
description: post an action on a device
operationId: devicesetDeviceActionsPost
tags:
- Deviceset
parameters:
- in: path
name: deviceSetIndex
type: integer
required: true
description: Index of device set in the device set list
- name: body
in: body
description: Action(s) to apply to the device
required: true
schema:
$ref: "/doc/swagger/include/DeviceActions.yaml#/DeviceActions"
responses:
"202":
description: Message to perform action was sent successfully
schema:
$ref: "#/definitions/SuccessResponse"
"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"
/sdrangel/deviceset/{deviceSetIndex}/channel:
x-swagger-router-controller: deviceset
@@ -1605,6 +1641,48 @@ paths:
"501":
$ref: "#/responses/Response_501"
/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions:
x-swagger-router-controller: deviceset
post:
description: post an action or actions on a channel
operationId: devicesetChannelActionsPost
tags:
- Deviceset
parameters:
- in: path
name: deviceSetIndex
type: integer
required: true
description: Index of device set in the device set list
- in: path
name: channelIndex
type: integer
required: true
description: Index of the channel in the channels list for this device set
- name: body
in: body
description: Action(s) to apply to the channel
required: true
schema:
$ref: "/doc/swagger/include/ChannelActions.yaml#/ChannelActions"
responses:
"202":
description: Message to perform action was sent successfully
schema:
$ref: "#/definitions/SuccessResponse"
"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
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,204 @@
/**
* 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: 5.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 "SWGChannelActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGChannelActions::SWGChannelActions(QString* json) {
init();
this->fromJson(*json);
}
SWGChannelActions::SWGChannelActions() {
channel_type = nullptr;
m_channel_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_device_set_index = 0;
m_originator_device_set_index_isSet = false;
originator_channel_index = 0;
m_originator_channel_index_isSet = false;
file_source_actions = nullptr;
m_file_source_actions_isSet = false;
}
SWGChannelActions::~SWGChannelActions() {
this->cleanup();
}
void
SWGChannelActions::init() {
channel_type = new QString("");
m_channel_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_device_set_index = 0;
m_originator_device_set_index_isSet = false;
originator_channel_index = 0;
m_originator_channel_index_isSet = false;
file_source_actions = new SWGFileSourceActions();
m_file_source_actions_isSet = false;
}
void
SWGChannelActions::cleanup() {
if(channel_type != nullptr) {
delete channel_type;
}
if(file_source_actions != nullptr) {
delete file_source_actions;
}
}
SWGChannelActions*
SWGChannelActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGChannelActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_type, pJson["channelType"], "QString", "QString");
::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
::SWGSDRangel::setValue(&originator_device_set_index, pJson["originatorDeviceSetIndex"], "qint32", "");
::SWGSDRangel::setValue(&originator_channel_index, pJson["originatorChannelIndex"], "qint32", "");
::SWGSDRangel::setValue(&file_source_actions, pJson["FileSourceActions"], "SWGFileSourceActions", "SWGFileSourceActions");
}
QString
SWGChannelActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGChannelActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(channel_type != nullptr && *channel_type != QString("")){
toJsonValue(QString("channelType"), channel_type, obj, QString("QString"));
}
if(m_direction_isSet){
obj->insert("direction", QJsonValue(direction));
}
if(m_originator_device_set_index_isSet){
obj->insert("originatorDeviceSetIndex", QJsonValue(originator_device_set_index));
}
if(m_originator_channel_index_isSet){
obj->insert("originatorChannelIndex", QJsonValue(originator_channel_index));
}
if((file_source_actions != nullptr) && (file_source_actions->isSet())){
toJsonValue(QString("FileSourceActions"), file_source_actions, obj, QString("SWGFileSourceActions"));
}
return obj;
}
QString*
SWGChannelActions::getChannelType() {
return channel_type;
}
void
SWGChannelActions::setChannelType(QString* channel_type) {
this->channel_type = channel_type;
this->m_channel_type_isSet = true;
}
qint32
SWGChannelActions::getDirection() {
return direction;
}
void
SWGChannelActions::setDirection(qint32 direction) {
this->direction = direction;
this->m_direction_isSet = true;
}
qint32
SWGChannelActions::getOriginatorDeviceSetIndex() {
return originator_device_set_index;
}
void
SWGChannelActions::setOriginatorDeviceSetIndex(qint32 originator_device_set_index) {
this->originator_device_set_index = originator_device_set_index;
this->m_originator_device_set_index_isSet = true;
}
qint32
SWGChannelActions::getOriginatorChannelIndex() {
return originator_channel_index;
}
void
SWGChannelActions::setOriginatorChannelIndex(qint32 originator_channel_index) {
this->originator_channel_index = originator_channel_index;
this->m_originator_channel_index_isSet = true;
}
SWGFileSourceActions*
SWGChannelActions::getFileSourceActions() {
return file_source_actions;
}
void
SWGChannelActions::setFileSourceActions(SWGFileSourceActions* file_source_actions) {
this->file_source_actions = file_source_actions;
this->m_file_source_actions_isSet = true;
}
bool
SWGChannelActions::isSet(){
bool isObjectUpdated = false;
do{
if(channel_type && *channel_type != QString("")){
isObjectUpdated = true; break;
}
if(m_direction_isSet){
isObjectUpdated = true; break;
}
if(m_originator_device_set_index_isSet){
isObjectUpdated = true; break;
}
if(m_originator_channel_index_isSet){
isObjectUpdated = true; break;
}
if(file_source_actions && file_source_actions->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}
@@ -0,0 +1,84 @@
/**
* 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: 5.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.
*/
/*
* SWGChannelActions.h
*
* Base channel actions. Only the channel actions corresponding to the channel specified in the channelType field is or should be present.
*/
#ifndef SWGChannelActions_H_
#define SWGChannelActions_H_
#include <QJsonObject>
#include "SWGFileSourceActions.h"
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGChannelActions: public SWGObject {
public:
SWGChannelActions();
SWGChannelActions(QString* json);
virtual ~SWGChannelActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGChannelActions* fromJson(QString &jsonString) override;
QString* getChannelType();
void setChannelType(QString* channel_type);
qint32 getDirection();
void setDirection(qint32 direction);
qint32 getOriginatorDeviceSetIndex();
void setOriginatorDeviceSetIndex(qint32 originator_device_set_index);
qint32 getOriginatorChannelIndex();
void setOriginatorChannelIndex(qint32 originator_channel_index);
SWGFileSourceActions* getFileSourceActions();
void setFileSourceActions(SWGFileSourceActions* file_source_actions);
virtual bool isSet() override;
private:
QString* channel_type;
bool m_channel_type_isSet;
qint32 direction;
bool m_direction_isSet;
qint32 originator_device_set_index;
bool m_originator_device_set_index_isSet;
qint32 originator_channel_index;
bool m_originator_channel_index_isSet;
SWGFileSourceActions* file_source_actions;
bool m_file_source_actions_isSet;
};
}
#endif /* SWGChannelActions_H_ */
@@ -0,0 +1,181 @@
/**
* 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: 5.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 "SWGDeviceActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGDeviceActions::SWGDeviceActions(QString* json) {
init();
this->fromJson(*json);
}
SWGDeviceActions::SWGDeviceActions() {
device_hw_type = nullptr;
m_device_hw_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_index = 0;
m_originator_index_isSet = false;
rtl_sdr_actions = nullptr;
m_rtl_sdr_actions_isSet = false;
}
SWGDeviceActions::~SWGDeviceActions() {
this->cleanup();
}
void
SWGDeviceActions::init() {
device_hw_type = new QString("");
m_device_hw_type_isSet = false;
direction = 0;
m_direction_isSet = false;
originator_index = 0;
m_originator_index_isSet = false;
rtl_sdr_actions = new SWGRtlSdrActions();
m_rtl_sdr_actions_isSet = false;
}
void
SWGDeviceActions::cleanup() {
if(device_hw_type != nullptr) {
delete device_hw_type;
}
if(rtl_sdr_actions != nullptr) {
delete rtl_sdr_actions;
}
}
SWGDeviceActions*
SWGDeviceActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGDeviceActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&device_hw_type, pJson["deviceHwType"], "QString", "QString");
::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
::SWGSDRangel::setValue(&originator_index, pJson["originatorIndex"], "qint32", "");
::SWGSDRangel::setValue(&rtl_sdr_actions, pJson["rtlSdrActions"], "SWGRtlSdrActions", "SWGRtlSdrActions");
}
QString
SWGDeviceActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGDeviceActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(device_hw_type != nullptr && *device_hw_type != QString("")){
toJsonValue(QString("deviceHwType"), device_hw_type, obj, QString("QString"));
}
if(m_direction_isSet){
obj->insert("direction", QJsonValue(direction));
}
if(m_originator_index_isSet){
obj->insert("originatorIndex", QJsonValue(originator_index));
}
if((rtl_sdr_actions != nullptr) && (rtl_sdr_actions->isSet())){
toJsonValue(QString("rtlSdrActions"), rtl_sdr_actions, obj, QString("SWGRtlSdrActions"));
}
return obj;
}
QString*
SWGDeviceActions::getDeviceHwType() {
return device_hw_type;
}
void
SWGDeviceActions::setDeviceHwType(QString* device_hw_type) {
this->device_hw_type = device_hw_type;
this->m_device_hw_type_isSet = true;
}
qint32
SWGDeviceActions::getDirection() {
return direction;
}
void
SWGDeviceActions::setDirection(qint32 direction) {
this->direction = direction;
this->m_direction_isSet = true;
}
qint32
SWGDeviceActions::getOriginatorIndex() {
return originator_index;
}
void
SWGDeviceActions::setOriginatorIndex(qint32 originator_index) {
this->originator_index = originator_index;
this->m_originator_index_isSet = true;
}
SWGRtlSdrActions*
SWGDeviceActions::getRtlSdrActions() {
return rtl_sdr_actions;
}
void
SWGDeviceActions::setRtlSdrActions(SWGRtlSdrActions* rtl_sdr_actions) {
this->rtl_sdr_actions = rtl_sdr_actions;
this->m_rtl_sdr_actions_isSet = true;
}
bool
SWGDeviceActions::isSet(){
bool isObjectUpdated = false;
do{
if(device_hw_type && *device_hw_type != QString("")){
isObjectUpdated = true; break;
}
if(m_direction_isSet){
isObjectUpdated = true; break;
}
if(m_originator_index_isSet){
isObjectUpdated = true; break;
}
if(rtl_sdr_actions && rtl_sdr_actions->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}
@@ -0,0 +1,78 @@
/**
* 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: 5.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.
*/
/*
* SWGDeviceActions.h
*
* Base device actions. Only the device actions corresponding to the device specified in the deviceHwType field is or should be present.
*/
#ifndef SWGDeviceActions_H_
#define SWGDeviceActions_H_
#include <QJsonObject>
#include "SWGRtlSdrActions.h"
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGDeviceActions: public SWGObject {
public:
SWGDeviceActions();
SWGDeviceActions(QString* json);
virtual ~SWGDeviceActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGDeviceActions* fromJson(QString &jsonString) override;
QString* getDeviceHwType();
void setDeviceHwType(QString* device_hw_type);
qint32 getDirection();
void setDirection(qint32 direction);
qint32 getOriginatorIndex();
void setOriginatorIndex(qint32 originator_index);
SWGRtlSdrActions* getRtlSdrActions();
void setRtlSdrActions(SWGRtlSdrActions* rtl_sdr_actions);
virtual bool isSet() override;
private:
QString* device_hw_type;
bool m_device_hw_type_isSet;
qint32 direction;
bool m_direction_isSet;
qint32 originator_index;
bool m_originator_index_isSet;
SWGRtlSdrActions* rtl_sdr_actions;
bool m_rtl_sdr_actions_isSet;
};
}
#endif /* SWGDeviceActions_H_ */
@@ -0,0 +1,148 @@
/**
* 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: 5.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 "SWGDevicesetApi.h"
#include "SWGHelpers.h"
#include "SWGModelFactory.h"
#include <QJsonArray>
#include <QJsonDocument>
namespace SWGSDRangel {
SWGDevicesetApi::SWGDevicesetApi() {}
SWGDevicesetApi::~SWGDevicesetApi() {}
SWGDevicesetApi::SWGDevicesetApi(QString host, QString basePath) {
this->host = host;
this->basePath = basePath;
}
void
SWGDevicesetApi::devicesetChannelActionsPost(qint32 device_set_index, qint32 channel_index, SWGChannelActions& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/channel/{channelIndex}/actions");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
QString channel_indexPathParam("{"); channel_indexPathParam.append("channelIndex").append("}");
fullPath.replace(channel_indexPathParam, stringValue(channel_index));
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "POST");
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,
&SWGDevicesetApi::devicesetChannelActionsPostCallback);
worker->execute(&input);
}
void
SWGDevicesetApi::devicesetChannelActionsPostCallback(SWGHttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit devicesetChannelActionsPostSignal(output);
} else {
emit devicesetChannelActionsPostSignalE(output, error_type, error_str);
emit devicesetChannelActionsPostSignalEFull(worker, error_type, error_str);
}
}
void
SWGDevicesetApi::devicesetDeviceActionsPost(qint32 device_set_index, SWGDeviceActions& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/actions");
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "POST");
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,
&SWGDevicesetApi::devicesetDeviceActionsPostCallback);
worker->execute(&input);
}
void
SWGDevicesetApi::devicesetDeviceActionsPostCallback(SWGHttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit devicesetDeviceActionsPostSignal(output);
} else {
emit devicesetDeviceActionsPostSignalE(output, error_type, error_str);
emit devicesetDeviceActionsPostSignalEFull(worker, error_type, error_str);
}
}
}
@@ -0,0 +1,59 @@
/**
* 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: 5.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_SWGDevicesetApi_H_
#define _SWG_SWGDevicesetApi_H_
#include "SWGHttpRequest.h"
#include "SWGChannelActions.h"
#include "SWGDeviceActions.h"
#include "SWGErrorResponse.h"
#include "SWGSuccessResponse.h"
#include <QObject>
namespace SWGSDRangel {
class SWGDevicesetApi: public QObject {
Q_OBJECT
public:
SWGDevicesetApi();
SWGDevicesetApi(QString host, QString basePath);
~SWGDevicesetApi();
QString host;
QString basePath;
QMap<QString, QString> defaultHeaders;
void devicesetChannelActionsPost(qint32 device_set_index, qint32 channel_index, SWGChannelActions& body);
void devicesetDeviceActionsPost(qint32 device_set_index, SWGDeviceActions& body);
private:
void devicesetChannelActionsPostCallback (SWGHttpRequestWorker * worker);
void devicesetDeviceActionsPostCallback (SWGHttpRequestWorker * worker);
signals:
void devicesetChannelActionsPostSignal(SWGSuccessResponse* summary);
void devicesetDeviceActionsPostSignal(SWGSuccessResponse* summary);
void devicesetChannelActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetDeviceActionsPostSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetChannelActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void devicesetDeviceActionsPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
};
}
#endif
@@ -0,0 +1,108 @@
/**
* 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: 5.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 "SWGFileSourceActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGFileSourceActions::SWGFileSourceActions(QString* json) {
init();
this->fromJson(*json);
}
SWGFileSourceActions::SWGFileSourceActions() {
play = 0;
m_play_isSet = false;
}
SWGFileSourceActions::~SWGFileSourceActions() {
this->cleanup();
}
void
SWGFileSourceActions::init() {
play = 0;
m_play_isSet = false;
}
void
SWGFileSourceActions::cleanup() {
}
SWGFileSourceActions*
SWGFileSourceActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGFileSourceActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&play, pJson["play"], "qint32", "");
}
QString
SWGFileSourceActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGFileSourceActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_play_isSet){
obj->insert("play", QJsonValue(play));
}
return obj;
}
qint32
SWGFileSourceActions::getPlay() {
return play;
}
void
SWGFileSourceActions::setPlay(qint32 play) {
this->play = play;
this->m_play_isSet = true;
}
bool
SWGFileSourceActions::isSet(){
bool isObjectUpdated = false;
do{
if(m_play_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}
@@ -0,0 +1,58 @@
/**
* 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: 5.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.
*/
/*
* SWGFileSourceActions.h
*
* FileSource
*/
#ifndef SWGFileSourceActions_H_
#define SWGFileSourceActions_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGFileSourceActions: public SWGObject {
public:
SWGFileSourceActions();
SWGFileSourceActions(QString* json);
virtual ~SWGFileSourceActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGFileSourceActions* fromJson(QString &jsonString) override;
qint32 getPlay();
void setPlay(qint32 play);
virtual bool isSet() override;
private:
qint32 play;
bool m_play_isSet;
};
}
#endif /* SWGFileSourceActions_H_ */
@@ -45,6 +45,7 @@
#include "SWGBladeRF2OutputSettings.h"
#include "SWGCWKeyerSettings.h"
#include "SWGChannel.h"
#include "SWGChannelActions.h"
#include "SWGChannelAnalyzerSettings.h"
#include "SWGChannelConfig.h"
#include "SWGChannelListItem.h"
@@ -62,6 +63,7 @@
#include "SWGDSDDemodSettings.h"
#include "SWGDVSerialDevice.h"
#include "SWGDVSerialDevices.h"
#include "SWGDeviceActions.h"
#include "SWGDeviceConfig.h"
#include "SWGDeviceListItem.h"
#include "SWGDeviceReport.h"
@@ -74,6 +76,7 @@
#include "SWGFCDProSettings.h"
#include "SWGFileInputReport.h"
#include "SWGFileInputSettings.h"
#include "SWGFileSourceActions.h"
#include "SWGFileSourceReport.h"
#include "SWGFileSourceSettings.h"
#include "SWGFreeDVDemodReport.h"
@@ -144,6 +147,7 @@
#include "SWGRemoteSinkSettings.h"
#include "SWGRemoteSourceReport.h"
#include "SWGRemoteSourceSettings.h"
#include "SWGRtlSdrActions.h"
#include "SWGRtlSdrReport.h"
#include "SWGRtlSdrSettings.h"
#include "SWGSDRPlayReport.h"
@@ -275,6 +279,9 @@ namespace SWGSDRangel {
if(QString("SWGChannel").compare(type) == 0) {
return new SWGChannel();
}
if(QString("SWGChannelActions").compare(type) == 0) {
return new SWGChannelActions();
}
if(QString("SWGChannelAnalyzerSettings").compare(type) == 0) {
return new SWGChannelAnalyzerSettings();
}
@@ -326,6 +333,9 @@ namespace SWGSDRangel {
if(QString("SWGDVSerialDevices").compare(type) == 0) {
return new SWGDVSerialDevices();
}
if(QString("SWGDeviceActions").compare(type) == 0) {
return new SWGDeviceActions();
}
if(QString("SWGDeviceConfig").compare(type) == 0) {
return new SWGDeviceConfig();
}
@@ -362,6 +372,9 @@ namespace SWGSDRangel {
if(QString("SWGFileInputSettings").compare(type) == 0) {
return new SWGFileInputSettings();
}
if(QString("SWGFileSourceActions").compare(type) == 0) {
return new SWGFileSourceActions();
}
if(QString("SWGFileSourceReport").compare(type) == 0) {
return new SWGFileSourceReport();
}
@@ -572,6 +585,9 @@ namespace SWGSDRangel {
if(QString("SWGRemoteSourceSettings").compare(type) == 0) {
return new SWGRemoteSourceSettings();
}
if(QString("SWGRtlSdrActions").compare(type) == 0) {
return new SWGRtlSdrActions();
}
if(QString("SWGRtlSdrReport").compare(type) == 0) {
return new SWGRtlSdrReport();
}
@@ -0,0 +1,108 @@
/**
* 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: 5.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 "SWGRtlSdrActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGRtlSdrActions::SWGRtlSdrActions(QString* json) {
init();
this->fromJson(*json);
}
SWGRtlSdrActions::SWGRtlSdrActions() {
record = 0;
m_record_isSet = false;
}
SWGRtlSdrActions::~SWGRtlSdrActions() {
this->cleanup();
}
void
SWGRtlSdrActions::init() {
record = 0;
m_record_isSet = false;
}
void
SWGRtlSdrActions::cleanup() {
}
SWGRtlSdrActions*
SWGRtlSdrActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGRtlSdrActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&record, pJson["record"], "qint32", "");
}
QString
SWGRtlSdrActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGRtlSdrActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_record_isSet){
obj->insert("record", QJsonValue(record));
}
return obj;
}
qint32
SWGRtlSdrActions::getRecord() {
return record;
}
void
SWGRtlSdrActions::setRecord(qint32 record) {
this->record = record;
this->m_record_isSet = true;
}
bool
SWGRtlSdrActions::isSet(){
bool isObjectUpdated = false;
do{
if(m_record_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}
@@ -0,0 +1,58 @@
/**
* 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: 5.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.
*/
/*
* SWGRtlSdrActions.h
*
* RTLSDR
*/
#ifndef SWGRtlSdrActions_H_
#define SWGRtlSdrActions_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGRtlSdrActions: public SWGObject {
public:
SWGRtlSdrActions();
SWGRtlSdrActions(QString* json);
virtual ~SWGRtlSdrActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGRtlSdrActions* fromJson(QString &jsonString) override;
qint32 getRecord();
void setRecord(qint32 record);
virtual bool isSet() override;
private:
qint32 record;
bool m_record_isSet;
};
}
#endif /* SWGRtlSdrActions_H_ */