mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
Web API: implemented device run APIs for BladeRF output, HackRF, PlutoSDR and LimeSDR ourput
This commit is contained in:
@@ -16,8 +16,12 @@
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "device/devicesinkapi.h"
|
||||
#include "plutosdr/deviceplutosdrparams.h"
|
||||
@@ -560,3 +564,34 @@ float PlutoSDRInput::getTemperature()
|
||||
DevicePlutoSDRBox *plutoBox = m_deviceShared.m_deviceParams->getBox();
|
||||
return plutoBox->getTemp();
|
||||
}
|
||||
|
||||
int PlutoSDRInput::webapiRunGet(
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
|
||||
return 200;
|
||||
}
|
||||
|
||||
int PlutoSDRInput::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