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:
@@ -28,7 +28,9 @@
|
||||
#include "SWGXtrxInputSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGXtrxInputReport.h"
|
||||
#include "SWGXtrxInputActions.h"
|
||||
|
||||
#include "device/deviceapi.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
@@ -1511,6 +1513,37 @@ int XTRXInput::webapiRun(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int XTRXInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGXtrxInputActions *swgXtrxInputActions = query.getXtrxInputActions();
|
||||
|
||||
if (swgXtrxInputActions)
|
||||
{
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgXtrxInputActions->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 XtrxInputActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void XTRXInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
|
||||
{
|
||||
int ret;
|
||||
|
||||
Reference in New Issue
Block a user