mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-28 13:12:24 -04:00
Swagger: updated model
This commit is contained in:
parent
ac0dffac90
commit
4151e33e80
@ -40,7 +40,7 @@ cd api/swagger/include
|
|||||||
http-server --cors .
|
http-server --cors .
|
||||||
```
|
```
|
||||||
|
|
||||||
To start on a different port than 8080 use the `--port` option
|
To start on a different port than 8080 use the `-p` option
|
||||||
|
|
||||||
Then in the directory where this README.md is start the swagger editor
|
Then in the directory where this README.md is start the swagger editor
|
||||||
|
|
||||||
|
@ -3,18 +3,26 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
instanceSummary: instanceSummary,
|
instanceSummary: instanceSummary,
|
||||||
instanceDevices: instanceDevices,
|
instanceDevices: instanceDevices,
|
||||||
instanceChannels: instanceChannels
|
instanceChannels: instanceChannels,
|
||||||
|
instanceLoggingGet: instanceLoggingGet,
|
||||||
|
instanceLoggingPut: instanceLoggingPut,
|
||||||
|
instanceAudioGet: instanceAudioGet,
|
||||||
|
instanceAudioPatch: instanceAudioPatch,
|
||||||
|
instanceLocationGet: instanceLocationGet,
|
||||||
|
instanceLocationPut: instanceLocationPut,
|
||||||
|
instanceDVSerialPatch: instanceDVSerialPatch,
|
||||||
|
instancePresetGet: instancePresetGet,
|
||||||
|
instancePresetPatch: instancePresetPatch
|
||||||
};
|
};
|
||||||
|
|
||||||
function instanceSummary(req, res, next) {
|
function instanceSummary(req, res, next) {
|
||||||
|
|
||||||
res.json([
|
res.json(
|
||||||
{
|
{
|
||||||
"version":"4.0.0",
|
"version":"4.0.0",
|
||||||
"logging": {
|
"logging": {
|
||||||
"consoleLevel": "info",
|
"consoleLevel": "info",
|
||||||
"fileLevel": "debug",
|
"fileLevel": "debug"
|
||||||
"dumpToFile": false
|
|
||||||
},
|
},
|
||||||
"devicesetcount":2,
|
"devicesetcount":2,
|
||||||
"devicesets":[
|
"devicesets":[
|
||||||
@ -22,7 +30,6 @@ function instanceSummary(req, res, next) {
|
|||||||
"samplingDevice": {
|
"samplingDevice": {
|
||||||
"index":0,
|
"index":0,
|
||||||
"hwType":"RTLSDR",
|
"hwType":"RTLSDR",
|
||||||
"rx":true,
|
|
||||||
"streamIndex":0,
|
"streamIndex":0,
|
||||||
"sequence":0,
|
"sequence":0,
|
||||||
"serial":"R820T2005",
|
"serial":"R820T2005",
|
||||||
@ -39,7 +46,7 @@ function instanceSummary(req, res, next) {
|
|||||||
"samplingDevice": {
|
"samplingDevice": {
|
||||||
"index":1,
|
"index":1,
|
||||||
"hwType":"HackRF",
|
"hwType":"HackRF",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"streamIndex":0,
|
"streamIndex":0,
|
||||||
"sequence":0,
|
"sequence":0,
|
||||||
"serial":"453c64c8257a608f",
|
"serial":"453c64c8257a608f",
|
||||||
@ -53,159 +60,288 @@ function instanceSummary(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
"user":{"index":1,"name":"Sample text"}}
|
"user":{"index":1,"name":"Sample text"}
|
||||||
]);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function instanceDevices(req, res, next) {
|
function instanceDevices(req, res, next) {
|
||||||
var direction = req.swagger.params.direction.value || "rx";
|
var directionTx = req.swagger.params.tx.value || false;
|
||||||
//console.log(direction.value)
|
//console.log(tx.value)
|
||||||
|
|
||||||
if (direction === "tx") {
|
if (directionTx) {
|
||||||
res.json([
|
res.json(
|
||||||
{
|
{
|
||||||
"devicecount": 1,
|
"devicecount": 1,
|
||||||
"devices": [
|
"devices": [
|
||||||
{
|
{
|
||||||
"hwType":"HackRF",
|
"hwType":"HackRF",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"streamIndex":0,
|
"streamIndex":0,
|
||||||
"sequence":0,
|
"sequence":0,
|
||||||
"serial":"453c64c8257a608f"
|
"serial":"453c64c8257a608f"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}]);
|
});
|
||||||
} else {
|
} else {
|
||||||
res.json([
|
res.json(
|
||||||
{
|
{
|
||||||
"devicecount": 2,
|
"devicecount": 2,
|
||||||
"devices": [
|
"devices": [
|
||||||
{
|
{
|
||||||
"hwType":"RTLSDR",
|
"hwType":"RTLSDR",
|
||||||
"rx":true,
|
|
||||||
"streamIndex":0,
|
"streamIndex":0,
|
||||||
"sequence":0,
|
"sequence":0,
|
||||||
"serial":"R820T2005"
|
"serial":"R820T2005"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hwType":"HackRF",
|
"hwType":"HackRF",
|
||||||
"rx":true,
|
|
||||||
"streamIndex":0,
|
"streamIndex":0,
|
||||||
"sequence":0,
|
"sequence":0,
|
||||||
"serial":"453c64c8257a608f"
|
"serial":"453c64c8257a608f"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}]);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function instanceChannels(req, res, next) {
|
function instanceChannels(req, res, next) {
|
||||||
var direction = req.swagger.params.direction.value || "rx";
|
var directionTx = req.swagger.params.direction.value || false;
|
||||||
|
|
||||||
if (direction === "tx") {
|
if (directionTx) {
|
||||||
res.json([
|
res.json(
|
||||||
{
|
{
|
||||||
"channelcount": 6,
|
"channelcount": 6,
|
||||||
"channels": [
|
"channels": [
|
||||||
{
|
{
|
||||||
"name":"AM Modulator",
|
"name":"AM Modulator",
|
||||||
"id": "AMMod",
|
"id": "AMMod",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"version": "3.9.0"
|
"version": "3.9.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"ATV Modulator",
|
"name":"ATV Modulator",
|
||||||
"id": "ATVMod",
|
"id": "ATVMod",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"version": "3.9.0"
|
"version": "3.9.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"NFM Modulator",
|
"name":"NFM Modulator",
|
||||||
"id": "NFMMod",
|
"id": "NFMMod",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"version": "3.9.0"
|
"version": "3.9.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"SSB Modulator",
|
"name":"SSB Modulator",
|
||||||
"id": "SSBMod",
|
"id": "SSBMod",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"version": "3.9.0"
|
"version": "3.9.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"UDP Channel Sink",
|
"name":"UDP Channel Sink",
|
||||||
"id": "UDPSink",
|
"id": "UDPSink",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"WFM Modulator",
|
"name":"WFM Modulator",
|
||||||
"id": "WFMMod",
|
"id": "WFMMod",
|
||||||
"rx":false,
|
"tx":true,
|
||||||
"version": "3.9.0"
|
"version": "3.9.0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}]);
|
});
|
||||||
} else {
|
} else {
|
||||||
res.json([
|
res.json(
|
||||||
{
|
{
|
||||||
"channelcount": 9,
|
"channelcount": 9,
|
||||||
"channels": [
|
"channels": [
|
||||||
{
|
{
|
||||||
"name":"AM Demodulator",
|
"name":"AM Demodulator",
|
||||||
"id": "AMemod",
|
"id": "AMemod",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Broadcast FM Demodulator",
|
"name":"Broadcast FM Demodulator",
|
||||||
"id": "BFMDemod",
|
"id": "BFMDemod",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"ATV Demodulator",
|
"name":"ATV Demodulator",
|
||||||
"id": "ATVDemod",
|
"id": "ATVDemod",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"DSD Demodulator",
|
"name":"DSD Demodulator",
|
||||||
"id": "DSDDemod",
|
"id": "DSDDemod",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"NFM Demodulator",
|
"name":"NFM Demodulator",
|
||||||
"id": "NFDemod",
|
"id": "NFDemod",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"SSB Demodulator",
|
"name":"SSB Demodulator",
|
||||||
"id": "SSBDemod",
|
"id": "SSBDemod",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"TCP Channel Source",
|
"name":"TCP Channel Source",
|
||||||
"id": "TCPSource",
|
"id": "TCPSource",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"UDP Channel Source",
|
"name":"UDP Channel Source",
|
||||||
"id": "UDPSource",
|
"id": "UDPSource",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"WFM Demodulator",
|
"name":"WFM Demodulator",
|
||||||
"id": "WFMDemod",
|
"id": "WFMDemod",
|
||||||
"rx":true,
|
|
||||||
"version": "4.0.0"
|
"version": "4.0.0"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}]);
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function instanceLoggingGet(req, res, next) {
|
||||||
|
res.json(
|
||||||
|
{
|
||||||
|
"consoleLevel":"info",
|
||||||
|
"fileLevel":"debug",
|
||||||
|
"dumpToFile": true,
|
||||||
|
"fileName":"sdrangel.log"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function instanceLoggingPut(req, res, next) {
|
||||||
|
console.log(req.swagger.params.body.value);
|
||||||
|
res.json(req.swagger.params.body.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function instanceAudioGet(req, res, next) {
|
||||||
|
res.json(
|
||||||
|
{
|
||||||
|
"nbInputDevices":7,
|
||||||
|
"inputDevices": [
|
||||||
|
"Default (use first suitable device)",
|
||||||
|
"HDA Intel HDMI",
|
||||||
|
"HDA Intel PCH",
|
||||||
|
"default",
|
||||||
|
"alsa_input.pci-0000_00_1b.0.analog-stereo",
|
||||||
|
"alsa_output.pci-0000_00_03.0.hdmi-stereo.monitor",
|
||||||
|
"alsa_output.pci-0000_00_1b.0.analog-stereo.monitor"
|
||||||
|
],
|
||||||
|
"nbOutputDevices":6,
|
||||||
|
"outputDevices": [
|
||||||
|
"Default (use first suitable device)",
|
||||||
|
"HDA Intel HDMI",
|
||||||
|
"HDA Intel PCH",
|
||||||
|
"default",
|
||||||
|
"alsa_output.pci-0000_00_03.0.hdmi-stereo",
|
||||||
|
"alsa_output.pci-0000_00_1b.0.analog-stereo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function instanceAudioPatch(req, res, next) {
|
||||||
|
console.log(req.swagger.params.body.value);
|
||||||
|
res.json(req.swagger.params.body.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function instanceLocationGet(req, res, next) {
|
||||||
|
res.json(
|
||||||
|
{
|
||||||
|
"latitude":43.523774,
|
||||||
|
"longitude":7.044443
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function instanceLocationPut(req, res, next) {
|
||||||
|
res.json(req.swagger.params.body.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
function instanceDVSerialPatch(req, res, next) {
|
||||||
|
var setDVSerial = req.swagger.params.dvserial.value || false;
|
||||||
|
|
||||||
|
if (setDVSerial) {
|
||||||
|
res.json(
|
||||||
|
{
|
||||||
|
"nbDevices":2,
|
||||||
|
"dvSerialDevices": [
|
||||||
|
"/dev/ttyUSB0",
|
||||||
|
"/dev/ttyUSB1"
|
||||||
|
]
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
res.json(
|
||||||
|
{
|
||||||
|
"nbDevices":0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function instancePresetGet(req, res, next) {
|
||||||
|
res.json(
|
||||||
|
{
|
||||||
|
"nbGroups": 2,
|
||||||
|
"groups": [
|
||||||
|
{
|
||||||
|
"groupName": "ATV",
|
||||||
|
"nbPresets": 3,
|
||||||
|
"presets": [
|
||||||
|
{
|
||||||
|
"centerFrequency": 435.995,
|
||||||
|
"type": "R",
|
||||||
|
"name": "Test Rx 90/2 25k"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"centerFrequency": 436.0,
|
||||||
|
"type": "T",
|
||||||
|
"name": "Test Rx 90/2 25k"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"centerFrequency": 1243.0,
|
||||||
|
"type": "R",
|
||||||
|
"name": "Mont Agel"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"groupName": "BFM",
|
||||||
|
"nbPresets": 4,
|
||||||
|
"presets": [
|
||||||
|
{
|
||||||
|
"centerFrequency": 91.5,
|
||||||
|
"type": "R",
|
||||||
|
"name": "Cannes Radio"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"centerFrequency": 96.4,
|
||||||
|
"type": "R",
|
||||||
|
"name": "Kiss FM"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"centerFrequency": 103.2,
|
||||||
|
"type": "R",
|
||||||
|
"name": "Radio Monaco"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"centerFrequency": 103.4,
|
||||||
|
"type": "R",
|
||||||
|
"name": "Frequence K"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function instancePresetPatch(req, res, next) {
|
||||||
|
res.json(req.swagger.params.body.value);
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,6 @@ paths:
|
|||||||
description: SDRangel instance summary
|
description: SDRangel instance summary
|
||||||
# used as the method name of the controller
|
# used as the method name of the controller
|
||||||
operationId: instanceSummary
|
operationId: instanceSummary
|
||||||
# parameters:
|
|
||||||
# - name: name
|
|
||||||
# in: query
|
|
||||||
# description: The name of the person to whom to say hello
|
|
||||||
# required: false
|
|
||||||
# type: string
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Success
|
description: Success
|
||||||
@ -52,11 +46,11 @@ paths:
|
|||||||
description: Get a list of sampling devices that can be used to take part in a device set
|
description: Get a list of sampling devices that can be used to take part in a device set
|
||||||
operationId: instanceDevices
|
operationId: instanceDevices
|
||||||
parameters:
|
parameters:
|
||||||
- name: direction
|
- name: tx
|
||||||
in: query
|
in: query
|
||||||
description: Gives Rx (rx or none) or Tx (tx) direction
|
description: Set to true for Tx direction
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: boolean
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Success
|
description: Success
|
||||||
@ -72,11 +66,11 @@ paths:
|
|||||||
description: Get a list of channel plugins available in this instance
|
description: Get a list of channel plugins available in this instance
|
||||||
operationId: instanceChannels
|
operationId: instanceChannels
|
||||||
parameters:
|
parameters:
|
||||||
- name: direction
|
- name: tx
|
||||||
in: query
|
in: query
|
||||||
description: gives Rx (rx or none) or Tx (tx) direction
|
description: Set to true for Tx channels
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: boolean
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Success
|
description: Success
|
||||||
@ -86,6 +80,263 @@ paths:
|
|||||||
description: Error
|
description: Error
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/ErrorResponse"
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
/sdrangel/logging:
|
||||||
|
x-swagger-router-controller: instance
|
||||||
|
get:
|
||||||
|
description: Get logging information for this instance
|
||||||
|
operationId: instanceLoggingGet
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/LoggingInfo"
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
put:
|
||||||
|
description: Change logging parmeters for this instance
|
||||||
|
operationId: instanceLoggingPut
|
||||||
|
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: Invallid data
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
/sdrangel/audio:
|
||||||
|
x-swagger-router-controller: instance
|
||||||
|
get:
|
||||||
|
description: Get audio devices list available to this instance
|
||||||
|
operationId: instanceAudioGet
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/AudioDevices"
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
patch:
|
||||||
|
description: Set audio devices
|
||||||
|
operationId: instanceAudioPatch
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: Select audio devices to use for this instance
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/AudioDevicesSelect"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Success
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/AudioDevicesSelect"
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
/sdrangel/location:
|
||||||
|
x-swagger-router-controller: instance
|
||||||
|
get:
|
||||||
|
description: Get instance geolocation information
|
||||||
|
operationId: instanceLocationGet
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return location
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/LocationInformation"
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
put:
|
||||||
|
description: Set instance geolocation information
|
||||||
|
operationId: instanceLocationPut
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: Location of instance in latitude and longitude
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/LocationInformation"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return location
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/LocationInformation"
|
||||||
|
"400":
|
||||||
|
description: Location invalid
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
/sdrangel/dvserial:
|
||||||
|
x-swagger-router-controller: instance
|
||||||
|
patch:
|
||||||
|
description: Set or reset DV serial processing for AMBE frames decoding in digital voice modes
|
||||||
|
operationId: instanceDVSerialPatch
|
||||||
|
parameters:
|
||||||
|
- name: dvserial
|
||||||
|
in: query
|
||||||
|
description: Set to true to set DV serial processing
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return list of devices or empty list if unset
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/DVSeralDevices"
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
/sdrangel/preset:
|
||||||
|
x-swagger-router-controller: instance
|
||||||
|
get:
|
||||||
|
description: List all presets in the instance
|
||||||
|
operationId: instancePresetGet
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return preset list
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/Presets"
|
||||||
|
default:
|
||||||
|
description: Error
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
patch:
|
||||||
|
description: Load a preset in a device set
|
||||||
|
operationId: instancePresetPatch
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: Load this preset
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
required:
|
||||||
|
- deviceSetIndex
|
||||||
|
- preset
|
||||||
|
properties:
|
||||||
|
deviceSetIndex:
|
||||||
|
description: "Index of the device set"
|
||||||
|
type: integer
|
||||||
|
preset:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return preset identification
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
"400":
|
||||||
|
description: Invalid frequency
|
||||||
|
"404":
|
||||||
|
description: No preset or device set found
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
put:
|
||||||
|
description: Save device set settings on a preset
|
||||||
|
operationId: instancePresetPut
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: save device set settings on this preset
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
required:
|
||||||
|
- deviceSetIndex
|
||||||
|
- preset
|
||||||
|
properties:
|
||||||
|
deviceSetIndex:
|
||||||
|
description: "Index of the device set"
|
||||||
|
type: integer
|
||||||
|
preset:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return preset identification
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
"400":
|
||||||
|
description: Invalid frequency
|
||||||
|
"404":
|
||||||
|
description: No preset or device set found
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ErrorResponse"
|
||||||
|
post:
|
||||||
|
description: Create a new preset from a device set settings
|
||||||
|
operationId: instancePresetPost
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: save current settings on a new preset
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
required:
|
||||||
|
- deviceSetIndex
|
||||||
|
- preset
|
||||||
|
properties:
|
||||||
|
deviceSetIndex:
|
||||||
|
description: "Index of the device set"
|
||||||
|
type: integer
|
||||||
|
preset:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return preset identification
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
"400":
|
||||||
|
description: Invalid frequency
|
||||||
|
"404":
|
||||||
|
description: Device set not found
|
||||||
|
"409":
|
||||||
|
description: Preset already exists
|
||||||
|
delete:
|
||||||
|
description: Deletes a preset
|
||||||
|
operationId: instancePresetDelete
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
description: delete this preset
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: On success return deleted preset identification
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/PresetIdentifier"
|
||||||
|
"400":
|
||||||
|
description: Invalid frequency
|
||||||
|
"404":
|
||||||
|
description: Preset not found
|
||||||
/swagger:
|
/swagger:
|
||||||
x-swagger-pipe: swagger_raw
|
x-swagger-pipe: swagger_raw
|
||||||
# complex objects have schema definitions
|
# complex objects have schema definitions
|
||||||
@ -145,7 +396,6 @@ definitions:
|
|||||||
required:
|
required:
|
||||||
- consoleLevel
|
- consoleLevel
|
||||||
- fileLevel
|
- fileLevel
|
||||||
- dumpToFile
|
|
||||||
properties:
|
properties:
|
||||||
consoleLevel:
|
consoleLevel:
|
||||||
description: "Minimum level of messages printed to console: debug, info, warning, error"
|
description: "Minimum level of messages printed to console: debug, info, warning, error"
|
||||||
@ -154,7 +404,7 @@ definitions:
|
|||||||
description: "Minimum level of messages written to file: debug, info, warning, error"
|
description: "Minimum level of messages written to file: debug, info, warning, error"
|
||||||
type: string
|
type: string
|
||||||
dumpToFile:
|
dumpToFile:
|
||||||
description: "True if messages are written to file else false to log to console only"
|
description: "True if messages are written to file"
|
||||||
type: boolean
|
type: boolean
|
||||||
fileName:
|
fileName:
|
||||||
description: "Name of the log file"
|
description: "Name of the log file"
|
||||||
@ -163,7 +413,6 @@ definitions:
|
|||||||
description: "Summarized information about attached hardware device"
|
description: "Summarized information about attached hardware device"
|
||||||
required:
|
required:
|
||||||
- hwType
|
- hwType
|
||||||
- rx
|
|
||||||
- streamIndex
|
- streamIndex
|
||||||
- sequence
|
- sequence
|
||||||
- serial
|
- serial
|
||||||
@ -171,8 +420,8 @@ definitions:
|
|||||||
hwType:
|
hwType:
|
||||||
description: "Key to identify the type of hardware device"
|
description: "Key to identify the type of hardware device"
|
||||||
type: string
|
type: string
|
||||||
rx:
|
tx:
|
||||||
description: "True if this is an Rx device else false for Tx"
|
description: "Set to true if this is a Tx device"
|
||||||
type: boolean
|
type: boolean
|
||||||
nbStreams:
|
nbStreams:
|
||||||
description: "Number of channels or streams in the device"
|
description: "Number of channels or streams in the device"
|
||||||
@ -191,7 +440,6 @@ definitions:
|
|||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- id
|
- id
|
||||||
- rx
|
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: "Displayable name of the channel plugin"
|
description: "Displayable name of the channel plugin"
|
||||||
@ -199,8 +447,8 @@ definitions:
|
|||||||
id:
|
id:
|
||||||
description: "Key to identify the channel plugin type"
|
description: "Key to identify the channel plugin type"
|
||||||
type: string
|
type: string
|
||||||
rx:
|
tx:
|
||||||
description: "True if this is an Rx channel else false for Tx"
|
description: "True if this is a Tx channel"
|
||||||
type: boolean
|
type: boolean
|
||||||
version:
|
version:
|
||||||
description: "Channel plugin version number"
|
description: "Channel plugin version number"
|
||||||
@ -226,7 +474,6 @@ definitions:
|
|||||||
required:
|
required:
|
||||||
- index
|
- index
|
||||||
- hwType
|
- hwType
|
||||||
- rx
|
|
||||||
- streamIndex
|
- streamIndex
|
||||||
- sequence
|
- sequence
|
||||||
- serial
|
- serial
|
||||||
@ -238,8 +485,8 @@ definitions:
|
|||||||
hwType:
|
hwType:
|
||||||
description: "Key to identify the type of hardware device"
|
description: "Key to identify the type of hardware device"
|
||||||
type: string
|
type: string
|
||||||
rx:
|
tx:
|
||||||
description: "True if this is an Rx device else false for Tx"
|
description: "True if this is a Tx device"
|
||||||
type: boolean
|
type: boolean
|
||||||
nbStreams:
|
nbStreams:
|
||||||
description: "Number of channels or streams in the device"
|
description: "Number of channels or streams in the device"
|
||||||
@ -276,3 +523,123 @@ definitions:
|
|||||||
deltaFrequency:
|
deltaFrequency:
|
||||||
description: "Channel shift frequency in Hz from the center of baseband"
|
description: "Channel shift frequency in Hz from the center of baseband"
|
||||||
type: integer
|
type: integer
|
||||||
|
AudioDevices:
|
||||||
|
description: "List of audio devices available in the system"
|
||||||
|
required:
|
||||||
|
- nbInputDevices
|
||||||
|
- nbOutputDevices
|
||||||
|
properties:
|
||||||
|
nbInputDevices:
|
||||||
|
description: "Number of input audio devices"
|
||||||
|
type: integer
|
||||||
|
inputDevices:
|
||||||
|
description: "Names of input devices"
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
nbOutputDevices:
|
||||||
|
description: "Number of output audio devices"
|
||||||
|
type: integer
|
||||||
|
outputDevices:
|
||||||
|
description: "Names of output devices"
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
AudioDevicesSelect:
|
||||||
|
description: "Audio devices selected"
|
||||||
|
properties:
|
||||||
|
input:
|
||||||
|
description: "Name of the audio input device"
|
||||||
|
type: string
|
||||||
|
output:
|
||||||
|
description: "Name of the audio output device"
|
||||||
|
type: string
|
||||||
|
LocationInformation:
|
||||||
|
description: "Instance geolocation information"
|
||||||
|
required:
|
||||||
|
- latitude
|
||||||
|
- longitude
|
||||||
|
properties:
|
||||||
|
latitude:
|
||||||
|
description: "Lautitude in decimal degrees positive to the north"
|
||||||
|
type: number
|
||||||
|
longitude:
|
||||||
|
description: "Longitude in decimal degrees positive to the east"
|
||||||
|
type: number
|
||||||
|
DVSeralDevices:
|
||||||
|
description: "List of DV serial devices available in the system"
|
||||||
|
required:
|
||||||
|
- nbDevices
|
||||||
|
properties:
|
||||||
|
nbDevices:
|
||||||
|
description: "Number of DV serial devices"
|
||||||
|
type: integer
|
||||||
|
dvSerialDevices:
|
||||||
|
description: "Device names of DV serial devices"
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
Presets:
|
||||||
|
description: "Settings presets"
|
||||||
|
required:
|
||||||
|
- nbGroups
|
||||||
|
properties:
|
||||||
|
nbGroups:
|
||||||
|
description: "Number of preset groups"
|
||||||
|
type: integer
|
||||||
|
groups:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/PresetGroup"
|
||||||
|
PresetGroup:
|
||||||
|
description: "Group of presets"
|
||||||
|
required:
|
||||||
|
- groupName
|
||||||
|
- nbPresets
|
||||||
|
properties:
|
||||||
|
groupName:
|
||||||
|
description: "Name of the preset group"
|
||||||
|
type: string
|
||||||
|
nbPresets:
|
||||||
|
description: "Number of presets in the group"
|
||||||
|
type: integer
|
||||||
|
presets:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/PresetItem"
|
||||||
|
PresetIdentifier:
|
||||||
|
description: "Settings preset item"
|
||||||
|
required:
|
||||||
|
- groupName
|
||||||
|
- centerFrequency
|
||||||
|
- type
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
groupName:
|
||||||
|
description: "Name of the preset group"
|
||||||
|
type: string
|
||||||
|
centerFrequency:
|
||||||
|
description: "Center freqeuency in MHz"
|
||||||
|
type: number
|
||||||
|
type:
|
||||||
|
description: "Type of device set (R: Rx, T: Tx)"
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
description: "Descriptive name of the preset"
|
||||||
|
type: string
|
||||||
|
PresetItem:
|
||||||
|
description: "Settings preset item"
|
||||||
|
required:
|
||||||
|
- centerFrequency
|
||||||
|
- type
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
centerFrequency:
|
||||||
|
description: "Center freqeuency in MHz"
|
||||||
|
type: number
|
||||||
|
type:
|
||||||
|
description: "Type of device set (R: Rx, T: Tx)"
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
description: "Descriptive name of the preset"
|
||||||
|
type: string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user