mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 13:47:01 -04:00
Web API: implemented device run APIs for BladeRF output, HackRF, PlutoSDR and LimeSDR ourput
This commit is contained in:
@@ -22,11 +22,13 @@
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGLimeSdrInputSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "limesdrinput.h"
|
||||
#include "limesdrinputthread.h"
|
||||
#include "limesdr/devicelimesdrparam.h"
|
||||
@@ -1243,3 +1245,33 @@ int LimeSDRInput::webapiSettingsPutPatch(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int LimeSDRInput::webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
|
||||
return 200;
|
||||
}
|
||||
|
||||
int LimeSDRInput::webapiRun(
|
||||
bool run,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
if (run)
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
DSPEngine::instance()->startAudioOutputImmediate();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
|
||||
return 200;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user