mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 14:04:46 -04:00
REST API device and channel actions: fixes to implementation
This commit is contained in:
@@ -757,6 +757,7 @@ int RTLSDRInput::webapiReportGet(
|
||||
}
|
||||
|
||||
int RTLSDRInput::webapiActionsPost(
|
||||
const QStringList& deviceActionsKeys,
|
||||
SWGSDRangel::SWGDeviceActions& query,
|
||||
QString& errorMessage)
|
||||
{
|
||||
@@ -764,14 +765,24 @@ int RTLSDRInput::webapiActionsPost(
|
||||
|
||||
if (swgRtlSdrActions)
|
||||
{
|
||||
bool record = swgRtlSdrActions->getRecord() != 0;
|
||||
MsgFileRecord *msg = MsgFileRecord::create(record);
|
||||
getInputMessageQueue()->push(msg);
|
||||
if (deviceActionsKeys.contains("record"))
|
||||
{
|
||||
bool record = swgRtlSdrActions->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 RtlSdrActions key in JSON body";
|
||||
errorMessage = "Missing RtlSdrActions in query";
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user