1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 14:04:46 -04:00

BladeRF2: REST API: implemented actions: implementation

This commit is contained in:
f4exb
2020-03-30 21:35:29 +02:00
parent 69a7540ce3
commit 597633009c
3 changed files with 55 additions and 0 deletions
@@ -26,6 +26,8 @@
#include "SWGDeviceState.h"
#include "SWGDeviceReport.h"
#include "SWGBladeRF2InputReport.h"
#include "SWGDeviceActions.h"
#include "SWGBladeRF2InputActions.h"
#include "device/deviceapi.h"
#include "dsp/dspcommands.h"
@@ -1248,6 +1250,37 @@ int BladeRF2Input::webapiRun(
return 200;
}
int BladeRF2Input::webapiActionsPost(
const QStringList& deviceActionsKeys,
SWGSDRangel::SWGDeviceActions& query,
QString& errorMessage)
{
SWGSDRangel::SWGBladeRF2InputActions *swgBladeRF2InputActions = query.getBladeRf2InputActions();
if (swgBladeRF2InputActions)
{
if (deviceActionsKeys.contains("record"))
{
bool record = swgBladeRF2InputActions->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 BladeRF2InputActions in query";
return 400;
}
}
void BladeRF2Input::webapiReverseSendSettings(QList<QString>& deviceSettingsKeys, const BladeRF2InputSettings& settings, bool force)
{
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();