mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
REST API device and channel actions: extension of record action: implementation
This commit is contained in:
@@ -22,7 +22,9 @@
|
||||
#include "SWGDeviceSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGPlutoSdrInputReport.h"
|
||||
#include "SWGPlutoSdrInputActions.h"
|
||||
|
||||
#include "dsp/filerecord.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
@@ -929,6 +931,37 @@ int PlutoSDRInput::webapiReportGet(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int PlutoSDRInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGPlutoSdrInputActions *swgPlutoSdrInputActions = query.getPlutoSdrInputActions();
|
||||
|
||||
if (swgPlutoSdrInputActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgPlutoSdrInputActions->getRecord() != 0;
|
||||
MsgFileRecord *msg = MsgFileRecord::create(record);
|
||||
getInputMessageQueue()->push(msg);
|
||||
|
||||
if (getMessageQueueToGUI())
|
||||
{
|
||||
MsgFileRecord *msgToGUI = MsgFileRecord::create(record);
|
||||
getMessageQueueToGUI()->push(msgToGUI);
|
||||
}
|
||||
}
|
||||
|
||||
return 202;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMessage = "Missing PlutoSdrInputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void PlutoSDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const PlutoSDRInputSettings& settings)
|
||||
{
|
||||
response.getPlutoSdrInputSettings()->setCenterFrequency(settings.m_centerFrequency);
|
||||
|
||||
Reference in New Issue
Block a user