mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 23:45:00 -04:00
Web API: RTLSDR run implementation
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGRtlSdrSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
|
||||
#include "rtlsdrinput.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
@@ -524,3 +525,26 @@ int RTLSDRInput::webapiSettingsPutPatch(
|
||||
|
||||
return 200;
|
||||
}
|
||||
|
||||
int RTLSDRInput::webapiRun(
|
||||
bool run,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
if (run)
|
||||
{
|
||||
if (m_deviceAPI->initAcquisition())
|
||||
{
|
||||
m_deviceAPI->startAcquisition();
|
||||
DSPEngine::instance()->startAudioOutput();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_deviceAPI->stopAcquisition();
|
||||
DSPEngine::instance()->stopAudioOutput();
|
||||
}
|
||||
|
||||
m_deviceAPI->getDeviceEngineStateStr(*response.getState());
|
||||
return 200;
|
||||
}
|
||||
|
||||
@@ -115,6 +115,11 @@ public:
|
||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiRun(
|
||||
bool run,
|
||||
SWGSDRangel::SWGDeviceState& response,
|
||||
QString& errorMessage);
|
||||
|
||||
const std::vector<int>& getGains() const { return m_gains; }
|
||||
void set_ds_mode(int on);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user