1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-23 02:24:16 -04:00

Implemented run action API in relevant feature plugins

This commit is contained in:
f4exb
2021-10-22 02:01:33 +02:00
parent 9f42957585
commit 920fa82022
55 changed files with 1697 additions and 13 deletions
+21 -2
View File
@@ -263,11 +263,22 @@ int SimplePTT::webapiActionsPost(
if (swgSimplePTTActions)
{
bool unknownAction = true;
if (featureActionsKeys.contains("run"))
{
bool featureRun = swgSimplePTTActions->getRun() != 0;
unknownAction = false;
MsgStartStop *msg = MsgStartStop::create(featureRun);
getInputMessageQueue()->push(msg);
}
if (featureActionsKeys.contains("ptt"))
{
bool ptt = swgSimplePTTActions->getPtt() != 0;
unknownAction = false;
MsgPTT *msg = MsgPTT::create(ptt);
getInputMessageQueue()->push(msg);
if (getMessageQueueToGUI())
@@ -277,7 +288,15 @@ int SimplePTT::webapiActionsPost(
}
}
return 202;
if (unknownAction)
{
errorMessage = "Unknown action";
return 400;
}
else
{
return 202;
}
}
else
{