mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 07:24:44 -04:00
Web API: implemented device run APIs for Airspy, FCD Pro, FCD Pro+ and File Source i.e. the rest of source device plugins
This commit is contained in:
@@ -16,8 +16,12 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <QDebug>
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "airspygui.h"
|
||||
#include "airspyinput.h"
|
||||
|
||||
@@ -565,3 +569,31 @@ struct airspy_device *AirspyInput::open_airspy_from_sequence(int sequence)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AirspyInput::webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
|
||||
return 200;
|
||||
}
|
||||
|
||||
int AirspyInput::webapiRun(
|
||||
bool run,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
MsgStartStop *message = MsgStartStop::create(run);
|
||||
m_inputMessageQueue.push(message);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
MsgStartStop *msgToGUI = MsgStartStop::create(run);
|
||||
m_guiMessageQueue->push(msgToGUI);
|
||||
}
|
||||
|
||||
usleep(100000);
|
||||
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
|
||||
return 200;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user