mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 14:04:46 -04:00
REST API device and channel actions: general implementation and RTLSDR and FileSource implementations
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "SWGRtlSdrSettings.h"
|
||||
#include "SWGDeviceState.h"
|
||||
#include "SWGDeviceReport.h"
|
||||
#include "SWGDeviceActions.h"
|
||||
#include "SWGRtlSdrReport.h"
|
||||
|
||||
#include "rtlsdrinput.h"
|
||||
@@ -755,6 +756,26 @@ int RTLSDRInput::webapiReportGet(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int RTLSDRInput::webapiActionsPost(
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
SWGSDRangel::SWGRtlSdrActions *swgRtlSdrActions = query.getRtlSdrActions();
|
||||
|
||||
if (swgRtlSdrActions)
|
||||
{
|
||||
bool record = swgRtlSdrActions->getRecord() != 0;
|
||||
MsgFileRecord *msg = MsgFileRecord::create(record);
|
||||
getInputMessageQueue()->push(msg);
|
||||
return 202;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMessage = "Missing RtlSdrActions key in JSON body";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
void RTLSDRInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
|
||||
{
|
||||
response.getRtlSdrReport()->setGains(new QList<SWGSDRangel::SWGGain*>);
|
||||
|
||||
Reference in New Issue
Block a user