REST API device and channel actions: generated code

pull/489/head
f4exb 2020-03-10 08:32:54 +01:00
rodzic 6d47e65aa6
commit 5e0d373d2a
6 zmienionych plików z 2388 dodań i 4 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -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

Wyświetl plik

@ -44,6 +44,7 @@
#include "SWGBladeRF2OutputSettings.h"
#include "SWGCWKeyerSettings.h"
#include "SWGChannel.h"
#include "SWGChannelActions.h"
#include "SWGChannelAnalyzerSettings.h"
#include "SWGChannelConfig.h"
#include "SWGChannelListItem.h"
@ -57,6 +58,7 @@
#include "SWGDSDDemodSettings.h"
#include "SWGDVSerialDevice.h"
#include "SWGDVSerialDevices.h"
#include "SWGDeviceActions.h"
#include "SWGDeviceConfig.h"
#include "SWGDeviceListItem.h"
#include "SWGDeviceReport.h"
@ -69,6 +71,7 @@
#include "SWGFCDProSettings.h"
#include "SWGFileInputReport.h"
#include "SWGFileInputSettings.h"
#include "SWGFileSourceActions.h"
#include "SWGFileSourceReport.h"
#include "SWGFileSourceSettings.h"
#include "SWGFreeDVDemodReport.h"
@ -138,6 +141,7 @@
#include "SWGRemoteSinkSettings.h"
#include "SWGRemoteSourceReport.h"
#include "SWGRemoteSourceSettings.h"
#include "SWGRtlSdrActions.h"
#include "SWGRtlSdrReport.h"
#include "SWGRtlSdrSettings.h"
#include "SWGSDRPlayReport.h"
@ -263,6 +267,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();
}
@ -302,6 +309,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();
}
@ -338,6 +348,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();
}
@ -545,6 +558,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();
}