1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

REST API device and channel actions: generated code

This commit is contained in:
f4exb 2020-03-10 08:32:54 +01:00
parent 6d47e65aa6
commit 5e0d373d2a
6 changed files with 2388 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@ -59,3 +59,13 @@ FileSourceReport:
description: power transmitted in channel (dB) description: power transmitted in channel (dB)
type: number type: number
format: float format: float
FileSourceActions:
description: FileSource
properties:
play:
type: integer
description: >
Play or Pause stream
* 0 - Pause
* 1 - Play

View File

@ -43,7 +43,7 @@ RtlSdrSettings:
reverseAPIPort: reverseAPIPort:
type: integer type: integer
reverseAPIDeviceIndex: reverseAPIDeviceIndex:
type: integer type: integer
RtlSdrReport: RtlSdrReport:
description: RTLSDR description: RTLSDR
@ -51,4 +51,14 @@ RtlSdrReport:
gains: gains:
type: array type: array
items: 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

View File

@ -1382,6 +1382,42 @@ paths:
"501": "501":
$ref: "#/responses/Response_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: /sdrangel/deviceset/{deviceSetIndex}/channel:
x-swagger-router-controller: deviceset x-swagger-router-controller: deviceset
@ -1605,6 +1641,48 @@ paths:
"501": "501":
$ref: "#/responses/Response_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: /swagger:
x-swagger-pipe: swagger_raw x-swagger-pipe: swagger_raw

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,7 @@
#include "SWGBladeRF2OutputSettings.h" #include "SWGBladeRF2OutputSettings.h"
#include "SWGCWKeyerSettings.h" #include "SWGCWKeyerSettings.h"
#include "SWGChannel.h" #include "SWGChannel.h"
#include "SWGChannelActions.h"
#include "SWGChannelAnalyzerSettings.h" #include "SWGChannelAnalyzerSettings.h"
#include "SWGChannelConfig.h" #include "SWGChannelConfig.h"
#include "SWGChannelListItem.h" #include "SWGChannelListItem.h"
@ -57,6 +58,7 @@
#include "SWGDSDDemodSettings.h" #include "SWGDSDDemodSettings.h"
#include "SWGDVSerialDevice.h" #include "SWGDVSerialDevice.h"
#include "SWGDVSerialDevices.h" #include "SWGDVSerialDevices.h"
#include "SWGDeviceActions.h"
#include "SWGDeviceConfig.h" #include "SWGDeviceConfig.h"
#include "SWGDeviceListItem.h" #include "SWGDeviceListItem.h"
#include "SWGDeviceReport.h" #include "SWGDeviceReport.h"
@ -69,6 +71,7 @@
#include "SWGFCDProSettings.h" #include "SWGFCDProSettings.h"
#include "SWGFileInputReport.h" #include "SWGFileInputReport.h"
#include "SWGFileInputSettings.h" #include "SWGFileInputSettings.h"
#include "SWGFileSourceActions.h"
#include "SWGFileSourceReport.h" #include "SWGFileSourceReport.h"
#include "SWGFileSourceSettings.h" #include "SWGFileSourceSettings.h"
#include "SWGFreeDVDemodReport.h" #include "SWGFreeDVDemodReport.h"
@ -138,6 +141,7 @@
#include "SWGRemoteSinkSettings.h" #include "SWGRemoteSinkSettings.h"
#include "SWGRemoteSourceReport.h" #include "SWGRemoteSourceReport.h"
#include "SWGRemoteSourceSettings.h" #include "SWGRemoteSourceSettings.h"
#include "SWGRtlSdrActions.h"
#include "SWGRtlSdrReport.h" #include "SWGRtlSdrReport.h"
#include "SWGRtlSdrSettings.h" #include "SWGRtlSdrSettings.h"
#include "SWGSDRPlayReport.h" #include "SWGSDRPlayReport.h"
@ -263,6 +267,9 @@ namespace SWGSDRangel {
if(QString("SWGChannel").compare(type) == 0) { if(QString("SWGChannel").compare(type) == 0) {
return new SWGChannel(); return new SWGChannel();
} }
if(QString("SWGChannelActions").compare(type) == 0) {
return new SWGChannelActions();
}
if(QString("SWGChannelAnalyzerSettings").compare(type) == 0) { if(QString("SWGChannelAnalyzerSettings").compare(type) == 0) {
return new SWGChannelAnalyzerSettings(); return new SWGChannelAnalyzerSettings();
} }
@ -302,6 +309,9 @@ namespace SWGSDRangel {
if(QString("SWGDVSerialDevices").compare(type) == 0) { if(QString("SWGDVSerialDevices").compare(type) == 0) {
return new SWGDVSerialDevices(); return new SWGDVSerialDevices();
} }
if(QString("SWGDeviceActions").compare(type) == 0) {
return new SWGDeviceActions();
}
if(QString("SWGDeviceConfig").compare(type) == 0) { if(QString("SWGDeviceConfig").compare(type) == 0) {
return new SWGDeviceConfig(); return new SWGDeviceConfig();
} }
@ -338,6 +348,9 @@ namespace SWGSDRangel {
if(QString("SWGFileInputSettings").compare(type) == 0) { if(QString("SWGFileInputSettings").compare(type) == 0) {
return new SWGFileInputSettings(); return new SWGFileInputSettings();
} }
if(QString("SWGFileSourceActions").compare(type) == 0) {
return new SWGFileSourceActions();
}
if(QString("SWGFileSourceReport").compare(type) == 0) { if(QString("SWGFileSourceReport").compare(type) == 0) {
return new SWGFileSourceReport(); return new SWGFileSourceReport();
} }
@ -545,6 +558,9 @@ namespace SWGSDRangel {
if(QString("SWGRemoteSourceSettings").compare(type) == 0) { if(QString("SWGRemoteSourceSettings").compare(type) == 0) {
return new SWGRemoteSourceSettings(); return new SWGRemoteSourceSettings();
} }
if(QString("SWGRtlSdrActions").compare(type) == 0) {
return new SWGRtlSdrActions();
}
if(QString("SWGRtlSdrReport").compare(type) == 0) { if(QString("SWGRtlSdrReport").compare(type) == 0) {
return new SWGRtlSdrReport(); return new SWGRtlSdrReport();
} }