1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 16:34:45 -04: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
+1 -3
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;
}
+1 -1
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,
@@ -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;
}
+1 -3
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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
+1 -3
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;
}
@@ -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;
}
@@ -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;
}