mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-03-23 04:44:53 -04:00
Web API: created run state getter. Implemented in RTLSDR
This commit is contained in:
parent
a27ce7ea89
commit
7d122b6b67
@ -34,6 +34,7 @@ RTLSDRGui::RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::RTLSDRGui),
|
||||
m_deviceUISet(deviceUISet),
|
||||
m_doApplySettings(true),
|
||||
m_forceSettings(true),
|
||||
m_settings(),
|
||||
m_sampleSource(0),
|
||||
@ -142,7 +143,10 @@ bool RTLSDRGui::handleMessage(const Message& message)
|
||||
{
|
||||
const RTLSDRInput::MsgConfigureRTLSDR& cfg = (RTLSDRInput::MsgConfigureRTLSDR&) message;
|
||||
m_settings = cfg.getSettings();
|
||||
blockApplySettings(true);
|
||||
displayGains();
|
||||
displaySettings();
|
||||
blockApplySettings(false);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@ -355,10 +359,13 @@ void RTLSDRGui::on_transverter_clicked()
|
||||
|
||||
void RTLSDRGui::updateHardware()
|
||||
{
|
||||
RTLSDRInput::MsgConfigureRTLSDR* message = RTLSDRInput::MsgConfigureRTLSDR::create(m_settings, m_forceSettings);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
if (m_doApplySettings)
|
||||
{
|
||||
RTLSDRInput::MsgConfigureRTLSDR* message = RTLSDRInput::MsgConfigureRTLSDR::create(m_settings, m_forceSettings);
|
||||
m_sampleSource->getInputMessageQueue()->push(message);
|
||||
m_forceSettings = false;
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void RTLSDRGui::updateStatus()
|
||||
@ -390,6 +397,11 @@ void RTLSDRGui::updateStatus()
|
||||
}
|
||||
}
|
||||
|
||||
void RTLSDRGui::blockApplySettings(bool block)
|
||||
{
|
||||
m_doApplySettings = !block;
|
||||
}
|
||||
|
||||
void RTLSDRGui::on_checkBox_stateChanged(int state)
|
||||
{
|
||||
if (state == Qt::Checked)
|
||||
|
@ -55,6 +55,7 @@ private:
|
||||
Ui::RTLSDRGui* ui;
|
||||
|
||||
DeviceUISet* m_deviceUISet;
|
||||
bool m_doApplySettings;
|
||||
bool m_forceSettings;
|
||||
RTLSDRSettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
@ -71,6 +72,7 @@ private:
|
||||
void sendSettings();
|
||||
void updateSampleRateAndFrequency();
|
||||
void updateFrequencyLimits();
|
||||
void blockApplySettings(bool block);
|
||||
|
||||
private slots:
|
||||
void handleInputMessages();
|
||||
|
@ -314,16 +314,14 @@ bool RTLSDRInput::applySettings(const RTLSDRSettings& settings, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_settings.m_dcBlock != settings.m_dcBlock) || force)
|
||||
if ((m_settings.m_dcBlock != settings.m_dcBlock) || (m_settings.m_iqImbalance != settings.m_iqImbalance) || force)
|
||||
{
|
||||
m_settings.m_dcBlock = settings.m_dcBlock;
|
||||
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqImbalance);
|
||||
}
|
||||
|
||||
if ((m_settings.m_iqImbalance != settings.m_iqImbalance) || force)
|
||||
{
|
||||
m_settings.m_iqImbalance = settings.m_iqImbalance;
|
||||
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqImbalance);
|
||||
qDebug("RTLSDRInput::applySettings: corrections: DC block: %s IQ imbalance: %s",
|
||||
m_settings.m_dcBlock ? "true" : "false",
|
||||
m_settings.m_iqImbalance ? "true" : "false");
|
||||
}
|
||||
|
||||
if ((m_settings.m_loPpmCorrection != settings.m_loPpmCorrection) || force)
|
||||
@ -370,6 +368,8 @@ bool RTLSDRInput::applySettings(const RTLSDRSettings& settings, bool force)
|
||||
{
|
||||
m_rtlSDRThread->setLog2Decimation(settings.m_log2Decim);
|
||||
}
|
||||
|
||||
qDebug("RTLSDRInput::applySettings: log2decim set to %d", m_settings.m_log2Decim);
|
||||
}
|
||||
|
||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)
|
||||
@ -430,13 +430,15 @@ bool RTLSDRInput::applySettings(const RTLSDRSettings& settings, bool force)
|
||||
if (m_rtlSDRThread != 0)
|
||||
{
|
||||
m_rtlSDRThread->setFcPos((int) m_settings.m_fcPos);
|
||||
qDebug() << "RTLSDRInput: set fc pos (enum) to " << (int) m_settings.m_fcPos;
|
||||
}
|
||||
|
||||
qDebug() << "RTLSDRInput: set fc pos (enum) to " << (int) m_settings.m_fcPos;
|
||||
}
|
||||
|
||||
if ((m_settings.m_noModMode != settings.m_noModMode) || force)
|
||||
{
|
||||
m_settings.m_noModMode = settings.m_noModMode;
|
||||
qDebug() << "RTLSDRInput: set noModMode to " << m_settings.m_noModMode;
|
||||
|
||||
// Direct Modes: 0: off, 1: I, 2: Q, 3: NoMod.
|
||||
if (m_settings.m_noModMode) {
|
||||
@ -526,6 +528,14 @@ int RTLSDRInput::webapiSettingsPutPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int RTLSDRInput::webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
|
||||
return 200;
|
||||
}
|
||||
|
||||
int RTLSDRInput::webapiRun(
|
||||
bool run,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
|
@ -115,6 +115,10 @@ public:
|
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiRun(
|
||||
bool run,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
|
@ -58,6 +58,11 @@ public:
|
||||
QString& errorMessage)
|
||||
{ errorMessage = "Not implemented"; return 501; }
|
||||
|
||||
virtual int webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
|
||||
QString& errorMessage)
|
||||
{ errorMessage = "Not implemented"; return 501; }
|
||||
|
||||
virtual int webapiRun(bool run __attribute__((unused)),
|
||||
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
|
||||
QString& errorMessage)
|
||||
|
@ -58,6 +58,11 @@ public:
|
||||
QString& errorMessage)
|
||||
{ errorMessage = "Not implemented"; return 501; }
|
||||
|
||||
virtual int webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
|
||||
QString& errorMessage)
|
||||
{ errorMessage = "Not implemented"; return 501; }
|
||||
|
||||
virtual int webapiRun(bool run __attribute__((unused)),
|
||||
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
|
||||
QString& errorMessage)
|
||||
|
@ -1374,6 +1374,9 @@ margin-bottom: 20px;
|
||||
<li data-group="DeviceSet" data-name="devicesetDeviceRunDelete" class="">
|
||||
<a href="#api-DeviceSet-devicesetDeviceRunDelete">devicesetDeviceRunDelete</a>
|
||||
</li>
|
||||
<li data-group="DeviceSet" data-name="devicesetDeviceRunGet" class="">
|
||||
<a href="#api-DeviceSet-devicesetDeviceRunGet">devicesetDeviceRunGet</a>
|
||||
</li>
|
||||
<li data-group="DeviceSet" data-name="devicesetDeviceRunPost" class="">
|
||||
<a href="#api-DeviceSet-devicesetDeviceRunPost">devicesetDeviceRunPost</a>
|
||||
</li>
|
||||
@ -2229,7 +2232,50 @@ except ApiException as e:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Invalid device set index or device not found </h3>
|
||||
<h3> Status: 400 - Invalid device set index </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunDelete-400-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunDelete-400-schema">
|
||||
<div id='responses-devicesetDeviceRunDelete-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunDelete-400-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunDelete-400-schema-400');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunDelete-400-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Device not found </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
@ -2244,7 +2290,7 @@ except ApiException as e:
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index or device not found",
|
||||
"description" : "Device not found",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
@ -2326,6 +2372,432 @@ except ApiException as e:
|
||||
</article>
|
||||
</div>
|
||||
<hr>
|
||||
<div id="api-DeviceSet-devicesetDeviceRunGet">
|
||||
<article id="api-DeviceSet-devicesetDeviceRunGet-0" data-group="User" data-name="devicesetDeviceRunGet" data-version="0">
|
||||
<div class="pull-left">
|
||||
<h1>devicesetDeviceRunGet</h1>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="pull-right"></div>
|
||||
<div class="clearfix"></div>
|
||||
<p></p>
|
||||
<p class="marked">get device rune status</p>
|
||||
<p></p>
|
||||
<br />
|
||||
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/sdrangel/deviceset/{deviceSetIndex}/device/run</span></code></pre>
|
||||
<p>
|
||||
<h3>Usage and SDK Samples</h3>
|
||||
</p>
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
<li class="active"><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-curl">Curl</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-java">Java</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-android">Android</a></li>
|
||||
<!--<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-groovy">Groovy</a></li>-->
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-objc">Obj-C</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-javascript">JavaScript</a></li>
|
||||
<!--<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-angular">Angular</a></li>-->
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-csharp">C#</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-php">PHP</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-perl">Perl</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-python">Python</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="examples-DeviceSet-devicesetDeviceRunGet-0-curl">
|
||||
<pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost:8091/sdrangel/deviceset/{deviceSetIndex}/device/run"</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-java">
|
||||
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
|
||||
import SWGSDRangel.auth.*;
|
||||
import SWGSDRangel.model.*;
|
||||
import SWGSDRangel.api.DeviceSetApi;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public class DeviceSetApiExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
DeviceSetApi apiInstance = new DeviceSetApi();
|
||||
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
try {
|
||||
DeviceState result = apiInstance.devicesetDeviceRunGet(deviceSetIndex);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling DeviceSetApi#devicesetDeviceRunGet");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-android">
|
||||
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.DeviceSetApi;
|
||||
|
||||
public class DeviceSetApiExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
DeviceSetApi apiInstance = new DeviceSetApi();
|
||||
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
try {
|
||||
DeviceState result = apiInstance.devicesetDeviceRunGet(deviceSetIndex);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling DeviceSetApi#devicesetDeviceRunGet");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
<!--
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-groovy">
|
||||
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
|
||||
</div> -->
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-objc">
|
||||
<pre class="prettyprint"><code class="language-cpp">Integer *deviceSetIndex = 56; // Index of device set in the device set list
|
||||
|
||||
DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
|
||||
|
||||
[apiInstance devicesetDeviceRunGetWith:deviceSetIndex
|
||||
completionHandler: ^(DeviceState output, NSError* error) {
|
||||
if (output) {
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
}
|
||||
}];
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-javascript">
|
||||
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
|
||||
|
||||
var api = new SdRangel.DeviceSetApi()
|
||||
|
||||
var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
|
||||
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
};
|
||||
api.devicesetDeviceRunGet(deviceSetIndex, callback);
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<!--<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-angular">
|
||||
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
|
||||
</div>-->
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-csharp">
|
||||
<pre class="prettyprint"><code class="language-cs">using System;
|
||||
using System.Diagnostics;
|
||||
using SWGSDRangel.Api;
|
||||
using SWGSDRangel.Client;
|
||||
using SWGSDRangel.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class devicesetDeviceRunGetExample
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new DeviceSetApi();
|
||||
var deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
|
||||
try
|
||||
{
|
||||
DeviceState result = apiInstance.devicesetDeviceRunGet(deviceSetIndex);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print("Exception when calling DeviceSetApi.devicesetDeviceRunGet: " + e.Message );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-php">
|
||||
<pre class="prettyprint"><code class="language-php"><?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\DeviceSetApi();
|
||||
$deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
|
||||
try {
|
||||
$result = $api_instance->devicesetDeviceRunGet($deviceSetIndex);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling DeviceSetApi->devicesetDeviceRunGet: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?></code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-perl">
|
||||
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
|
||||
use SWGSDRangel::Configuration;
|
||||
use SWGSDRangel::DeviceSetApi;
|
||||
|
||||
my $api_instance = SWGSDRangel::DeviceSetApi->new();
|
||||
my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->devicesetDeviceRunGet(deviceSetIndex => $deviceSetIndex);
|
||||
print Dumper($result);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling DeviceSetApi->devicesetDeviceRunGet: $@\n";
|
||||
}</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-python">
|
||||
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
|
||||
import time
|
||||
import swagger_sdrangel
|
||||
from swagger_sdrangel.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_sdrangel.DeviceSetApi()
|
||||
deviceSetIndex = 56 # Integer | Index of device set in the device set list
|
||||
|
||||
try:
|
||||
api_response = api_instance.deviceset_device_run_get(deviceSetIndex)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling DeviceSetApi->devicesetDeviceRunGet: %s\n" % e)</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
|
||||
<div class="methodsubtabletitle">Path parameters</div>
|
||||
<table id="methodsubtable">
|
||||
<tr>
|
||||
<th width="150px">Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr><td style="width:150px;">deviceSetIndex*</td>
|
||||
<td>
|
||||
|
||||
|
||||
<div id="d2e199_devicesetDeviceRunGet_deviceSetIndex">
|
||||
<div class="json-schema-view">
|
||||
<div class="primitive">
|
||||
<span class="type">
|
||||
Integer
|
||||
</span>
|
||||
|
||||
<div class="inner description">
|
||||
Index of device set in the device set list
|
||||
</div>
|
||||
</div>
|
||||
<div class="inner required">
|
||||
Required
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Responses</h2>
|
||||
<h3> Status: 200 - On success return current state </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-200-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-200-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "On success return current state",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/DeviceState"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-200-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-200-schema-200');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-200-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 400 - Invalid device set index </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-400-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-400-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-400-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-400-schema-400');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-400-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Device not found </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-404-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-404-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-404-schema-404' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Device not found",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-404-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-404-schema-404');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-404-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 500 - Error </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-500-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-500-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-500-schema-500' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Error",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-500-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-500-schema-500');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-500-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 501 - Function not implemented </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<hr>
|
||||
<div id="api-DeviceSet-devicesetDeviceRunPost">
|
||||
<article id="api-DeviceSet-devicesetDeviceRunPost-0" data-group="User" data-name="devicesetDeviceRunPost" data-version="0">
|
||||
<div class="pull-left">
|
||||
@ -2612,7 +3084,50 @@ except ApiException as e:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Invalid device set index or device not found </h3>
|
||||
<h3> Status: 400 - Invalid device set index </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunPost-400-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunPost-400-schema">
|
||||
<div id='responses-devicesetDeviceRunPost-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunPost-400-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunPost-400-schema-400');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunPost-400-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Device not found </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
@ -2627,7 +3142,7 @@ except ApiException as e:
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index or device not found",
|
||||
"description" : "Device not found",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
@ -10759,7 +11274,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2017-12-06T23:48:11.127+01:00
|
||||
Generated 2017-12-09T10:46:45.115+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -258,6 +258,16 @@ public:
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{ return 501; }
|
||||
|
||||
/**
|
||||
* Handler of /sdrangel/deviceset/{devicesetIndex}/device/run (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels
|
||||
* returns the Http status code (default 501: not implemented)
|
||||
*/
|
||||
virtual int devicesetDeviceRunGet(
|
||||
int deviceSetIndex __attribute__((unused)),
|
||||
SWGSDRangel::SWGDeviceState& response __attribute__((unused)),
|
||||
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
|
||||
{ return 501; }
|
||||
|
||||
/**
|
||||
* Handler of /sdrangel/deviceset/{devicesetIndex}/device/run (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels
|
||||
* returns the Http status code (default 501: not implemented)
|
||||
|
@ -708,7 +708,20 @@ void WebAPIRequestMapper::devicesetDeviceRunService(const std::string& indexStr,
|
||||
{
|
||||
int deviceSetIndex = boost::lexical_cast<int>(indexStr);
|
||||
|
||||
if (request.getMethod() == "POST")
|
||||
if (request.getMethod() == "GET")
|
||||
{
|
||||
SWGSDRangel::SWGDeviceState normalResponse;
|
||||
int status = m_adapter->devicesetDeviceRunGet(deviceSetIndex, normalResponse, errorResponse);
|
||||
|
||||
response.setStatus(status);
|
||||
|
||||
if (status == 200) {
|
||||
response.write(normalResponse.asJson().toUtf8());
|
||||
} else {
|
||||
response.write(errorResponse.asJson().toUtf8());
|
||||
}
|
||||
}
|
||||
else if (request.getMethod() == "POST")
|
||||
{
|
||||
SWGSDRangel::SWGDeviceState normalResponse;
|
||||
int status = m_adapter->devicesetDeviceRunPost(deviceSetIndex, normalResponse, errorResponse);
|
||||
|
@ -784,6 +784,40 @@ int WebAPIAdapterGUI::devicesetDeviceSettingsPutPatch(
|
||||
}
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::devicesetDeviceRunGet(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error)
|
||||
{
|
||||
if ((deviceSetIndex >= 0) && (deviceSetIndex < (int) m_mainWindow.m_deviceUIs.size()))
|
||||
{
|
||||
DeviceUISet *deviceSet = m_mainWindow.m_deviceUIs[deviceSetIndex];
|
||||
|
||||
if (deviceSet->m_deviceSourceEngine) // Rx
|
||||
{
|
||||
DeviceSampleSource *source = deviceSet->m_deviceSourceAPI->getSampleSource();
|
||||
return source->webapiRunGet(response, *error.getMessage());
|
||||
}
|
||||
else if (deviceSet->m_deviceSinkEngine) // Tx
|
||||
{
|
||||
DeviceSampleSink *sink = deviceSet->m_deviceSinkAPI->getSampleSink();
|
||||
return sink->webapiRunGet(response, *error.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
*error.getMessage() = QString("DeviceSet error");
|
||||
return 500;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error.init();
|
||||
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
|
||||
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
|
||||
int WebAPIAdapterGUI::devicesetDeviceRunPost(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
|
@ -131,6 +131,11 @@ public:
|
||||
SWGSDRangel::SWGDeviceSettings& response,
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
virtual int devicesetDeviceRunGet(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
SWGSDRangel::SWGErrorResponse& error);
|
||||
|
||||
virtual int devicesetDeviceRunPost(
|
||||
int deviceSetIndex,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
|
@ -624,6 +624,36 @@ paths:
|
||||
description: Function not implemented
|
||||
/sdrangel/deviceset/{deviceSetIndex}/device/run:
|
||||
x-swagger-router-controller: deviceset
|
||||
get:
|
||||
description: get device rune status
|
||||
operationId: devicesetDeviceRunGet
|
||||
tags:
|
||||
- DeviceSet
|
||||
parameters:
|
||||
- in: path
|
||||
name: deviceSetIndex
|
||||
type: integer
|
||||
required: true
|
||||
description: Index of device set in the device set list
|
||||
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":
|
||||
description: Error
|
||||
schema:
|
||||
$ref: "#/definitions/ErrorResponse"
|
||||
"501":
|
||||
description: Function not implemented
|
||||
post:
|
||||
description: start device
|
||||
operationId: devicesetDeviceRunPost
|
||||
@ -640,8 +670,12 @@ paths:
|
||||
description: On success return current state
|
||||
schema:
|
||||
$ref: "#/definitions/DeviceState"
|
||||
"400":
|
||||
description: Invalid device set index
|
||||
schema:
|
||||
$ref: "#/definitions/ErrorResponse"
|
||||
"404":
|
||||
description: Invalid device set index or device not found
|
||||
description: Device not found
|
||||
schema:
|
||||
$ref: "#/definitions/ErrorResponse"
|
||||
"500":
|
||||
@ -666,8 +700,12 @@ paths:
|
||||
description: On success return current state
|
||||
schema:
|
||||
$ref: "#/definitions/DeviceState"
|
||||
"400":
|
||||
description: Invalid device set index
|
||||
schema:
|
||||
$ref: "#/definitions/ErrorResponse"
|
||||
"404":
|
||||
description: Invalid device set index or device not found
|
||||
description: Device not found
|
||||
schema:
|
||||
$ref: "#/definitions/ErrorResponse"
|
||||
"500":
|
||||
|
@ -1374,6 +1374,9 @@ margin-bottom: 20px;
|
||||
<li data-group="DeviceSet" data-name="devicesetDeviceRunDelete" class="">
|
||||
<a href="#api-DeviceSet-devicesetDeviceRunDelete">devicesetDeviceRunDelete</a>
|
||||
</li>
|
||||
<li data-group="DeviceSet" data-name="devicesetDeviceRunGet" class="">
|
||||
<a href="#api-DeviceSet-devicesetDeviceRunGet">devicesetDeviceRunGet</a>
|
||||
</li>
|
||||
<li data-group="DeviceSet" data-name="devicesetDeviceRunPost" class="">
|
||||
<a href="#api-DeviceSet-devicesetDeviceRunPost">devicesetDeviceRunPost</a>
|
||||
</li>
|
||||
@ -2229,7 +2232,50 @@ except ApiException as e:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Invalid device set index or device not found </h3>
|
||||
<h3> Status: 400 - Invalid device set index </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunDelete-400-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunDelete-400-schema">
|
||||
<div id='responses-devicesetDeviceRunDelete-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunDelete-400-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunDelete-400-schema-400');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunDelete-400-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Device not found </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
@ -2244,7 +2290,7 @@ except ApiException as e:
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index or device not found",
|
||||
"description" : "Device not found",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
@ -2326,6 +2372,432 @@ except ApiException as e:
|
||||
</article>
|
||||
</div>
|
||||
<hr>
|
||||
<div id="api-DeviceSet-devicesetDeviceRunGet">
|
||||
<article id="api-DeviceSet-devicesetDeviceRunGet-0" data-group="User" data-name="devicesetDeviceRunGet" data-version="0">
|
||||
<div class="pull-left">
|
||||
<h1>devicesetDeviceRunGet</h1>
|
||||
<p></p>
|
||||
</div>
|
||||
<div class="pull-right"></div>
|
||||
<div class="clearfix"></div>
|
||||
<p></p>
|
||||
<p class="marked">get device rune status</p>
|
||||
<p></p>
|
||||
<br />
|
||||
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/sdrangel/deviceset/{deviceSetIndex}/device/run</span></code></pre>
|
||||
<p>
|
||||
<h3>Usage and SDK Samples</h3>
|
||||
</p>
|
||||
<ul class="nav nav-tabs nav-tabs-examples">
|
||||
<li class="active"><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-curl">Curl</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-java">Java</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-android">Android</a></li>
|
||||
<!--<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-groovy">Groovy</a></li>-->
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-objc">Obj-C</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-javascript">JavaScript</a></li>
|
||||
<!--<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-angular">Angular</a></li>-->
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-csharp">C#</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-php">PHP</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-perl">Perl</a></li>
|
||||
<li class=""><a href="#examples-DeviceSet-devicesetDeviceRunGet-0-python">Python</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="examples-DeviceSet-devicesetDeviceRunGet-0-curl">
|
||||
<pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost:8091/sdrangel/deviceset/{deviceSetIndex}/device/run"</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-java">
|
||||
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
|
||||
import SWGSDRangel.auth.*;
|
||||
import SWGSDRangel.model.*;
|
||||
import SWGSDRangel.api.DeviceSetApi;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public class DeviceSetApiExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
DeviceSetApi apiInstance = new DeviceSetApi();
|
||||
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
try {
|
||||
DeviceState result = apiInstance.devicesetDeviceRunGet(deviceSetIndex);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling DeviceSetApi#devicesetDeviceRunGet");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-android">
|
||||
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.DeviceSetApi;
|
||||
|
||||
public class DeviceSetApiExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
DeviceSetApi apiInstance = new DeviceSetApi();
|
||||
Integer deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
try {
|
||||
DeviceState result = apiInstance.devicesetDeviceRunGet(deviceSetIndex);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling DeviceSetApi#devicesetDeviceRunGet");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
<!--
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-groovy">
|
||||
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
|
||||
</div> -->
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-objc">
|
||||
<pre class="prettyprint"><code class="language-cpp">Integer *deviceSetIndex = 56; // Index of device set in the device set list
|
||||
|
||||
DeviceSetApi *apiInstance = [[DeviceSetApi alloc] init];
|
||||
|
||||
[apiInstance devicesetDeviceRunGetWith:deviceSetIndex
|
||||
completionHandler: ^(DeviceState output, NSError* error) {
|
||||
if (output) {
|
||||
NSLog(@"%@", output);
|
||||
}
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error);
|
||||
}
|
||||
}];
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-javascript">
|
||||
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
|
||||
|
||||
var api = new SdRangel.DeviceSetApi()
|
||||
|
||||
var deviceSetIndex = 56; // {Integer} Index of device set in the device set list
|
||||
|
||||
|
||||
var callback = function(error, data, response) {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
} else {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}
|
||||
};
|
||||
api.devicesetDeviceRunGet(deviceSetIndex, callback);
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<!--<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-angular">
|
||||
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
|
||||
</div>-->
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-csharp">
|
||||
<pre class="prettyprint"><code class="language-cs">using System;
|
||||
using System.Diagnostics;
|
||||
using SWGSDRangel.Api;
|
||||
using SWGSDRangel.Client;
|
||||
using SWGSDRangel.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class devicesetDeviceRunGetExample
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new DeviceSetApi();
|
||||
var deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
|
||||
try
|
||||
{
|
||||
DeviceState result = apiInstance.devicesetDeviceRunGet(deviceSetIndex);
|
||||
Debug.WriteLine(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print("Exception when calling DeviceSetApi.devicesetDeviceRunGet: " + e.Message );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-php">
|
||||
<pre class="prettyprint"><code class="language-php"><?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
$api_instance = new Swagger\Client\Api\DeviceSetApi();
|
||||
$deviceSetIndex = 56; // Integer | Index of device set in the device set list
|
||||
|
||||
try {
|
||||
$result = $api_instance->devicesetDeviceRunGet($deviceSetIndex);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling DeviceSetApi->devicesetDeviceRunGet: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?></code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-perl">
|
||||
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
|
||||
use SWGSDRangel::Configuration;
|
||||
use SWGSDRangel::DeviceSetApi;
|
||||
|
||||
my $api_instance = SWGSDRangel::DeviceSetApi->new();
|
||||
my $deviceSetIndex = 56; # Integer | Index of device set in the device set list
|
||||
|
||||
eval {
|
||||
my $result = $api_instance->devicesetDeviceRunGet(deviceSetIndex => $deviceSetIndex);
|
||||
print Dumper($result);
|
||||
};
|
||||
if ($@) {
|
||||
warn "Exception when calling DeviceSetApi->devicesetDeviceRunGet: $@\n";
|
||||
}</code></pre>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="examples-DeviceSet-devicesetDeviceRunGet-0-python">
|
||||
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
|
||||
import time
|
||||
import swagger_sdrangel
|
||||
from swagger_sdrangel.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_sdrangel.DeviceSetApi()
|
||||
deviceSetIndex = 56 # Integer | Index of device set in the device set list
|
||||
|
||||
try:
|
||||
api_response = api_instance.deviceset_device_run_get(deviceSetIndex)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling DeviceSetApi->devicesetDeviceRunGet: %s\n" % e)</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
|
||||
<div class="methodsubtabletitle">Path parameters</div>
|
||||
<table id="methodsubtable">
|
||||
<tr>
|
||||
<th width="150px">Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr><td style="width:150px;">deviceSetIndex*</td>
|
||||
<td>
|
||||
|
||||
|
||||
<div id="d2e199_devicesetDeviceRunGet_deviceSetIndex">
|
||||
<div class="json-schema-view">
|
||||
<div class="primitive">
|
||||
<span class="type">
|
||||
Integer
|
||||
</span>
|
||||
|
||||
<div class="inner description">
|
||||
Index of device set in the device set list
|
||||
</div>
|
||||
</div>
|
||||
<div class="inner required">
|
||||
Required
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Responses</h2>
|
||||
<h3> Status: 200 - On success return current state </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-200-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-200-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "On success return current state",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/DeviceState"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-200-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-200-schema-200');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-200-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 400 - Invalid device set index </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-400-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-400-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-400-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-400-schema-400');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-400-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Device not found </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-404-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-404-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-404-schema-404' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Device not found",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-404-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-404-schema-404');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-404-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 500 - Error </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunGet-500-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunGet-500-schema">
|
||||
<div id='responses-devicesetDeviceRunGet-500-schema-500' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Error",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunGet-500-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunGet-500-schema-500');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunGet-500-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 501 - Function not implemented </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
</div>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
<hr>
|
||||
<div id="api-DeviceSet-devicesetDeviceRunPost">
|
||||
<article id="api-DeviceSet-devicesetDeviceRunPost-0" data-group="User" data-name="devicesetDeviceRunPost" data-version="0">
|
||||
<div class="pull-left">
|
||||
@ -2612,7 +3084,50 @@ except ApiException as e:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Invalid device set index or device not found </h3>
|
||||
<h3> Status: 400 - Invalid device set index </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#responses-devicesetDeviceRunPost-400-schema">Schema</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" style='margin-bottom: 10px;'>
|
||||
<div class="tab-pane active" id="responses-devicesetDeviceRunPost-400-schema">
|
||||
<div id='responses-devicesetDeviceRunPost-400-schema-400' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
};
|
||||
var schema = schemaWrapper.schema;
|
||||
if (schema.$ref != null) {
|
||||
schema = defsParser.$refs.get(schema.$ref);
|
||||
} else {
|
||||
schemaWrapper.definitions = Object.assign({}, defs);
|
||||
$RefParser.dereference(schemaWrapper).catch(function(err) {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(JSON.stringify(schema));
|
||||
var view = new JSONSchemaView(schema, 3);
|
||||
$('#responses-devicesetDeviceRunPost-400-schema-data').val(stringify(schema));
|
||||
var result = $('#responses-devicesetDeviceRunPost-400-schema-400');
|
||||
result.empty();
|
||||
result.append(view.render());
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<input id='responses-devicesetDeviceRunPost-400-schema-data' type='hidden' value=''></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3> Status: 404 - Device not found </h3>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-examples" >
|
||||
<li class="active">
|
||||
@ -2627,7 +3142,7 @@ except ApiException as e:
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var schemaWrapper = {
|
||||
"description" : "Invalid device set index or device not found",
|
||||
"description" : "Device not found",
|
||||
"schema" : {
|
||||
"$ref" : "#/definitions/ErrorResponse"
|
||||
}
|
||||
@ -10759,7 +11274,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2017-12-06T23:48:11.127+01:00
|
||||
Generated 2017-12-09T10:46:45.115+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -130,6 +130,56 @@ SWGDeviceSetApi::devicesetDeviceRunDeleteCallback(HttpRequestWorker * worker) {
|
||||
emit devicesetDeviceRunDeleteSignalE(output, error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSetApi::devicesetDeviceRunGet(qint32 device_set_index) {
|
||||
QString fullPath;
|
||||
fullPath.append(this->host).append(this->basePath).append("/sdrangel/deviceset/{deviceSetIndex}/device/run");
|
||||
|
||||
QString device_set_indexPathParam("{"); device_set_indexPathParam.append("deviceSetIndex").append("}");
|
||||
fullPath.replace(device_set_indexPathParam, stringValue(device_set_index));
|
||||
|
||||
|
||||
HttpRequestWorker *worker = new HttpRequestWorker();
|
||||
HttpRequestInput input(fullPath, "GET");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
foreach(QString key, this->defaultHeaders.keys()) {
|
||||
input.headers.insert(key, this->defaultHeaders.value(key));
|
||||
}
|
||||
|
||||
connect(worker,
|
||||
&HttpRequestWorker::on_execution_finished,
|
||||
this,
|
||||
&SWGDeviceSetApi::devicesetDeviceRunGetCallback);
|
||||
|
||||
worker->execute(&input);
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSetApi::devicesetDeviceRunGetCallback(HttpRequestWorker * 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();
|
||||
|
||||
emit devicesetDeviceRunGetSignal(output);
|
||||
emit devicesetDeviceRunGetSignalE(output, error_type, error_str);
|
||||
}
|
||||
|
||||
void
|
||||
SWGDeviceSetApi::devicesetDeviceRunPost(qint32 device_set_index) {
|
||||
QString fullPath;
|
||||
|
@ -39,6 +39,7 @@ public:
|
||||
|
||||
void devicesetDevicePut(qint32 device_set_index, SWGDeviceListItem body);
|
||||
void devicesetDeviceRunDelete(qint32 device_set_index);
|
||||
void devicesetDeviceRunGet(qint32 device_set_index);
|
||||
void devicesetDeviceRunPost(qint32 device_set_index);
|
||||
void devicesetDeviceSettingsGet(qint32 device_set_index);
|
||||
void devicesetDeviceSettingsPatch(qint32 device_set_index, SWGDeviceSettings body);
|
||||
@ -48,6 +49,7 @@ public:
|
||||
private:
|
||||
void devicesetDevicePutCallback (HttpRequestWorker * worker);
|
||||
void devicesetDeviceRunDeleteCallback (HttpRequestWorker * worker);
|
||||
void devicesetDeviceRunGetCallback (HttpRequestWorker * worker);
|
||||
void devicesetDeviceRunPostCallback (HttpRequestWorker * worker);
|
||||
void devicesetDeviceSettingsGetCallback (HttpRequestWorker * worker);
|
||||
void devicesetDeviceSettingsPatchCallback (HttpRequestWorker * worker);
|
||||
@ -57,6 +59,7 @@ private:
|
||||
signals:
|
||||
void devicesetDevicePutSignal(SWGDeviceListItem* summary);
|
||||
void devicesetDeviceRunDeleteSignal(SWGDeviceState* summary);
|
||||
void devicesetDeviceRunGetSignal(SWGDeviceState* summary);
|
||||
void devicesetDeviceRunPostSignal(SWGDeviceState* summary);
|
||||
void devicesetDeviceSettingsGetSignal(SWGDeviceSettings* summary);
|
||||
void devicesetDeviceSettingsPatchSignal(SWGDeviceSettings* summary);
|
||||
@ -65,6 +68,7 @@ signals:
|
||||
|
||||
void devicesetDevicePutSignalE(SWGDeviceListItem* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void devicesetDeviceRunDeleteSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void devicesetDeviceRunGetSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void devicesetDeviceRunPostSignalE(SWGDeviceState* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void devicesetDeviceSettingsGetSignalE(SWGDeviceSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
void devicesetDeviceSettingsPatchSignalE(SWGDeviceSettings* summary, QNetworkReply::NetworkError error_type, QString& error_str);
|
||||
|
52
swagger/sdrangel/examples/devicesets_config.py
Normal file
52
swagger/sdrangel/examples/devicesets_config.py
Normal file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import requests
|
||||
|
||||
base_url = "http://127.0.0.1:8091/sdrangel"
|
||||
|
||||
# commands list. Each command is a list:
|
||||
# - URL suffix (API function)
|
||||
# - HTTP method (GET, PATCH, POST, PUT, DELETE)
|
||||
# - Params as key:value pairs or None if unused
|
||||
# - JSON body or None if unused
|
||||
# - Descriptive message fragment
|
||||
commands = [
|
||||
["/deviceset/0/device", "PUT", None, {"hwType": "BladeRF"}, "setup BladeRF on Rx 0"],
|
||||
["/preset", "PATCH", None, {"deviceSetIndex": 0, "preset": {"groupName": "OM144", "centerFrequency": 145640000, "type": "R", "name": "Repeaters extended"}}, "load preset on Rx 0"],
|
||||
["/devicesets", "POST", None, None, "add Rx 1 device set"],
|
||||
["/deviceset/1/device", "PUT", None, {"hwType": "SDRdaemonSource"}, "setup SDRdaemonSource on Rx 1"],
|
||||
["/preset", "PATCH", None, {"deviceSetIndex": 1, "preset": {"groupName": "OM430", "centerFrequency": 439550000, "type": "R", "name": "F5ZKP Daemon RPi3 SUSE"}}, "load preset on Rx 1"],
|
||||
["/devicesets", "POST", None, None, "add Rx 2 device set"],
|
||||
["/deviceset/2/device", "PUT", None, {"hwType": "SDRplay1"}, "setup SDRplay on Rx 2"],
|
||||
["/preset", "PATCH", None, {"deviceSetIndex": 2, "preset": {"groupName": "40m", "centerFrequency": 7130000, "type": "R", "name": "SSB low"}}, "load preset on Rx 2"],
|
||||
["/dvserial", "PATCH", {"dvserial": 1}, None, "set DV serial processing for AMBE frames decoding"],
|
||||
["/preset", "PATCH", None, {"deviceSetIndex": 0, "preset": {"groupName": "OM144", "centerFrequency": 145640000, "type": "R", "name": "Repeaters extended"}}, "load preset on Rx 0 twice"],
|
||||
["/deviceset/0/device/run", "POST", None, None, "Start device on deviceset R0"],
|
||||
["/deviceset/1/device/run", "POST", None, None, "Start device on deviceset R1"],
|
||||
["/deviceset/2/device/run", "POST", None, None, "Start device on deviceset R2"],
|
||||
]
|
||||
|
||||
requests_methods = {
|
||||
"GET": requests.get,
|
||||
"PATCH": requests.patch,
|
||||
"POST": requests.post,
|
||||
"PUT": requests.put,
|
||||
"DELETE": requests.delete
|
||||
}
|
||||
|
||||
for command in commands:
|
||||
url = base_url + command[0]
|
||||
method = requests_methods.get(command[1], None)
|
||||
if method is not None:
|
||||
r = method(url=url, params=command[2], json=command[3])
|
||||
if r.status_code == 200:
|
||||
print("Done: %s" % command[4])
|
||||
else:
|
||||
print("Error %d:%s" % (r.status_code, command[4]))
|
||||
print(r.text)
|
||||
exit(1)
|
||||
else:
|
||||
print("requests method error")
|
||||
exit(1)
|
||||
|
||||
print("All done!")
|
@ -73,12 +73,12 @@ def main():
|
||||
return
|
||||
settings = getRtlSdrSettings()
|
||||
if settings is not None:
|
||||
deviceRun(True)
|
||||
settings["agc"] = 1
|
||||
settings["dcBlock"] = 1
|
||||
settings["gain"] = 445
|
||||
settings["centerFrequency"] = 467350000
|
||||
settings["centerFrequency"] = 433900000
|
||||
patchRtlSdrSettings(settings)
|
||||
deviceRun(True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user