1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

Web API: /sdrangel/deviceset/{deviceSetIndex}/device/run POST,DELETE: return previous state instead of attempt to wait and return the state after change since it does not work reliably

This commit is contained in:
f4exb 2017-12-14 23:29:12 +01:00
parent ee2a8de0be
commit 6de0e20ceb
25 changed files with 35 additions and 69 deletions

View File

@ -103,7 +103,7 @@ HackRF is better used with a sampling rate of 4.8 MS/s and above. The 2.4 and 3.
<h2>LimeSDR</h2>
<p><b>&#9888; The plugins should work normally when running as single instances. Support of many Rx and/or Tx instances running concurrently is considered experimental.</b></b>
<p><b>&#9888; The plugins should work normally when running as single instances. Support of many Rx and/or Tx instances running concurrently is considered experimental.</b></p>
You will need a minimal installation of LimeSuite. Presently version 17.12.1 should be used with its corresponding firmware (v4) and gateware (v2.12) installed in the LimeSDR device:

View File

@ -22,8 +22,8 @@ const char *fcd_traits<ProPlus>::displayedName = "FunCube Dongle Pro+";
const char *fcd_traits<Pro>::pluginDisplayedName = "FunCube Pro Input";
const char *fcd_traits<ProPlus>::pluginDisplayedName = "FunCube Pro+ Input";
const char *fcd_traits<Pro>::pluginVersion = "3.8.0";
const char *fcd_traits<ProPlus>::pluginVersion = "3.8.0";
const char *fcd_traits<Pro>::pluginVersion = "3.8.6";
const char *fcd_traits<ProPlus>::pluginVersion = "3.8.6";
const int64_t fcd_traits<Pro>::loLowLimitFreq = 64000000L;
const int64_t fcd_traits<ProPlus>::loLowLimitFreq = 150000L;

View File

@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -509,6 +508,7 @@ int BladerfOutput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -518,8 +518,6 @@ int BladerfOutput::webapiRun(
m_guiMessageQueue->push(messagetoGui);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -289,6 +288,7 @@ int FileSinkOutput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -298,8 +298,6 @@ int FileSinkOutput::webapiRun(
m_guiMessageQueue->push(messagetoGui);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -25,7 +25,7 @@
const PluginDescriptor FileSinkPlugin::m_pluginDescriptor = {
QString("File sink output"),
QString("3.8.0"),
QString("3.8.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -18,7 +18,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -436,6 +435,7 @@ int HackRFOutput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -445,8 +445,6 @@ int HackRFOutput::webapiRun(
m_guiMessageQueue->push(messagetoGui);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -18,7 +18,6 @@
#include <QDebug>
#include <cstddef>
#include <string.h>
#include <unistd.h>
#include "lime/LimeSuite.h"
#include "SWGDeviceSettings.h"
@ -1116,6 +1115,7 @@ int LimeSDROutput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -1125,7 +1125,5 @@ int LimeSDROutput::webapiRun(
m_guiMessageQueue->push(messagetoGui);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -15,7 +15,6 @@
///////////////////////////////////////////////////////////////////////////////////
#include <QDebug>
#include <unistd.h>
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
@ -514,6 +513,7 @@ int PlutoSDROutput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -523,8 +523,6 @@ int PlutoSDROutput::webapiRun(
m_guiMessageQueue->push(messagetoGui);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -311,6 +310,7 @@ int SDRdaemonSinkOutput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -320,8 +320,6 @@ int SDRdaemonSinkOutput::webapiRun(
m_guiMessageQueue->push(messagetoGui);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -26,7 +26,7 @@
const PluginDescriptor SDRdaemonSinkPlugin::m_pluginDescriptor = {
QString("SDRdaemon sink output"),
QString("3.8.0"),
QString("3.8.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -583,6 +582,7 @@ int AirspyInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -592,8 +592,6 @@ int AirspyInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -27,7 +27,7 @@
const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
QString("Airspy Input"),
QString("3.8.0"),
QString("3.8.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -18,7 +18,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -581,6 +580,7 @@ int BladerfInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -590,8 +590,6 @@ int BladerfInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -20,7 +20,6 @@
#include <QDebug>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
@ -715,6 +714,7 @@ int FCDProInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -724,7 +724,5 @@ int FCDProInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -19,7 +19,6 @@
#include <QDebug>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
@ -426,6 +425,7 @@ int FCDProPlusInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -435,8 +435,6 @@ int FCDProPlusInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -340,6 +339,7 @@ int FileSourceInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -349,8 +349,6 @@ int FileSourceInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -18,7 +18,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -525,6 +524,7 @@ int HackRFInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -534,8 +534,6 @@ int HackRFInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -18,7 +18,6 @@
#include <QDebug>
#include <cstddef>
#include <string.h>
#include <unistd.h>
#include "lime/LimeSuite.h"
#include "SWGDeviceSettings.h"
@ -1281,6 +1280,7 @@ int LimeSDRInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -1290,8 +1290,6 @@ int LimeSDRInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -15,7 +15,6 @@
///////////////////////////////////////////////////////////////////////////////////
#include <QDebug>
#include <unistd.h>
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
@ -601,6 +600,7 @@ int PlutoSDRInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -610,8 +610,6 @@ int PlutoSDRInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -18,7 +18,6 @@
#include <QDebug>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "SWGDeviceSettings.h"
#include "SWGRtlSdrSettings.h"
@ -564,6 +563,7 @@ int RTLSDRInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -573,7 +573,5 @@ int RTLSDRInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -245,6 +244,7 @@ int SDRdaemonSourceInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -254,8 +254,6 @@ int SDRdaemonSourceInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -16,7 +16,6 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <QDebug>
#include "SWGDeviceSettings.h"
@ -605,6 +604,7 @@ int SDRPlayInput::webapiRun(
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage __attribute__((unused)))
{
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
MsgStartStop *message = MsgStartStop::create(run);
m_inputMessageQueue.push(message);
@ -614,8 +614,6 @@ int SDRPlayInput::webapiRun(
m_guiMessageQueue->push(msgToGUI);
}
usleep(100000);
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
return 200;
}

View File

@ -4682,7 +4682,7 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success return current state </h3>
<h3> Status: 200 - On success return state before change </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
@ -4697,7 +4697,7 @@ except ApiException as e:
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return current state",
"description" : "On success return state before change",
"schema" : {
"$ref" : "#/definitions/DeviceState"
}
@ -5534,7 +5534,7 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success return current state </h3>
<h3> Status: 200 - On success return state before change </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
@ -5549,7 +5549,7 @@ except ApiException as e:
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return current state",
"description" : "On success return state before change",
"schema" : {
"$ref" : "#/definitions/DeviceState"
}
@ -13767,7 +13767,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2017-12-12T23:11:28.100+01:00
Generated 2017-12-14T23:27:25.824+01:00
</div>
</div>
</div>

View File

@ -667,7 +667,7 @@ paths:
description: Index of device set in the device set list
responses:
"200":
description: On success return current state
description: On success return state before change
schema:
$ref: "#/definitions/DeviceState"
"400":
@ -697,7 +697,7 @@ paths:
description: Index of device set in the device set list
responses:
"200":
description: On success return current state
description: On success return state before change
schema:
$ref: "#/definitions/DeviceState"
"400":

View File

@ -4682,7 +4682,7 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success return current state </h3>
<h3> Status: 200 - On success return state before change </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
@ -4697,7 +4697,7 @@ except ApiException as e:
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return current state",
"description" : "On success return state before change",
"schema" : {
"$ref" : "#/definitions/DeviceState"
}
@ -5534,7 +5534,7 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success return current state </h3>
<h3> Status: 200 - On success return state before change </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
@ -5549,7 +5549,7 @@ except ApiException as e:
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return current state",
"description" : "On success return state before change",
"schema" : {
"$ref" : "#/definitions/DeviceState"
}
@ -13767,7 +13767,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2017-12-12T23:11:28.100+01:00
Generated 2017-12-14T23:27:25.824+01:00
</div>
</div>
</div>